diff --git a/blockheader.go b/blockheader.go index e2e93228..b8456a42 100644 --- a/blockheader.go +++ b/blockheader.go @@ -14,7 +14,7 @@ import ( const BlockVersion uint32 = 2 // Version 4 bytes + Timestamp 4 bytes + Bits 4 bytes + Nonce 4 bytes + -// TxnCount (varInt) + PrevBlock and MarkleRoot hashes. +// TxnCount (varInt) + PrevBlock and MerkleRoot hashes. const maxBlockHeaderPayload = 16 + maxVarIntPayload + (HashSize * 2) // BlockHeader defines information about a block and is used in the bitcoin diff --git a/common_test.go b/common_test.go index ab6e64de..40556b4d 100644 --- a/common_test.go +++ b/common_test.go @@ -22,7 +22,7 @@ type fakeRandReader struct { } // Read returns the fake reader error and the lesser of the fake reader value -// and the length p. +// and the length of p. func (r *fakeRandReader) Read(p []byte) (int, error) { n := r.n if n > len(p) { diff --git a/msgblock.go b/msgblock.go index cdf15eb2..c01929ab 100644 --- a/msgblock.go +++ b/msgblock.go @@ -104,7 +104,6 @@ func (msg *MsgBlock) BtcDecodeTxLoc(r *bytes.Buffer, pver uint32) ([]TxLoc, erro // BtcEncode encodes the receiver to w using the bitcoin protocol encoding. // This is part of the Message interface implementation. func (msg *MsgBlock) BtcEncode(w io.Writer, pver uint32) error { - // XXX: Max transactions? msg.Header.TxnCount = uint64(len(msg.Transactions)) err := writeBlockHeader(w, pver, &msg.Header)