From 9b59e3bda8c137bff885db5b1f9150346e36e076 Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Mon, 2 Dec 2013 11:33:44 -0800 Subject: 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. --- src/wallet.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/wallet.cpp') diff --git a/src/wallet.cpp b/src/wallet.cpp index b9110d127..14d685d6e 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1298,7 +1298,9 @@ bool CWallet::CreateTransaction(const vector >& 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()); } -- cgit v1.2.3