Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 3,076 Lines • ▼ Show 20 Lines | while (!orphan_work_set.empty()) { | ||||
const TxId orphanTxId = *orphan_work_set.begin(); | const TxId orphanTxId = *orphan_work_set.begin(); | ||||
orphan_work_set.erase(orphan_work_set.begin()); | orphan_work_set.erase(orphan_work_set.begin()); | ||||
const auto [porphanTx, from_peer] = m_orphanage.GetTx(orphanTxId); | const auto [porphanTx, from_peer] = m_orphanage.GetTx(orphanTxId); | ||||
if (porphanTx == nullptr) { | if (porphanTx == nullptr) { | ||||
continue; | continue; | ||||
} | } | ||||
TxValidationState state; | const MempoolAcceptResult result = | ||||
if (AcceptToMemoryPool(m_chainman.ActiveChainstate(), config, m_mempool, | AcceptToMemoryPool(m_chainman.ActiveChainstate(), config, m_mempool, | ||||
state, porphanTx, false /* bypass_limits */)) { | porphanTx, false /* bypass_limits */); | ||||
const TxValidationState &state = result.m_state; | |||||
if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) { | |||||
LogPrint(BCLog::MEMPOOL, " accepted orphan tx %s\n", | LogPrint(BCLog::MEMPOOL, " accepted orphan tx %s\n", | ||||
orphanTxId.ToString()); | orphanTxId.ToString()); | ||||
RelayTransaction(orphanTxId, m_connman); | RelayTransaction(orphanTxId, m_connman); | ||||
m_orphanage.AddChildrenToWorkSet(*porphanTx, orphan_work_set); | m_orphanage.AddChildrenToWorkSet(*porphanTx, orphan_work_set); | ||||
m_orphanage.EraseTx(orphanTxId); | m_orphanage.EraseTx(orphanTxId); | ||||
break; | break; | ||||
} else if (state.GetResult() != TxValidationResult::TX_MISSING_INPUTS) { | } else if (state.GetResult() != TxValidationResult::TX_MISSING_INPUTS) { | ||||
if (state.IsInvalid()) { | if (state.IsInvalid()) { | ||||
▲ Show 20 Lines • Show All 1,221 Lines • ▼ Show 20 Lines | if (msg_type == NetMsgType::TX) { | ||||
LogPrintf("Force relaying tx %s from peer=%d\n", | LogPrintf("Force relaying tx %s from peer=%d\n", | ||||
tx.GetId().ToString(), pfrom.GetId()); | tx.GetId().ToString(), pfrom.GetId()); | ||||
RelayTransaction(tx.GetId(), m_connman); | RelayTransaction(tx.GetId(), m_connman); | ||||
} | } | ||||
} | } | ||||
return; | return; | ||||
} | } | ||||
TxValidationState state; | const MempoolAcceptResult result = | ||||
AcceptToMemoryPool(m_chainman.ActiveChainstate(), config, m_mempool, | |||||
if (AcceptToMemoryPool(m_chainman.ActiveChainstate(), config, m_mempool, | ptx, false /* bypass_limits */); | ||||
state, ptx, false /* bypass_limits */)) { | const TxValidationState &state = result.m_state; | ||||
if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) { | |||||
m_mempool.check(m_chainman.ActiveChainstate()); | m_mempool.check(m_chainman.ActiveChainstate()); | ||||
// As this version of the transaction was acceptable, we can forget | // As this version of the transaction was acceptable, we can forget | ||||
// about any requests for it. | // about any requests for it. | ||||
m_txrequest.ForgetInvId(tx.GetId()); | m_txrequest.ForgetInvId(tx.GetId()); | ||||
RelayTransaction(tx.GetId(), m_connman); | RelayTransaction(tx.GetId(), m_connman); | ||||
m_orphanage.AddChildrenToWorkSet(tx, peer->m_orphan_work_set); | m_orphanage.AddChildrenToWorkSet(tx, peer->m_orphan_work_set); | ||||
pfrom.m_last_tx_time = GetTime<std::chrono::seconds>(); | pfrom.m_last_tx_time = GetTime<std::chrono::seconds>(); | ||||
▲ Show 20 Lines • Show All 2,790 Lines • Show Last 20 Lines |