diff --git a/blockheader.go b/blockheader.go index d04d83b3..d9ed680a 100644 --- a/blockheader.go +++ b/blockheader.go @@ -15,7 +15,7 @@ const BlockVersion uint32 = 2 // Version 4 bytes + Timestamp 4 bytes + Bits 4 bytes + Nonce 4 bytes + // 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 // block (MsgBlock) and headers (MsgHeaders) messages. diff --git a/msgheaders.go b/msgheaders.go index fdb3d5d4..b4a44426 100644 --- a/msgheaders.go +++ b/msgheaders.go @@ -121,7 +121,7 @@ func (msg *MsgHeaders) Command() string { func (msg *MsgHeaders) MaxPayloadLength(pver uint32) uint32 { // Num headers (varInt) + max allowed headers (header length + 1 byte // for the number of transactions which is always 0). - return MaxVarIntPayload + ((maxBlockHeaderPayload + 1) * + return MaxVarIntPayload + ((MaxBlockHeaderPayload + 1) * MaxBlockHeadersPerMsg) }