|
|
@ -11,6 +11,7 @@
|
|
|
|
#include <sync.h>
|
|
|
|
#include <sync.h>
|
|
|
|
#include <validationinterface.h>
|
|
|
|
#include <validationinterface.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BlockValidationState;
|
|
|
|
class CBlockHeader;
|
|
|
|
class CBlockHeader;
|
|
|
|
class CChainParams;
|
|
|
|
class CChainParams;
|
|
|
|
class CTxMemPool;
|
|
|
|
class CTxMemPool;
|
|
|
@ -84,6 +85,19 @@ public:
|
|
|
|
const std::chrono::microseconds time_received, const std::atomic<bool>& interruptMsgProc);
|
|
|
|
const std::chrono::microseconds time_received, const std::atomic<bool>& interruptMsgProc);
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Potentially mark a node discouraged based on the contents of a BlockValidationState object
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param[in] via_compact_block this bool is passed in because net_processing should
|
|
|
|
|
|
|
|
* punish peers differently depending on whether the data was provided in a compact
|
|
|
|
|
|
|
|
* block message or not. If the compact block had a valid header, but contained invalid
|
|
|
|
|
|
|
|
* txs, the peer should not be punished. See BIP 152.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return Returns true if the peer was punished (probably disconnected)
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool MaybePunishNodeForBlock(NodeId nodeid, const BlockValidationState& state,
|
|
|
|
|
|
|
|
bool via_compact_block, const std::string& message = "");
|
|
|
|
|
|
|
|
|
|
|
|
/** Maybe disconnect a peer and discourage future connections from its address.
|
|
|
|
/** Maybe disconnect a peer and discourage future connections from its address.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param[in] pnode The node to check.
|
|
|
|
* @param[in] pnode The node to check.
|
|
|
|