Sanitize assert usage and refuse to compile with NDEBUG.
There were quite a few places where assert() was used with side effects, making operation with NDEBUG non-functional. This commit fixes all the cases I know about, but also adds an #error on NDEBUG because the code is untested without assertions and may still have vulnerabilities if used without assert.
This commit is contained in:
@@ -1298,7 +1298,9 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64_t> >& vecSend,
|
||||
|
||||
// Reserve a new key pair from key pool
|
||||
CPubKey vchPubKey;
|
||||
assert(reservekey.GetReservedKey(vchPubKey)); // should never fail, as we just unlocked
|
||||
bool ret;
|
||||
ret = reservekey.GetReservedKey(vchPubKey);
|
||||
assert(ret); // should never fail, as we just unlocked
|
||||
|
||||
scriptChange.SetDestination(vchPubKey.GetID());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user