MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ProcessInvalidTx

Method ProcessInvalidTx

src/net_processing.cpp:3150–3175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3148}
3149
3150std::optional<node::PackageToValidate> PeerManagerImpl::ProcessInvalidTx(NodeId nodeid, const CTransactionRef& ptx, const TxValidationState& state,
3151 bool first_time_failure)
3152{
3153 AssertLockNotHeld(m_peer_mutex);
3154 AssertLockHeld(g_msgproc_mutex);
3155 AssertLockHeld(m_tx_download_mutex);
3156
3157 PeerRef peer{GetPeerRef(nodeid)};
3158
3159 LogDebug(BCLog::MEMPOOLREJ, "%s (wtxid=%s) from peer=%d was not accepted: %s\n",
3160 ptx->GetHash().ToString(),
3161 ptx->GetWitnessHash().ToString(),
3162 nodeid,
3163 state.ToString());
3164
3165 const auto& [add_extra_compact_tx, unique_parents, package_to_validate] = m_txdownloadman.MempoolRejectedTx(ptx, state, nodeid, first_time_failure);
3166
3167 if (add_extra_compact_tx && RecursiveDynamicUsage(*ptx) < 100000) {
3168 AddToCompactExtraTransactions(ptx);
3169 }
3170 for (const Txid& parent_txid : unique_parents) {
3171 if (peer) AddKnownTx(*peer, parent_txid.ToUint256());
3172 }
3173
3174 return package_to_validate;
3175}
3176
3177void PeerManagerImpl::ProcessValidTx(NodeId nodeid, const CTransactionRef& tx, const std::list<CTransactionRef>& replaced_transactions)
3178{

Callers

nothing calls this directly

Calls 5

RecursiveDynamicUsageFunction · 0.85
AddKnownTxFunction · 0.85
MempoolRejectedTxMethod · 0.80
ToStringMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected