aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-07-30 11:02:40 +0100
committerJon Atack <jon@atack.com>2020-08-26 11:57:11 +0200
commit5fdfb80b861e0de3fcf8a57163b3f52af4b2df3b (patch)
tree18e745f0cb24e4dd6762877097033989c03d7e94 /src/net_processing.cpp
parent430e183b89d00b4148f0b77a6fcacca2cd948202 (diff)
downloadbitcoin-5fdfb80b861e0de3fcf8a57163b3f52af4b2df3b.tar.xz
[net processing] Change AlreadyHaveBlock() to take block_hash argument
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 3fb8907b5e..82d41d737e 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1451,9 +1451,9 @@ bool static AlreadyHaveTx(const CInv& inv, const CTxMemPool& mempool) EXCLUSIVE_
return recentRejects->contains(inv.hash) || mempool.exists(ToGenTxid(inv));
}
-bool static AlreadyHaveBlock(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
+bool static AlreadyHaveBlock(const uint256& block_hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
{
- return LookupBlockIndex(inv.hash) != nullptr;
+ return LookupBlockIndex(block_hash) != nullptr;
}
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
}
if (inv.type == MSG_BLOCK) {
- bool fAlreadyHave = AlreadyHaveBlock(inv);
+ bool fAlreadyHave = AlreadyHaveBlock(inv.hash);
LogPrint(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom.GetId());
UpdateBlockAvailability(pfrom.GetId(), inv.hash);