payload: extensible payload hashes are network-dependent

Of course they are. Fixes

2021-02-04T13:39:02.351Z        WARN    peer disconnected       {"addr": "172.29.0.4:20333", "reason": "handling CMDExtensible message: signature check failed: invalid signature", "peerCount": 3}
2021-02-04T13:39:02.352Z        WARN    peer disconnected       {"addr": "172.29.0.3:20334", "reason": "handling CMDExtensible message: signature check failed: invalid signature", "peerCount": 2}

in 2+2 setting.
This commit is contained in:
Roman Khimov 2021-02-04 16:47:49 +03:00
parent d14ab4ba69
commit 6fd5f4e86d

View file

@ -121,6 +121,7 @@ func (e *Extensible) updateHashes(b []byte) {
// updateSignedPart updates serialized message if needed.
func (e *Extensible) updateSignedPart() {
w := io.NewBufBinWriter()
w.WriteU32LE(uint32(e.Network))
e.encodeBinaryUnsigned(w.BinWriter)
e.signedpart = w.Bytes()
}