diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2154,7 +2154,7 @@ // rejected. bool fRejectedParents = false; for (const CTxIn &txin : tx.vin) { - if (recentRejects->contains(txin.prevout.hash)) { + if (recentRejects->contains(txin.prevout.GetTxId())) { fRejectedParents = true; break; } @@ -2163,7 +2163,7 @@ uint32_t nFetchFlags = GetFetchFlags( pfrom, chainActive.Tip(), chainparams.GetConsensus()); for (const CTxIn &txin : tx.vin) { - CInv _inv(MSG_TX | nFetchFlags, txin.prevout.hash); + CInv _inv(MSG_TX | nFetchFlags, txin.prevout.GetTxId()); pfrom->AddInventoryKnown(_inv); if (!AlreadyHave(_inv)) { pfrom->AskFor(_inv); diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -137,7 +137,9 @@ CTransactionRef RandomOrphan() { std::map::iterator it; it = mapOrphanTransactions.lower_bound(InsecureRand256()); - if (it == mapOrphanTransactions.end()) it = mapOrphanTransactions.begin(); + if (it == mapOrphanTransactions.end()) { + it = mapOrphanTransactions.begin(); + } return it->second.tx; } @@ -151,8 +153,7 @@ for (int i = 0; i < 50; i++) { CMutableTransaction tx; tx.vin.resize(1); - tx.vin[0].prevout.n = 0; - tx.vin[0].prevout.hash = InsecureRand256(); + tx.vin[0].prevout = COutPoint(InsecureRand256(), 0); tx.vin[0].scriptSig << OP_1; tx.vout.resize(1); tx.vout[0].nValue = 1 * CENT; @@ -168,8 +169,7 @@ CMutableTransaction tx; tx.vin.resize(1); - tx.vin[0].prevout.n = 0; - tx.vin[0].prevout.hash = txPrev->GetId(); + tx.vin[0].prevout = COutPoint(txPrev->GetId(), 0); tx.vout.resize(1); tx.vout[0].nValue = 1 * CENT; tx.vout[0].scriptPubKey = @@ -189,9 +189,8 @@ tx.vout[0].scriptPubKey = GetScriptForDestination(key.GetPubKey().GetID()); tx.vin.resize(2777); - for (unsigned int j = 0; j < tx.vin.size(); j++) { - tx.vin[j].prevout.n = j; - tx.vin[j].prevout.hash = txPrev->GetId(); + for (size_t j = 0; j < tx.vin.size(); j++) { + tx.vin[j].prevout = COutPoint(txPrev->GetId(), j); } SignSignature(keystore, *txPrev, tx, 0, SigHashType()); // Re-use same signature for other inputs