diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 3a712f2f800..7ab70cd63a3 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -644,7 +644,7 @@ private: EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, !m_headers_presync_mutex, g_msgproc_mutex); /** Various helpers for headers processing, invoked by ProcessHeadersMessage() */ /** Return true if headers are continuous and have valid proof-of-work (DoS points assigned on failure) */ - bool CheckHeadersPoW(const std::vector& headers, const Consensus::Params& consensusParams, Peer& peer); + bool CheckHeadersPoW(const std::vector& headers, Peer& peer); /** Calculate an anti-DoS work threshold for headers chains */ arith_uint256 GetAntiDoSWorkThreshold(); /** Deal with state tracking and headers sync for peers that send @@ -2485,10 +2485,10 @@ void PeerManagerImpl::SendBlockTransactions(CNode& pfrom, Peer& peer, const CBlo MakeAndPushMessage(pfrom, NetMsgType::BLOCKTXN, resp); } -bool PeerManagerImpl::CheckHeadersPoW(const std::vector& headers, const Consensus::Params& consensusParams, Peer& peer) +bool PeerManagerImpl::CheckHeadersPoW(const std::vector& headers, Peer& peer) { // Do these headers have proof-of-work matching what's claimed? - if (!HasValidProofOfWork(headers, consensusParams)) { + if (!HasValidProofOfWork(headers, m_chainparams.GetConsensus())) { Misbehaving(peer, "header with invalid proof of work"); return false; } @@ -2853,7 +2853,7 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, Peer& peer, // We'll rely on headers having valid proof-of-work further down, as an // anti-DoS criteria (note: this check is required before passing any // headers into HeadersSyncState). - if (!CheckHeadersPoW(headers, m_chainparams.GetConsensus(), peer)) { + if (!CheckHeadersPoW(headers, peer)) { // Misbehaving() calls are handled within CheckHeadersPoW(), so we can // just return. (Note that even if a header is announced via compact // block, the header itself should be valid, so this type of error can