diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2056,7 +2056,7 @@ // Process as many TX items from the front of the getdata queue as // possible, since they're common and it's efficient to batch process // them. - while (it != pfrom.vRecvGetData.end() && it->type == MSG_TX) { + while (it != pfrom.vRecvGetData.end() && it->IsMsgTx()) { if (interruptMsgProc) { return; } @@ -4445,7 +4445,7 @@ if (vInv.size() <= MAX_PEER_TX_IN_FLIGHT + MAX_BLOCKS_IN_TRANSIT_PER_PEER) { for (CInv &inv : vInv) { - if (inv.type == MSG_TX) { + if (inv.IsMsgTx()) { const TxId txid(inv.hash); // If we receive a NOTFOUND message for a txid we requested, // erase it from our data structures for this peer. diff --git a/src/protocol.h b/src/protocol.h --- a/src/protocol.h +++ b/src/protocol.h @@ -528,7 +528,7 @@ uint32_t GetKind() const { return type & MSG_TYPE_MASK; } - bool IsTx() const { + bool IsMsgTx() const { auto k = GetKind(); return k == MSG_TX; } diff --git a/src/test/fuzz/protocol.cpp b/src/test/fuzz/protocol.cpp --- a/src/test/fuzz/protocol.cpp +++ b/src/test/fuzz/protocol.cpp @@ -26,7 +26,7 @@ } (void)inv->GetKind(); (void)inv->IsSomeBlock(); - (void)inv->IsTx(); + (void)inv->IsMsgTx(); (void)inv->ToString(); const std::optional another_inv = ConsumeDeserializable(fuzzed_data_provider); diff --git a/src/test/inv_tests.cpp b/src/test/inv_tests.cpp --- a/src/test/inv_tests.cpp +++ b/src/test/inv_tests.cpp @@ -11,7 +11,7 @@ static void CheckType(int type, int expected, bool IsTx, bool IsBlock) { CInv inv(type, uint256()); BOOST_CHECK_EQUAL(inv.GetKind(), expected); - BOOST_CHECK_EQUAL(inv.IsTx(), IsTx); + BOOST_CHECK_EQUAL(inv.IsMsgTx(), IsTx); BOOST_CHECK_EQUAL(inv.IsSomeBlock(), IsBlock); }