diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1765,9 +1765,9 @@ return recentRejects->contains(txid) || mempool.exists(txid); } -static bool AlreadyHaveBlock(const CInv &inv) +static bool AlreadyHaveBlock(const BlockHash &block_hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { - return LookupBlockIndex(BlockHash(inv.hash)) != nullptr; + return LookupBlockIndex(block_hash) != nullptr; } void RelayTransaction(const TxId &txid, const CConnman &connman) { @@ -3118,7 +3118,7 @@ } if (inv.type == MSG_BLOCK) { - bool fAlreadyHave = AlreadyHaveBlock(inv); + bool fAlreadyHave = AlreadyHaveBlock(BlockHash(inv.hash)); LogPrint(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom.GetId());