trivial: add Asserts for m_peerman pointer container uses

This commit is contained in:
Kittywhiskers Van Gogh 2024-04-09 19:42:55 +00:00
parent 35be4e2ebe
commit f2fe39fadc
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD
6 changed files with 10 additions and 10 deletions

View File

@ -349,7 +349,7 @@ void CCoinJoinServer::CommitFinalTransaction()
LogPrint(BCLog::COINJOIN, "CCoinJoinServer::CommitFinalTransaction -- TRANSMITTING DSTX\n");
CInv inv(MSG_DSTX, hashTx);
m_peerman->RelayInv(inv);
Assert(m_peerman)->RelayInv(inv);
// Tell the clients it was successful
RelayCompletedTransaction(MSG_SUCCESS);
@ -460,7 +460,7 @@ void CCoinJoinServer::ConsumeCollateral(const CTransactionRef& txref) const
if (!ATMPIfSaneFee(m_chainstate, mempool, txref, false /* bypass_limits */)) {
LogPrint(BCLog::COINJOIN, "%s -- AcceptToMemoryPool failed\n", __func__);
} else {
m_peerman->RelayTransaction(txref->GetHash());
Assert(m_peerman)->RelayTransaction(txref->GetHash());
LogPrint(BCLog::COINJOIN, "%s -- Collateral was consumed\n", __func__);
}
}

View File

@ -668,7 +668,7 @@ void CQuorumBlockProcessor::AddMineableCommitment(const CFinalCommitment& fqc)
// We only relay the new commitment if it's new or better then the old one
if (relay) {
CInv inv(MSG_QUORUM_FINAL_COMMITMENT, commitmentHash);
m_peerman->RelayInv(inv);
Assert(m_peerman)->RelayInv(inv);
}
}

View File

@ -162,7 +162,7 @@ PeerMsgRet CChainLocksHandler::ProcessNewChainLock(const NodeId from, const llmq
// Note: do not hold cs while calling RelayInv
AssertLockNotHeld(cs);
m_peerman->RelayInv(clsigInv);
Assert(m_peerman)->RelayInv(clsigInv);
if (pindex == nullptr) {
// we don't know the block/header for this CLSIG yet, so bail out for now

View File

@ -140,7 +140,7 @@ void CEHFSignalsHandler::HandleNewRecoveredSig(const CRecoveredSig& recoveredSig
LOCK(cs_main);
const MempoolAcceptResult result = AcceptToMemoryPool(chainstate, mempool, tx_to_sent, /* bypass_limits */ false);
if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
m_peerman->RelayTransaction(tx_to_sent->GetHash());
Assert(m_peerman)->RelayTransaction(tx_to_sent->GetHash());
} else {
LogPrintf("CEHFSignalsHandler::HandleNewRecoveredSig -- AcceptToMemoryPool failed: %s\n", result.m_state.ToString());
}

View File

@ -951,7 +951,7 @@ std::unordered_set<uint256, StaticSaltedHasher> CInstantSendManager::ProcessPend
for (const auto& nodeId : batchVerifier.badSources) {
// Let's not be too harsh, as the peer might simply be unlucky and might have sent us an old lock which
// does not validate anymore due to changed quorums
m_peerman->Misbehaving(nodeId, 20);
Assert(m_peerman)->Misbehaving(nodeId, 20);
}
}
for (const auto& p : pend) {
@ -1045,11 +1045,11 @@ void CInstantSendManager::ProcessInstantSendLock(NodeId from, const uint256& has
CInv inv(MSG_ISDLOCK, hash);
if (tx != nullptr) {
m_peerman->RelayInvFiltered(inv, *tx, ISDLOCK_PROTO_VERSION);
Assert(m_peerman)->RelayInvFiltered(inv, *tx, ISDLOCK_PROTO_VERSION);
} else {
// we don't have the TX yet, so we only filter based on txid. Later when that TX arrives, we will re-announce
// with the TX taken into account.
m_peerman->RelayInvFiltered(inv, islock->txid, ISDLOCK_PROTO_VERSION);
Assert(m_peerman)->RelayInvFiltered(inv, islock->txid, ISDLOCK_PROTO_VERSION);
}
ResolveBlockConflicts(hash, *islock);

View File

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