Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115069
D9501.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D9501.diff
View Options
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<CInv> 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. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 09:33 (1 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187220
Default Alt Text
D9501.diff (1 KB)
Attached To
D9501: p2p: add CInv block message helper methods
Event Timeline
Log In to Comment