@@ -3016,7 +3016,7 @@ static void NotifyHeaderTip() {
30163016 * or an activated best chain. pblock is either NULL or a pointer to a block
30173017 * that is already loaded (to avoid loading it again from disk).
30183018 */
3019- bool ActivateBestChain (CValidationState &state, const CChainParams& chainparams, const CBlock *pblock) {
3019+ bool ActivateBestChain (CValidationState &state, const CChainParams& chainparams, const CBlock *pblock, CConnman* connman ) {
30203020 CBlockIndex *pindexMostWork = NULL ;
30213021 CBlockIndex *pindexNewTip = NULL ;
30223022 do {
@@ -3731,7 +3731,7 @@ static bool AcceptBlock(const CBlock& block, CValidationState& state, const CCha
37313731 return true ;
37323732}
37333733
3734- bool ProcessNewBlock (CValidationState& state, const CChainParams& chainparams, CNode* pfrom, const CBlock* pblock, bool fForceProcessing , const CDiskBlockPos* dbp)
3734+ bool ProcessNewBlock (CValidationState& state, const CChainParams& chainparams, CNode* pfrom, const CBlock* pblock, bool fForceProcessing , const CDiskBlockPos* dbp, CConnman* connman )
37353735{
37363736 {
37373737 LOCK (cs_main);
@@ -3753,7 +3753,7 @@ bool ProcessNewBlock(CValidationState& state, const CChainParams& chainparams, C
37533753
37543754 NotifyHeaderTip ();
37553755
3756- if (!ActivateBestChain (state, chainparams, pblock))
3756+ if (!ActivateBestChain (state, chainparams, pblock, connman ))
37573757 return error (" %s: ActivateBestChain failed" , __func__);
37583758
37593759 return true ;
@@ -4891,7 +4891,7 @@ uint32_t GetFetchFlags(CNode* pfrom, CBlockIndex* pprev, const Consensus::Params
48914891 return nFetchFlags;
48924892}
48934893
4894- bool static ProcessMessage (CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams)
4894+ bool static ProcessMessage (CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams, CConnman& connman )
48954895{
48964896 LogPrint (" net" , " received: %s (%u bytes) peer=%d\n " , SanitizeString (strCommand), vRecv.size (), pfrom->id );
48974897 if (mapArgs.count (" -dropmessagestest" ) && GetRand (atoi (mapArgs[" -dropmessagestest" ])) == 0 )
@@ -5680,7 +5680,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
56805680 txn.blockhash = cmpctblock.header .GetHash ();
56815681 CDataStream blockTxnMsg (SER_NETWORK, PROTOCOL_VERSION);
56825682 blockTxnMsg << txn;
5683- return ProcessMessage (pfrom, NetMsgType::BLOCKTXN, blockTxnMsg, nTimeReceived, chainparams);
5683+ return ProcessMessage (pfrom, NetMsgType::BLOCKTXN, blockTxnMsg, nTimeReceived, chainparams, connman );
56845684 } else {
56855685 req.blockhash = pindex->GetBlockHash ();
56865686 pfrom->PushMessage (NetMsgType::GETBLOCKTXN, req);
@@ -5701,7 +5701,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
57015701 headers.push_back (cmpctblock.header );
57025702 CDataStream vHeadersMsg (SER_NETWORK, PROTOCOL_VERSION);
57035703 vHeadersMsg << headers;
5704- return ProcessMessage (pfrom, NetMsgType::HEADERS, vHeadersMsg, nTimeReceived, chainparams);
5704+ return ProcessMessage (pfrom, NetMsgType::HEADERS, vHeadersMsg, nTimeReceived, chainparams, connman );
57055705 }
57065706 }
57075707
@@ -5737,7 +5737,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
57375737 pfrom->PushMessage (NetMsgType::GETDATA, invs);
57385738 } else {
57395739 CValidationState state;
5740- ProcessNewBlock (state, chainparams, pfrom, &block, false , NULL );
5740+ ProcessNewBlock (state, chainparams, pfrom, &block, false , NULL , &connman );
57415741 int nDoS;
57425742 if (state.IsInvalid (nDoS)) {
57435743 assert (state.GetRejectCode () < REJECT_INTERNAL); // Blocks are never rejected with internal reject codes
@@ -5913,7 +5913,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
59135913 // Such an unrequested block may still be processed, subject to the
59145914 // conditions in AcceptBlock().
59155915 bool forceProcessing = pfrom->fWhitelisted && !IsInitialBlockDownload ();
5916- ProcessNewBlock (state, chainparams, pfrom, &block, forceProcessing, NULL );
5916+ ProcessNewBlock (state, chainparams, pfrom, &block, forceProcessing, NULL , &connman );
59175917 int nDoS;
59185918 if (state.IsInvalid (nDoS)) {
59195919 assert (state.GetRejectCode () < REJECT_INTERNAL); // Blocks are never rejected with internal reject codes
@@ -6163,7 +6163,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
61636163}
61646164
61656165// requires LOCK(cs_vRecvMsg)
6166- bool ProcessMessages (CNode* pfrom)
6166+ bool ProcessMessages (CNode* pfrom, CConnman& connman )
61676167{
61686168 const CChainParams& chainparams = Params ();
61696169 // if (fDebug)
@@ -6240,7 +6240,7 @@ bool ProcessMessages(CNode* pfrom)
62406240 bool fRet = false ;
62416241 try
62426242 {
6243- fRet = ProcessMessage (pfrom, strCommand, vRecv, msg.nTime , chainparams);
6243+ fRet = ProcessMessage (pfrom, strCommand, vRecv, msg.nTime , chainparams, connman );
62446244 boost::this_thread::interruption_point ();
62456245 }
62466246 catch (const std::ios_base::failure& e)
@@ -6305,7 +6305,7 @@ class CompareInvMempoolOrder
63056305 }
63066306};
63076307
6308- bool SendMessages (CNode* pto)
6308+ bool SendMessages (CNode* pto, CConnman& connman )
63096309{
63106310 const Consensus::Params& consensusParams = Params ().GetConsensus ();
63116311 {
0 commit comments