diff options
author | Gregory Maxwell <greg@xiph.org> | 2013-12-02 11:33:44 -0800 |
---|---|---|
committer | Gregory Maxwell <greg@xiph.org> | 2013-12-02 11:33:44 -0800 |
commit | 9b59e3bda8c137bff885db5b1f9150346e36e076 (patch) | |
tree | b00689d36050d3c2f301329a863234c510546b88 /src/wallet.cpp | |
parent | 9ab7a0609ee920b1095235bc7460c9c0b60acf29 (diff) |
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.
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r-- | src/wallet.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index b9110d1271..14d685d6e2 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -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()); } |