Branch: refs/heads/master
  Home:   https://github.com/conformal/btcwire
  Commit: c9178993037dcd44bc3c64ab6031bec0baa9bf8a
      
https://github.com/conformal/btcwire/commit/c9178993037dcd44bc3c64ab6031bec0baa9bf8a
  Author: Dave Collins <[email protected]>
  Date:   2014-03-30 (Sun, 30 Mar 2014)

  Changed paths:
    M msgversion.go
    M msgversion_test.go
    M test_coverage.txt

  Log Message:
  -----------
  Allow optional fields in MsgVersion decode.

This commit modifies the MsgVersion.BtcDecode function to match the
behavior where fields after the first address field (AddrYou) are optional
and only read if the buffer contains remaining bytes.

Unfortunately this means the reader for MsgVersion.BtcDecode must be a
*bytes.Buffer or an error is returned.  This is not an issue for the vast
majority of cases since all of the message reading code which is the main
way messages are read is already using a *bytes.Buffer, however, this
change might affect external callers if they are doing something special
with custom readers.

Fixes #14.


Reply via email to