-
Notifications
You must be signed in to change notification settings - Fork 3.8k
net_plugin more quickly determine known block #6735
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const comments are possible suggestions, but I feel more strongly about the assert unless you think it is an issue with backward compatibility
plugins/net_plugin/net_plugin.cpp
Outdated
|
||
char* header = reinterpret_cast<char*>(&payload_size); | ||
size_t header_size = sizeof(payload_size); | ||
char* header = reinterpret_cast<char*>(&payload_size); // avoid variable size encoding of uint32_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to be OCD like me you can make this "char* const " I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
plugins/net_plugin/net_plugin.cpp
Outdated
size_t header_size = sizeof(payload_size); | ||
char* header = reinterpret_cast<char*>(&payload_size); // avoid variable size encoding of uint32_t | ||
constexpr size_t header_size = sizeof(payload_size); | ||
static_assert( header_size == message_header_size, "invalid message_header_size" ); | ||
size_t buffer_size = header_size + payload_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
hard to handle the logic
Change Description
Consensus Changes
None
API Changes
None
Documentation Additions
None