Inspired by theStack’s in Per-Peer Message Capture here. More context here and relevant BIPs are BIP37 and BIP60 (draft).
There is a discrepancy in the implementation of our p2p protocol between bitcoind and the testing framework. The fRelay field is an optional field at the end of a version message as of protocol version 70001. However, when deserializing a message in bitcoind, we don’t check the version to see if it can have an fRelay field or not. Instead we unconditionally attempt to deserialize into the field.
This commit brings the testing framework in line with the implementation in core.
This matters for a version message with the following fields:
Version = 60000 fRelay = 1
Bitcoind would deserialize this into a version message with Version=60000 and fRelay=1, whereas (before this PR) our testing framework would deserialize this into a version message with Version=60000 and fRelay=0.
Concept ACK needed. Alternative: Change behavior in core? Got a few 😄