@ -247,6 +247,7 @@ public:
bool GetNodeStateStats ( NodeId nodeid , CNodeStateStats & stats ) override ;
bool IgnoresIncomingTxs ( ) override { return m_ignore_incoming_txs ; }
void SendPings ( ) override ;
void RelayTransaction ( const uint256 & txid , const uint256 & wtxid ) override ;
void SetBestHeight ( int height ) override { m_best_height = height ; } ;
void Misbehaving ( const NodeId pnode , const int howmuch , const std : : string & message ) override ;
void ProcessMessage ( CNode & pfrom , const std : : string & msg_type , CDataStream & vRecv ,
@ -260,7 +261,7 @@ private:
void EvictExtraOutboundPeers ( int64_t time_in_seconds ) EXCLUSIVE_LOCKS_REQUIRED ( cs_main ) ;
/** Retrieve unbroadcast transactions from the mempool and reattempt sending to peers */
void ReattemptInitialBroadcast ( CScheduler & scheduler ) const ;
void ReattemptInitialBroadcast ( CScheduler & scheduler ) ;
/** Get a shared pointer to the Peer object.
* May return an empty shared_ptr if the Peer object can ' t be found . */
@ -949,7 +950,7 @@ void PeerManagerImpl::InitializeNode(CNode *pnode)
}
}
void PeerManagerImpl : : ReattemptInitialBroadcast ( CScheduler & scheduler ) const
void PeerManagerImpl : : ReattemptInitialBroadcast ( CScheduler & scheduler )
{
std : : set < uint256 > unbroadcast_txids = m_mempool . GetUnbroadcastTxs ( ) ;
@ -958,7 +959,7 @@ void PeerManagerImpl::ReattemptInitialBroadcast(CScheduler& scheduler) const
if ( tx ! = nullptr ) {
LOCK ( cs_main ) ;
RelayTransaction ( txid , tx - > GetWitnessHash ( ) , m_connman );
RelayTransaction ( txid , tx - > GetWitnessHash ( ) );
} else {
m_mempool . RemoveUnbroadcastTx ( txid , true ) ;
}
@ -1460,9 +1461,9 @@ void PeerManagerImpl::SendPings()
for ( auto & it : m_peer_map ) it . second - > m_ping_queued = true ;
}
void RelayTransaction( const uint256 & txid , const uint256 & wtxid , const CConnman & connman )
void PeerManagerImpl: : RelayTransaction( const uint256 & txid , const uint256 & wtxid )
{
connman. ForEachNode ( [ & txid , & wtxid ] ( CNode * pnode ) EXCLUSIVE_LOCKS_REQUIRED ( : : cs_main ) {
m_ connman. ForEachNode ( [ & txid , & wtxid ] ( CNode * pnode ) EXCLUSIVE_LOCKS_REQUIRED ( : : cs_main ) {
AssertLockHeld ( : : cs_main ) ;
CNodeState * state = State ( pnode - > GetId ( ) ) ;
@ -2042,7 +2043,7 @@ void PeerManagerImpl::ProcessOrphanTx(std::set<uint256>& orphan_work_set)
if ( result . m_result_type = = MempoolAcceptResult : : ResultType : : VALID ) {
LogPrint ( BCLog : : MEMPOOL , " accepted orphan tx %s \n " , orphanHash . ToString ( ) ) ;
RelayTransaction ( orphanHash , porphanTx - > GetWitnessHash ( ) , m_connman );
RelayTransaction ( orphanHash , porphanTx - > GetWitnessHash ( ) );
m_orphanage . AddChildrenToWorkSet ( * porphanTx , orphan_work_set ) ;
m_orphanage . EraseTx ( orphanHash ) ;
for ( const CTransactionRef & removedTx : result . m_replaced_transactions . value ( ) ) {
@ -3046,7 +3047,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
LogPrintf ( " Not relaying non-mempool transaction %s from forcerelay peer=%d \n " , tx . GetHash ( ) . ToString ( ) , pfrom . GetId ( ) ) ;
} else {
LogPrintf ( " Force relaying tx %s from peer=%d \n " , tx . GetHash ( ) . ToString ( ) , pfrom . GetId ( ) ) ;
RelayTransaction ( tx . GetHash ( ) , tx . GetWitnessHash ( ) , m_connman );
RelayTransaction ( tx . GetHash ( ) , tx . GetWitnessHash ( ) );
}
}
return ;
@ -3061,7 +3062,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
// requests for it.
m_txrequest . ForgetTxHash ( tx . GetHash ( ) ) ;
m_txrequest . ForgetTxHash ( tx . GetWitnessHash ( ) ) ;
RelayTransaction ( tx . GetHash ( ) , tx . GetWitnessHash ( ) , m_connman );
RelayTransaction ( tx . GetHash ( ) , tx . GetWitnessHash ( ) );
m_orphanage . AddChildrenToWorkSet ( tx , peer - > m_orphan_work_set ) ;
pfrom . nLastTXTime = GetTime ( ) ;