Skip to content

Commit

Permalink
evo: use gsl::not_null in CTxMemPool::ConnectManagers
Browse files Browse the repository at this point in the history
  • Loading branch information
kwvg committed May 28, 2024
1 parent 805537e commit 1d3afe7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/txmempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,11 @@ CTxMemPool::CTxMemPool(CBlockPolicyEstimator* estimator, int check_ratio)
_clear(); //lock free clear
}

void CTxMemPool::ConnectManagers(CDeterministicMNManager* dmnman)
void CTxMemPool::ConnectManagers(gsl::not_null<CDeterministicMNManager*> dmnman)
{
// Do not allow double-initialization
assert(m_dmnman == nullptr);
m_dmnman = Assert(dmnman);
m_dmnman = dmnman;
}

bool CTxMemPool::isSpent(const COutPoint& outpoint) const
Expand Down
3 changes: 2 additions & 1 deletion src/txmempool.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <spentindex.h>
#include <amount.h>
#include <coins.h>
#include <gsl/pointers.h>
#include <indirectmap.h>
#include <policy/feerate.h>
#include <primitives/transaction.h>
Expand Down Expand Up @@ -607,7 +608,7 @@ class CTxMemPool
* Separated from constructor as it's initialized after CTxMemPool
* is created. Required for ProTx processing.
*/
void ConnectManagers(CDeterministicMNManager* dmnman);
void ConnectManagers(gsl::not_null<CDeterministicMNManager*> dmnman);

/**
* Reset CDeterministicMNManager pointer.
Expand Down

0 comments on commit 1d3afe7

Please sign in to comment.