Changeset View
Changeset View
Standalone View
Standalone View
src/test/denialofservice_tests.cpp
Show First 20 Lines • Show All 393 Lines • ▼ Show 20 Lines | if (it == mapOrphanTransactions.end()) { | ||||
it = mapOrphanTransactions.begin(); | it = mapOrphanTransactions.begin(); | ||||
} | } | ||||
return it->second.tx; | return it->second.tx; | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(DoS_mapOrphans) { | BOOST_AUTO_TEST_CASE(DoS_mapOrphans) { | ||||
CKey key; | CKey key; | ||||
key.MakeNewKey(true); | key.MakeNewKey(true); | ||||
CBasicKeyStore keystore; | FillableSigningProvider keystore; | ||||
keystore.AddKey(key); | keystore.AddKey(key); | ||||
// 50 orphan transactions: | // 50 orphan transactions: | ||||
for (int i = 0; i < 50; i++) { | for (int i = 0; i < 50; i++) { | ||||
CMutableTransaction tx; | CMutableTransaction tx; | ||||
tx.vin.resize(1); | tx.vin.resize(1); | ||||
tx.vin[0].prevout = COutPoint(TxId(InsecureRand256()), 0); | tx.vin[0].prevout = COutPoint(TxId(InsecureRand256()), 0); | ||||
tx.vin[0].scriptSig << OP_1; | tx.vin[0].scriptSig << OP_1; | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |