mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
[net processing] Introduce PeerManager options
This commit is contained in:
parent
d23fda0584
commit
8b87725921
8 changed files with 59 additions and 17 deletions
|
|
@ -487,7 +487,7 @@ class PeerManagerImpl final : public PeerManager
|
|||
public:
|
||||
PeerManagerImpl(CConnman& connman, AddrMan& addrman,
|
||||
BanMan* banman, ChainstateManager& chainman,
|
||||
CTxMemPool& pool, bool ignore_incoming_txs);
|
||||
CTxMemPool& pool, Options opts);
|
||||
|
||||
/** Overridden from CValidationInterface. */
|
||||
void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected) override
|
||||
|
|
@ -721,6 +721,8 @@ private:
|
|||
/** Whether this node is running in -blocksonly mode */
|
||||
const bool m_ignore_incoming_txs;
|
||||
|
||||
const Options m_opts;
|
||||
|
||||
bool RejectIncomingTxs(const CNode& peer) const;
|
||||
|
||||
/** Whether we've completed initial sync yet, for determining when to turn
|
||||
|
|
@ -1809,21 +1811,22 @@ std::optional<std::string> PeerManagerImpl::FetchBlock(NodeId peer_id, const CBl
|
|||
|
||||
std::unique_ptr<PeerManager> PeerManager::make(CConnman& connman, AddrMan& addrman,
|
||||
BanMan* banman, ChainstateManager& chainman,
|
||||
CTxMemPool& pool, bool ignore_incoming_txs)
|
||||
CTxMemPool& pool, Options opts)
|
||||
{
|
||||
return std::make_unique<PeerManagerImpl>(connman, addrman, banman, chainman, pool, ignore_incoming_txs);
|
||||
return std::make_unique<PeerManagerImpl>(connman, addrman, banman, chainman, pool, opts);
|
||||
}
|
||||
|
||||
PeerManagerImpl::PeerManagerImpl(CConnman& connman, AddrMan& addrman,
|
||||
BanMan* banman, ChainstateManager& chainman,
|
||||
CTxMemPool& pool, bool ignore_incoming_txs)
|
||||
CTxMemPool& pool, Options opts)
|
||||
: m_chainparams(chainman.GetParams()),
|
||||
m_connman(connman),
|
||||
m_addrman(addrman),
|
||||
m_banman(banman),
|
||||
m_chainman(chainman),
|
||||
m_mempool(pool),
|
||||
m_ignore_incoming_txs(ignore_incoming_txs)
|
||||
m_ignore_incoming_txs(opts.ignore_incoming_txs),
|
||||
m_opts{opts}
|
||||
{
|
||||
// While Erlay support is incomplete, it must be enabled explicitly via -txreconciliation.
|
||||
// This argument can go away after Erlay support is complete.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue