diff --git a/src/protocol.h b/src/protocol.h --- a/src/protocol.h +++ b/src/protocol.h @@ -532,8 +532,20 @@ auto k = GetKind(); return k == MSG_TX; } + bool IsMsgBlk() const { + auto k = GetKind(); + return k == MSG_BLOCK; + } + bool IsMsgFilteredBlk() const { + auto k = GetKind(); + return k == MSG_FILTERED_BLOCK; + } + bool IsMsgCmpctBlk() const { + auto k = GetKind(); + return k == MSG_CMPCT_BLOCK; + } - bool IsSomeBlock() const { + bool IsGenBlkMsg() const { auto k = GetKind(); return k == MSG_BLOCK || k == MSG_FILTERED_BLOCK || k == MSG_CMPCT_BLOCK; 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 @@ -25,7 +25,7 @@ } catch (const std::out_of_range &) { } (void)inv->GetKind(); - (void)inv->IsSomeBlock(); + (void)inv->IsGenBlkMsg(); (void)inv->IsMsgTx(); (void)inv->ToString(); const std::optional another_inv = 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 @@ -12,7 +12,7 @@ CInv inv(type, uint256()); BOOST_CHECK_EQUAL(inv.GetKind(), expected); BOOST_CHECK_EQUAL(inv.IsMsgTx(), IsTx); - BOOST_CHECK_EQUAL(inv.IsSomeBlock(), IsBlock); + BOOST_CHECK_EQUAL(inv.IsGenBlkMsg(), IsBlock); } /* Validate various inv facilities. */