Changeset View
Changeset View
Standalone View
Standalone View
src/test/denialofservice_tests.cpp
Show First 20 Lines • Show All 448 Lines • ▼ Show 20 Lines | for (int i = 0; i < 10; i++) { | ||||
GetScriptForDestination(key.GetPubKey().GetID()); | GetScriptForDestination(key.GetPubKey().GetID()); | ||||
tx.vin.resize(2777); | tx.vin.resize(2777); | ||||
for (size_t j = 0; j < tx.vin.size(); j++) { | for (size_t j = 0; j < tx.vin.size(); j++) { | ||||
tx.vin[j].prevout = COutPoint(txPrev->GetId(), j); | tx.vin[j].prevout = COutPoint(txPrev->GetId(), j); | ||||
} | } | ||||
SignSignature(keystore, *txPrev, tx, 0, SigHashType()); | SignSignature(keystore, *txPrev, tx, 0, SigHashType()); | ||||
// Re-use same signature for other inputs | // Re-use same signature for other inputs | ||||
// (they don't have to be valid for this test) | // (they don't have to be valid for this test) | ||||
for (unsigned int j = 1; j < tx.vin.size(); j++) | for (unsigned int j = 1; j < tx.vin.size(); j++) { | ||||
tx.vin[j].scriptSig = tx.vin[0].scriptSig; | tx.vin[j].scriptSig = tx.vin[0].scriptSig; | ||||
} | |||||
BOOST_CHECK(!AddOrphanTx(MakeTransactionRef(tx), i)); | BOOST_CHECK(!AddOrphanTx(MakeTransactionRef(tx), i)); | ||||
} | } | ||||
LOCK2(cs_main, g_cs_orphans); | LOCK2(cs_main, g_cs_orphans); | ||||
// Test EraseOrphansFor: | // Test EraseOrphansFor: | ||||
for (NodeId i = 0; i < 3; i++) { | for (NodeId i = 0; i < 3; i++) { | ||||
size_t sizeBefore = mapOrphanTransactions.size(); | size_t sizeBefore = mapOrphanTransactions.size(); | ||||
Show All 14 Lines |