Skip to content

Commit 5fdfb80

Browse files
jnewberyjonatack
authored andcommitted
[net processing] Change AlreadyHaveBlock() to take block_hash argument
1 parent 430e183 commit 5fdfb80

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,9 +1451,9 @@ bool static AlreadyHaveTx(const CInv& inv, const CTxMemPool& mempool) EXCLUSIVE_
14511451
return recentRejects->contains(inv.hash) || mempool.exists(ToGenTxid(inv));
14521452
}
14531453

1454-
bool static AlreadyHaveBlock(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
1454+
bool static AlreadyHaveBlock(const uint256& block_hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
14551455
{
1456-
return LookupBlockIndex(inv.hash) != nullptr;
1456+
return LookupBlockIndex(block_hash) != nullptr;
14571457
}
14581458

14591459
void RelayTransaction(const uint256& txid, const uint256& wtxid, const CConnman& connman)
@@ -2662,7 +2662,7 @@ void PeerLogicValidation::ProcessMessage(CNode& pfrom, const std::string& msg_ty
26622662
}
26632663

26642664
if (inv.type == MSG_BLOCK) {
2665-
bool fAlreadyHave = AlreadyHaveBlock(inv);
2665+
bool fAlreadyHave = AlreadyHaveBlock(inv.hash);
26662666
LogPrint(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom.GetId());
26672667

26682668
UpdateBlockAvailability(pfrom.GetId(), inv.hash);

0 commit comments

Comments
 (0)