Changeset View
Changeset View
Standalone View
Standalone View
src/test/mempool_tests.cpp
Show All 25 Lines | BOOST_AUTO_TEST_CASE(MempoolRemoveTest) { | ||||
for (int i = 0; i < 3; i++) { | for (int i = 0; i < 3; i++) { | ||||
txParent.vout[i].scriptPubKey = CScript() << OP_11 << OP_EQUAL; | txParent.vout[i].scriptPubKey = CScript() << OP_11 << OP_EQUAL; | ||||
txParent.vout[i].nValue = Amount(33000LL); | txParent.vout[i].nValue = Amount(33000LL); | ||||
} | } | ||||
CMutableTransaction txChild[3]; | CMutableTransaction txChild[3]; | ||||
for (int i = 0; i < 3; i++) { | for (int i = 0; i < 3; i++) { | ||||
txChild[i].vin.resize(1); | txChild[i].vin.resize(1); | ||||
txChild[i].vin[0].scriptSig = CScript() << OP_11; | txChild[i].vin[0].scriptSig = CScript() << OP_11; | ||||
txChild[i].vin[0].prevout.hash = txParent.GetId(); | txChild[i].vin[0].prevout = COutPoint(txParent.GetId(), i); | ||||
txChild[i].vin[0].prevout.n = i; | |||||
txChild[i].vout.resize(1); | txChild[i].vout.resize(1); | ||||
txChild[i].vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL; | txChild[i].vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL; | ||||
txChild[i].vout[0].nValue = Amount(11000LL); | txChild[i].vout[0].nValue = Amount(11000LL); | ||||
} | } | ||||
CMutableTransaction txGrandChild[3]; | CMutableTransaction txGrandChild[3]; | ||||
for (int i = 0; i < 3; i++) { | for (int i = 0; i < 3; i++) { | ||||
txGrandChild[i].vin.resize(1); | txGrandChild[i].vin.resize(1); | ||||
txGrandChild[i].vin[0].scriptSig = CScript() << OP_11; | txGrandChild[i].vin[0].scriptSig = CScript() << OP_11; | ||||
txGrandChild[i].vin[0].prevout.hash = txChild[i].GetId(); | txGrandChild[i].vin[0].prevout = COutPoint(txChild[i].GetId(), 0); | ||||
txGrandChild[i].vin[0].prevout.n = 0; | |||||
txGrandChild[i].vout.resize(1); | txGrandChild[i].vout.resize(1); | ||||
txGrandChild[i].vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL; | txGrandChild[i].vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL; | ||||
txGrandChild[i].vout[0].nValue = Amount(11000LL); | txGrandChild[i].vout[0].nValue = Amount(11000LL); | ||||
} | } | ||||
CTxMemPool testPool; | CTxMemPool testPool; | ||||
// Nothing in pool, remove should do nothing: | // Nothing in pool, remove should do nothing: | ||||
▲ Show 20 Lines • Show All 615 Lines • Show Last 20 Lines |