@@ -1998,7 +1998,7 @@ void static ProcessOrphanTx(CConnman* connman, CTxMemPool& mempool, std::set<uin
1998
1998
* @param[out] filter_index The filter index, if the request can be serviced.
1999
1999
* @return True if the request can be serviced.
2000
2000
*/
2001
- static bool PrepareBlockFilterRequest (CNode* pfrom, const CChainParams& chain_params,
2001
+ static bool PrepareBlockFilterRequest (CNode& pfrom, const CChainParams& chain_params,
2002
2002
BlockFilterType filter_type, uint32_t start_height,
2003
2003
const uint256& stop_hash, uint32_t max_height_diff,
2004
2004
const CBlockIndex*& stop_index,
@@ -2009,8 +2009,8 @@ static bool PrepareBlockFilterRequest(CNode* pfrom, const CChainParams& chain_pa
2009
2009
gArgs .GetBoolArg (" -peerblockfilters" , DEFAULT_PEERBLOCKFILTERS));
2010
2010
if (!supported_filter_type) {
2011
2011
LogPrint (BCLog::NET, " peer %d requested unsupported block filter type: %d\n " ,
2012
- pfrom-> GetId (), static_cast <uint8_t >(filter_type));
2013
- pfrom-> fDisconnect = true ;
2012
+ pfrom. GetId (), static_cast <uint8_t >(filter_type));
2013
+ pfrom. fDisconnect = true ;
2014
2014
return false ;
2015
2015
}
2016
2016
@@ -2021,8 +2021,8 @@ static bool PrepareBlockFilterRequest(CNode* pfrom, const CChainParams& chain_pa
2021
2021
// Check that the stop block exists and the peer would be allowed to fetch it.
2022
2022
if (!stop_index || !BlockRequestAllowed (stop_index, chain_params.GetConsensus ())) {
2023
2023
LogPrint (BCLog::NET, " peer %d requested invalid block hash: %s\n " ,
2024
- pfrom-> GetId (), stop_hash.ToString ());
2025
- pfrom-> fDisconnect = true ;
2024
+ pfrom. GetId (), stop_hash.ToString ());
2025
+ pfrom. fDisconnect = true ;
2026
2026
return false ;
2027
2027
}
2028
2028
}
@@ -2031,14 +2031,14 @@ static bool PrepareBlockFilterRequest(CNode* pfrom, const CChainParams& chain_pa
2031
2031
if (start_height > stop_height) {
2032
2032
LogPrint (BCLog::NET, " peer %d sent invalid getcfilters/getcfheaders with " /* Continued */
2033
2033
" start height %d and stop height %d\n " ,
2034
- pfrom-> GetId (), start_height, stop_height);
2035
- pfrom-> fDisconnect = true ;
2034
+ pfrom. GetId (), start_height, stop_height);
2035
+ pfrom. fDisconnect = true ;
2036
2036
return false ;
2037
2037
}
2038
2038
if (stop_height - start_height >= max_height_diff) {
2039
2039
LogPrint (BCLog::NET, " peer %d requested too many cfilters/cfheaders: %d / %d\n " ,
2040
- pfrom-> GetId (), stop_height - start_height + 1 , max_height_diff);
2041
- pfrom-> fDisconnect = true ;
2040
+ pfrom. GetId (), stop_height - start_height + 1 , max_height_diff);
2041
+ pfrom. fDisconnect = true ;
2042
2042
return false ;
2043
2043
}
2044
2044
@@ -2061,8 +2061,8 @@ static bool PrepareBlockFilterRequest(CNode* pfrom, const CChainParams& chain_pa
2061
2061
* @param[in] chain_params Chain parameters
2062
2062
* @param[in] connman Pointer to the connection manager
2063
2063
*/
2064
- static void ProcessGetCFHeaders (CNode* pfrom, CDataStream& vRecv, const CChainParams& chain_params,
2065
- CConnman* connman)
2064
+ static void ProcessGetCFHeaders (CNode& pfrom, CDataStream& vRecv, const CChainParams& chain_params,
2065
+ CConnman& connman)
2066
2066
{
2067
2067
uint8_t filter_type_ser;
2068
2068
uint32_t start_height;
@@ -2097,13 +2097,13 @@ static void ProcessGetCFHeaders(CNode* pfrom, CDataStream& vRecv, const CChainPa
2097
2097
return ;
2098
2098
}
2099
2099
2100
- CSerializedNetMsg msg = CNetMsgMaker (pfrom-> GetSendVersion ())
2100
+ CSerializedNetMsg msg = CNetMsgMaker (pfrom. GetSendVersion ())
2101
2101
.Make (NetMsgType::CFHEADERS,
2102
2102
filter_type_ser,
2103
2103
stop_index->GetBlockHash (),
2104
2104
prev_header,
2105
2105
filter_hashes);
2106
- connman-> PushMessage (pfrom, std::move (msg));
2106
+ connman. PushMessage (& pfrom, std::move (msg));
2107
2107
}
2108
2108
2109
2109
/* *
@@ -2116,8 +2116,8 @@ static void ProcessGetCFHeaders(CNode* pfrom, CDataStream& vRecv, const CChainPa
2116
2116
* @param[in] chain_params Chain parameters
2117
2117
* @param[in] connman Pointer to the connection manager
2118
2118
*/
2119
- static void ProcessGetCFCheckPt (CNode* pfrom, CDataStream& vRecv, const CChainParams& chain_params,
2120
- CConnman* connman)
2119
+ static void ProcessGetCFCheckPt (CNode& pfrom, CDataStream& vRecv, const CChainParams& chain_params,
2120
+ CConnman& connman)
2121
2121
{
2122
2122
uint8_t filter_type_ser;
2123
2123
uint256 stop_hash;
@@ -2149,12 +2149,12 @@ static void ProcessGetCFCheckPt(CNode* pfrom, CDataStream& vRecv, const CChainPa
2149
2149
}
2150
2150
}
2151
2151
2152
- CSerializedNetMsg msg = CNetMsgMaker (pfrom-> GetSendVersion ())
2152
+ CSerializedNetMsg msg = CNetMsgMaker (pfrom. GetSendVersion ())
2153
2153
.Make (NetMsgType::CFCHECKPT,
2154
2154
filter_type_ser,
2155
2155
stop_index->GetBlockHash (),
2156
2156
headers);
2157
- connman-> PushMessage (pfrom, std::move (msg));
2157
+ connman. PushMessage (& pfrom, std::move (msg));
2158
2158
}
2159
2159
2160
2160
bool ProcessMessage (CNode* pfrom, const std::string& msg_type, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams, ChainstateManager& chainman, CTxMemPool& mempool, CConnman* connman, BanMan* banman, const std::atomic<bool >& interruptMsgProc)
@@ -3467,12 +3467,12 @@ bool ProcessMessage(CNode* pfrom, const std::string& msg_type, CDataStream& vRec
3467
3467
}
3468
3468
3469
3469
if (msg_type == NetMsgType::GETCFHEADERS) {
3470
- ProcessGetCFHeaders (pfrom, vRecv, chainparams, connman);
3470
+ ProcessGetCFHeaders (* pfrom, vRecv, chainparams, * connman);
3471
3471
return true ;
3472
3472
}
3473
3473
3474
3474
if (msg_type == NetMsgType::GETCFCHECKPT) {
3475
- ProcessGetCFCheckPt (pfrom, vRecv, chainparams, connman);
3475
+ ProcessGetCFCheckPt (* pfrom, vRecv, chainparams, * connman);
3476
3476
return true ;
3477
3477
}
3478
3478
0 commit comments