refactor: Remove mempool global from net

This refactor does two things:
* Pass mempool in to PeerLogicValidation
* Pass m_mempool around where needed
This commit is contained in:
MarcoFalke
2020-01-24 14:00:57 -05:00
parent 309b0c4c19
commit fa7fea3654
6 changed files with 49 additions and 44 deletions

View File

@@ -6,10 +6,12 @@
#ifndef BITCOIN_NET_PROCESSING_H
#define BITCOIN_NET_PROCESSING_H
#include <net.h>
#include <validationinterface.h>
#include <consensus/params.h>
#include <net.h>
#include <sync.h>
#include <validationinterface.h>
class CTxMemPool;
extern RecursiveMutex cs_main;
@@ -23,11 +25,12 @@ class PeerLogicValidation final : public CValidationInterface, public NetEventsI
private:
CConnman* const connman;
BanMan* const m_banman;
CTxMemPool& m_mempool;
bool CheckIfBanned(CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
public:
PeerLogicValidation(CConnman* connman, BanMan* banman, CScheduler& scheduler);
PeerLogicValidation(CConnman* connman, BanMan* banman, CScheduler& scheduler, CTxMemPool& pool);
/**
* Overridden from CValidationInterface.