Changeset View
Changeset View
Standalone View
Standalone View
src/test/txvalidationcache_tests.cpp
Show All 38 Lines | BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup) { | ||||
std::vector<CMutableTransaction> spends; | std::vector<CMutableTransaction> spends; | ||||
spends.resize(2); | spends.resize(2); | ||||
for (int i = 0; i < 2; i++) { | for (int i = 0; i < 2; i++) { | ||||
spends[i].nVersion = 1; | spends[i].nVersion = 1; | ||||
spends[i].vin.resize(1); | spends[i].vin.resize(1); | ||||
spends[i].vin[0].prevout.hash = coinbaseTxns[0].GetId(); | spends[i].vin[0].prevout.hash = coinbaseTxns[0].GetId(); | ||||
spends[i].vin[0].prevout.n = 0; | spends[i].vin[0].prevout.n = 0; | ||||
spends[i].vout.resize(1); | spends[i].vout.resize(1); | ||||
spends[i].vout[0].nValue = 11 * CENT; | spends[i].vout[0].nValue = 11 * CENT.GetSatoshis(); | ||||
spends[i].vout[0].scriptPubKey = scriptPubKey; | spends[i].vout[0].scriptPubKey = scriptPubKey; | ||||
// Sign: | // Sign: | ||||
std::vector<uint8_t> vchSig; | std::vector<uint8_t> vchSig; | ||||
uint256 hash = SignatureHash(scriptPubKey, spends[i], 0, | uint256 hash = SignatureHash(scriptPubKey, spends[i], 0, | ||||
SIGHASH_ALL | SIGHASH_FORKID, | SIGHASH_ALL | SIGHASH_FORKID, | ||||
coinbaseTxns[0].vout[0].nValue); | coinbaseTxns[0].vout[0].nValue); | ||||
BOOST_CHECK(coinbaseKey.Sign(hash, vchSig)); | BOOST_CHECK(coinbaseKey.Sign(hash, vchSig)); | ||||
Show All 34 Lines |