Add additional assertions.

This commit is contained in:
Sean Bowe 2016-05-30 21:38:44 -06:00
parent e8af0028eb
commit 7c68cc0747
2 changed files with 4 additions and 1 deletions

View File

@ -33,6 +33,7 @@
#include <boost/filesystem/fstream.hpp>
#include <boost/math/distributions/poisson.hpp>
#include <boost/thread.hpp>
#include <boost/static_assert.hpp>
using namespace std;
@ -992,6 +993,8 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
REJECT_INVALID, "error-computing-signature-hash");
}
BOOST_STATIC_ASSERT(crypto_sign_PUBLICKEYBYTES == 32);
if (crypto_sign_verify_detached(&tx.joinSplitSig[0],
dataToBeSigned.begin(), 32,
tx.joinSplitPubKey.begin()

View File

@ -82,7 +82,7 @@ uint256 static SignatureHashOld(CScript scriptCode, const CTransaction& txTo, un
}
// Blank out the joinsplit signature.
memset(&txTmp.joinSplitSig[0], 0, 64);
memset(&txTmp.joinSplitSig[0], 0, txTmp.joinSplitSig.size());
// Serialize and hash
CHashWriter ss(SER_GETHASH, 0);