forked from rust-bitcoin/rust-bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a hash value to Inventory's Error variant
While the hash value of the Error variant is meaningless, the variant still conforms to all other Inventory messages and requires a 32 byte hash to be sent over the wire. This is how bitcoin core operates. This patch adds the 32 byte array to the Error variant in order to make its Encoding and Decoding paths symmetrical. This also allows a reader to discard the 32 bytes when decoding a message. The hash is still not exposed to the caller. This was never a problem before because the top level RawNetworkPackage pulls all the required bytes off a reader before decoding. But this is not as easy to do with the v2 p2p network messages.
- Loading branch information
Showing
2 changed files
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters