MCPcopy Create free account
hub / github.com/Bitcoin-ABC/bitcoin-abc / ProcessValidTx

Method ProcessValidTx

src/net_processing.cpp:4329–4352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4327}
4328
4329void PeerManagerImpl::ProcessValidTx(NodeId nodeid, const CTransactionRef &tx) {
4330 AssertLockNotHeld(m_peer_mutex);
4331 AssertLockHeld(g_msgproc_mutex);
4332 AssertLockHeld(cs_main);
4333
4334 // As this version of the transaction was acceptable, we can forget about
4335 // any requests for it. No-op if the tx is not in txrequest.
4336 m_txrequest.ForgetInvId(tx->GetId());
4337
4338 m_mempool.withOrphanage([&tx](TxOrphanage &orphanage) {
4339 orphanage.AddChildrenToWorkSet(*tx);
4340 // If it came from the orphanage, remove it. No-op if the tx is not in
4341 // txorphanage.
4342 orphanage.EraseTx(tx->GetId());
4343 });
4344
4345 LogPrint(
4346 BCLog::MEMPOOL,
4347 "AcceptToMemoryPool: peer=%d: accepted %s (poolsz %u txn, %u kB)\n",
4348 nodeid, tx->GetId().ToString(), m_mempool.size(),
4349 m_mempool.DynamicMemoryUsage() / 1000);
4350
4351 RelayTransaction(tx->GetId());
4352}
4353
4354void PeerManagerImpl::ProcessPackageResult(
4355 const PackageToValidate &package_to_validate,

Callers

nothing calls this directly

Calls 7

AddChildrenToWorkSetMethod · 0.80
ForgetInvIdMethod · 0.45
GetIdMethod · 0.45
EraseTxMethod · 0.45
ToStringMethod · 0.45
sizeMethod · 0.45
DynamicMemoryUsageMethod · 0.45

Tested by

no test coverage detected