mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Merge #13534: Don't assert(foo()) where foo() has side effects
6ad0328f1c Don't assert(foo()) where foo has side effects (practicalswift)
Pull request description:
Don't `assert(foo())` where `foo` has side effects.
From `assert(3)`:
> If the macro `NDEBUG` is defined at the moment `<assert.h>` was last included, the macro `assert()` generates no code, and hence does nothing at all.
Bitcoin currently cannot be compiled without assertions, but we shouldn't rely on that.
Tree-SHA512: 28cff0c6d1c2fb612ca58c9c94142ed01c5cfd0a2fecb8e59cdb6c270374b215d952ed3491d921d84dc1b439fa49da4f0e75e080f6adcbc6b0e08be14e54c170
This commit is contained in:
@@ -244,8 +244,9 @@ bool StartHTTPRPC()
|
||||
// ifdef can be removed once we switch to better endpoint support and API versioning
|
||||
RegisterHTTPHandler("/wallet/", false, HTTPReq_JSONRPC);
|
||||
#endif
|
||||
assert(EventBase());
|
||||
httpRPCTimerInterface = MakeUnique<HTTPRPCTimerInterface>(EventBase());
|
||||
struct event_base* eventBase = EventBase();
|
||||
assert(eventBase);
|
||||
httpRPCTimerInterface = MakeUnique<HTTPRPCTimerInterface>(eventBase);
|
||||
RPCSetTimerInterface(httpRPCTimerInterface.get());
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user