From 7c68cc074782c76c00f32cc077aa2c40f5975a68 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Mon, 30 May 2016 21:38:44 -0600 Subject: [PATCH] Add additional assertions. --- src/main.cpp | 3 +++ src/test/sighash_tests.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 59c994770..2e4c1b86d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,6 +33,7 @@ #include #include #include +#include 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() diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index 2960873c7..f8732bde2 100644 --- a/src/test/sighash_tests.cpp +++ b/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);