diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index 9774d4a93..050832512 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -117,7 +117,7 @@ void static RandomTransaction(CMutableTransaction &tx, bool fSingle, uint32_t co tx.nVersionGroupId = OVERWINTER_VERSION_GROUP_ID; tx.nVersion = overwinter_version_dist(rng); } - tx.nExpiryHeight = (insecure_rand() % 2) ? insecure_rand() : 0; + tx.nExpiryHeight = (insecure_rand() % 2) ? insecure_rand() % TX_EXPIRY_HEIGHT_THRESHOLD : 0; } else { tx.nVersion = insecure_rand() & 0x7FFFFFFF; } @@ -229,7 +229,8 @@ BOOST_AUTO_TEST_CASE(sighash_test) #endif for (int i=0; i raw = ParseHex(raw_script); scriptCode.insert(scriptCode.end(), raw.begin(), raw.end()); + } catch (const std::exception& ex) { + BOOST_ERROR("Bad test, couldn't deserialize data: " << strTest << ": " << ex.what()); + continue; } catch (...) { BOOST_ERROR("Bad test, couldn't deserialize data: " << strTest); continue;