Changeset View
Changeset View
Standalone View
Standalone View
src/test/undo_tests.cpp
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(connect_utxo_extblock) { | ||||
tx.vout[0].scriptPubKey = CScript() << OP_TRUE; | tx.vout[0].scriptPubKey = CScript() << OP_TRUE; | ||||
tx.vin[0].prevout.hash = GetRandHash(); | tx.vin[0].prevout.hash = GetRandHash(); | ||||
tx.vin[0].prevout.n = 0; | tx.vin[0].prevout.n = 0; | ||||
tx.vin[0].nSequence = CTxIn::SEQUENCE_FINAL; | tx.vin[0].nSequence = CTxIn::SEQUENCE_FINAL; | ||||
tx.vin[0].scriptSig.resize(0); | tx.vin[0].scriptSig.resize(0); | ||||
tx.nVersion = 2; | tx.nVersion = 2; | ||||
auto prevTx0 = CTransaction(tx); | auto prevTx0 = CTransaction(tx); | ||||
view.ModifyNewCoins(prevTx0.GetId(), prevTx0.IsCoinBase()) | AddCoins(view, prevTx0, 100); | ||||
->FromTx(prevTx0, 100); | |||||
tx.vin[0].prevout.hash = prevTx0.GetId(); | tx.vin[0].prevout.hash = prevTx0.GetId(); | ||||
auto tx0 = CTransaction(tx); | auto tx0 = CTransaction(tx); | ||||
block.vtx[1] = MakeTransactionRef(tx0); | block.vtx[1] = MakeTransactionRef(tx0); | ||||
// Now update the UTXO set. | // Now update the UTXO set. | ||||
CBlockUndo blockundo; | CBlockUndo blockundo; | ||||
UpdateUTXOSet(block, view, blockundo, chainparams, 123456); | UpdateUTXOSet(block, view, blockundo, chainparams, 123456); | ||||
Show All 15 Lines |