mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge #9725: CValidationInterface Cleanups
b1a6d4cTake a CTransactionRef in AddToWalletIfInvolvingMe to avoid a copy (Matt Corallo)1c95e2fUse std::shared_ptr instead of boost::shared_ptr in ScriptForMining (Matt Corallo)91f1e6cRemove dead-code tracking of requests for blocks we generated (Matt Corallo)acad82fAdd override to functions using CValidationInterface methods (Matt Corallo)e6d5e6cHold cs_wallet for whole block [dis]connection processing (Matt Corallo)461e49fSyncTransaction->TxAddedToMempool/BlockConnected/Disconnected (Matt Corallo)f404334Handle SyncTransaction in ActivateBestChain instead of ConnectTrace (Matt Corallo)a147687Keep conflictedTxs in ConnectTrace per-block (Matt Corallo)d3167baHandle conflicted transactions directly in ConnectTrace (Matt Corallo)29e6e23Make ConnectTrace::blocksConnected private, hide behind accessors (Matt Corallo)822000cAdd pblock to connectTrace at the end of ConnectTip, not start (Matt Corallo)f5e9a01Include missing #include in zmqnotificationinterface.h (Matt Corallo) Tree-SHA512: 8893d47559da3b28d2ef7359768547cba8a4b43b6f891d80f5848f995a84b1517bfb0f706fdc8cd43f09a1350349eb440d9724a59363ab517dfcc4fcb31b2018
This commit is contained in:
@@ -744,21 +744,23 @@ PeerLogicValidation::PeerLogicValidation(CConnman* connmanIn) : connman(connmanI
|
||||
recentRejects.reset(new CRollingBloomFilter(120000, 0.000001));
|
||||
}
|
||||
|
||||
void PeerLogicValidation::SyncTransaction(const CTransaction& tx, const CBlockIndex* pindex, int nPosInBlock) {
|
||||
if (nPosInBlock == CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK)
|
||||
return;
|
||||
|
||||
void PeerLogicValidation::BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindex, const std::vector<CTransactionRef>& vtxConflicted) {
|
||||
LOCK(cs_main);
|
||||
|
||||
std::vector<uint256> vOrphanErase;
|
||||
// Which orphan pool entries must we evict?
|
||||
for (size_t j = 0; j < tx.vin.size(); j++) {
|
||||
auto itByPrev = mapOrphanTransactionsByPrev.find(tx.vin[j].prevout);
|
||||
if (itByPrev == mapOrphanTransactionsByPrev.end()) continue;
|
||||
for (auto mi = itByPrev->second.begin(); mi != itByPrev->second.end(); ++mi) {
|
||||
const CTransaction& orphanTx = *(*mi)->second.tx;
|
||||
const uint256& orphanHash = orphanTx.GetHash();
|
||||
vOrphanErase.push_back(orphanHash);
|
||||
|
||||
for (const CTransactionRef& ptx : pblock->vtx) {
|
||||
const CTransaction& tx = *ptx;
|
||||
|
||||
// Which orphan pool entries must we evict?
|
||||
for (size_t j = 0; j < tx.vin.size(); j++) {
|
||||
auto itByPrev = mapOrphanTransactionsByPrev.find(tx.vin[j].prevout);
|
||||
if (itByPrev == mapOrphanTransactionsByPrev.end()) continue;
|
||||
for (auto mi = itByPrev->second.begin(); mi != itByPrev->second.end(); ++mi) {
|
||||
const CTransaction& orphanTx = *(*mi)->second.tx;
|
||||
const uint256& orphanHash = orphanTx.GetHash();
|
||||
vOrphanErase.push_back(orphanHash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user