Skip to content

Commit f2fe39f

Browse files
committed
trivial: add Asserts for m_peerman pointer container uses
1 parent 35be4e2 commit f2fe39f

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/coinjoin/server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ void CCoinJoinServer::CommitFinalTransaction()
349349
LogPrint(BCLog::COINJOIN, "CCoinJoinServer::CommitFinalTransaction -- TRANSMITTING DSTX\n");
350350

351351
CInv inv(MSG_DSTX, hashTx);
352-
m_peerman->RelayInv(inv);
352+
Assert(m_peerman)->RelayInv(inv);
353353

354354
// Tell the clients it was successful
355355
RelayCompletedTransaction(MSG_SUCCESS);
@@ -460,7 +460,7 @@ void CCoinJoinServer::ConsumeCollateral(const CTransactionRef& txref) const
460460
if (!ATMPIfSaneFee(m_chainstate, mempool, txref, false /* bypass_limits */)) {
461461
LogPrint(BCLog::COINJOIN, "%s -- AcceptToMemoryPool failed\n", __func__);
462462
} else {
463-
m_peerman->RelayTransaction(txref->GetHash());
463+
Assert(m_peerman)->RelayTransaction(txref->GetHash());
464464
LogPrint(BCLog::COINJOIN, "%s -- Collateral was consumed\n", __func__);
465465
}
466466
}

src/llmq/blockprocessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ void CQuorumBlockProcessor::AddMineableCommitment(const CFinalCommitment& fqc)
668668
// We only relay the new commitment if it's new or better then the old one
669669
if (relay) {
670670
CInv inv(MSG_QUORUM_FINAL_COMMITMENT, commitmentHash);
671-
m_peerman->RelayInv(inv);
671+
Assert(m_peerman)->RelayInv(inv);
672672
}
673673
}
674674

src/llmq/chainlocks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ PeerMsgRet CChainLocksHandler::ProcessNewChainLock(const NodeId from, const llmq
162162

163163
// Note: do not hold cs while calling RelayInv
164164
AssertLockNotHeld(cs);
165-
m_peerman->RelayInv(clsigInv);
165+
Assert(m_peerman)->RelayInv(clsigInv);
166166

167167
if (pindex == nullptr) {
168168
// we don't know the block/header for this CLSIG yet, so bail out for now

src/llmq/ehf_signals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void CEHFSignalsHandler::HandleNewRecoveredSig(const CRecoveredSig& recoveredSig
140140
LOCK(cs_main);
141141
const MempoolAcceptResult result = AcceptToMemoryPool(chainstate, mempool, tx_to_sent, /* bypass_limits */ false);
142142
if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
143-
m_peerman->RelayTransaction(tx_to_sent->GetHash());
143+
Assert(m_peerman)->RelayTransaction(tx_to_sent->GetHash());
144144
} else {
145145
LogPrintf("CEHFSignalsHandler::HandleNewRecoveredSig -- AcceptToMemoryPool failed: %s\n", result.m_state.ToString());
146146
}

src/llmq/instantsend.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ std::unordered_set<uint256, StaticSaltedHasher> CInstantSendManager::ProcessPend
951951
for (const auto& nodeId : batchVerifier.badSources) {
952952
// Let's not be too harsh, as the peer might simply be unlucky and might have sent us an old lock which
953953
// does not validate anymore due to changed quorums
954-
m_peerman->Misbehaving(nodeId, 20);
954+
Assert(m_peerman)->Misbehaving(nodeId, 20);
955955
}
956956
}
957957
for (const auto& p : pend) {
@@ -1045,11 +1045,11 @@ void CInstantSendManager::ProcessInstantSendLock(NodeId from, const uint256& has
10451045

10461046
CInv inv(MSG_ISDLOCK, hash);
10471047
if (tx != nullptr) {
1048-
m_peerman->RelayInvFiltered(inv, *tx, ISDLOCK_PROTO_VERSION);
1048+
Assert(m_peerman)->RelayInvFiltered(inv, *tx, ISDLOCK_PROTO_VERSION);
10491049
} else {
10501050
// we don't have the TX yet, so we only filter based on txid. Later when that TX arrives, we will re-announce
10511051
// with the TX taken into account.
1052-
m_peerman->RelayInvFiltered(inv, islock->txid, ISDLOCK_PROTO_VERSION);
1052+
Assert(m_peerman)->RelayInvFiltered(inv, islock->txid, ISDLOCK_PROTO_VERSION);
10531053
}
10541054

10551055
ResolveBlockConflicts(hash, *islock);

src/llmq/signing_shares.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ void CSigSharesManager::RemoveBannedNodeStates()
13941394

13951395
LOCK(cs);
13961396
for (auto it = nodeStates.begin(); it != nodeStates.end();) {
1397-
if (m_peerman->IsBanned(it->first)) {
1397+
if (Assert(m_peerman)->IsBanned(it->first)) {
13981398
// re-request sigshares from other nodes
13991399
it->second.requestedSigShares.ForEach([this](const SigShareKey& k, int64_t) {
14001400
AssertLockHeld(cs);
@@ -1414,7 +1414,7 @@ void CSigSharesManager::BanNode(NodeId nodeId)
14141414
}
14151415

14161416
{
1417-
m_peerman->Misbehaving(nodeId, 100);
1417+
Assert(m_peerman)->Misbehaving(nodeId, 100);
14181418
}
14191419

14201420
LOCK(cs);

0 commit comments

Comments
 (0)