Browse Source

Add additional assertions.

pull/145/head
Sean Bowe 8 years ago
parent
commit
7c68cc0747
  1. 3
      src/main.cpp
  2. 2
      src/test/sighash_tests.cpp

3
src/main.cpp

@ -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()

2
src/test/sighash_tests.cpp

@ -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);

Loading…
Cancel
Save