Export MaxBlockHeaderPayload.

This commit is contained in:
Dave Collins 2014-03-11 20:22:32 -05:00
parent e5d15b0fa8
commit 0e1f6a6628
2 changed files with 2 additions and 2 deletions

View file

@ -15,7 +15,7 @@ const BlockVersion uint32 = 2
// Version 4 bytes + Timestamp 4 bytes + Bits 4 bytes + Nonce 4 bytes + // Version 4 bytes + Timestamp 4 bytes + Bits 4 bytes + Nonce 4 bytes +
// PrevBlock and MerkleRoot hashes. // PrevBlock and MerkleRoot hashes.
const maxBlockHeaderPayload = 16 + (HashSize * 2) const MaxBlockHeaderPayload = 16 + (HashSize * 2)
// BlockHeader defines information about a block and is used in the bitcoin // BlockHeader defines information about a block and is used in the bitcoin
// block (MsgBlock) and headers (MsgHeaders) messages. // block (MsgBlock) and headers (MsgHeaders) messages.

View file

@ -121,7 +121,7 @@ func (msg *MsgHeaders) Command() string {
func (msg *MsgHeaders) MaxPayloadLength(pver uint32) uint32 { func (msg *MsgHeaders) MaxPayloadLength(pver uint32) uint32 {
// Num headers (varInt) + max allowed headers (header length + 1 byte // Num headers (varInt) + max allowed headers (header length + 1 byte
// for the number of transactions which is always 0). // for the number of transactions which is always 0).
return MaxVarIntPayload + ((maxBlockHeaderPayload + 1) * return MaxVarIntPayload + ((MaxBlockHeaderPayload + 1) *
MaxBlockHeadersPerMsg) MaxBlockHeadersPerMsg)
} }