diff options
| author | Cory Fields <[email protected]> | 2018-06-04 14:55:00 -0400 |
|---|---|---|
| committer | Cory Fields <[email protected]> | 2018-06-04 14:55:00 -0400 |
| commit | 0231ef6c6d4f45edffda4ac3bce2048f9c8a8c00 (patch) | |
| tree | e5a1f04b5df71b48285bbe67e165b11a94fd2b98 /src/bitcoin-cli.cpp | |
| parent | Merge #13191: Specialized double-SHA256 with 64 byte inputs with SSE4.1 and AVX2 (diff) | |
| download | discoin-0231ef6c6d4f45edffda4ac3bce2048f9c8a8c00.tar.xz discoin-0231ef6c6d4f45edffda4ac3bce2048f9c8a8c00.zip | |
cli: Ignore libevent warnings
Diffstat (limited to 'src/bitcoin-cli.cpp')
| -rw-r--r-- | src/bitcoin-cli.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index be5ce1448..b332b5e58 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -56,6 +56,18 @@ static void SetupCliArgs() gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN); } +/** libevent event log callback */ +static void libevent_log_cb(int severity, const char *msg) +{ +#ifndef EVENT_LOG_ERR // EVENT_LOG_ERR was added in 2.0.19; but before then _EVENT_LOG_ERR existed. +# define EVENT_LOG_ERR _EVENT_LOG_ERR +#endif + // Ignore everything other than errors + if (severity >= EVENT_LOG_ERR) { + throw std::runtime_error(strprintf("libevent error: %s", msg)); + } +} + ////////////////////////////////////////////////////////////////////////////// // // Start @@ -506,6 +518,7 @@ int main(int argc, char* argv[]) fprintf(stderr, "Error: Initializing networking failed\n"); return EXIT_FAILURE; } + event_set_log_callback(&libevent_log_cb); try { int ret = AppInitRPC(argc, argv); |