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.
Conflicts:
src/key.cpp
src/main.cpp
src/wallet.cpp
using namespace std;
using namespace boost;
+#if defined(NDEBUG)
+# error "Litecoin cannot be compiled without assertions."
+#endif
+
//
// Global state
//
void CTransaction::UpdateCoins(CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight, const uint256 &txhash) const
{
+ bool ret;
// mark inputs spent
if (!IsCoinBase()) {
BOOST_FOREACH(const CTxIn &txin, vin) {
CCoins &coins = inputs.GetCoins(txin.prevout.hash);
CTxInUndo undo;
- assert(coins.Spend(txin.prevout, undo));
+ ret = coins.Spend(txin.prevout, undo);
+ assert(ret);
txundo.vprevout.push_back(undo);
}
}