From 5032b07c6643bd8ea63ccde4f91283da7c389d16 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sun, 29 Jun 2014 17:45:05 -0500 Subject: [PATCH] Rename blockHashLen to blockHeaderLen. The old name no longer makes sense because the hash length is the same as the header length. --- blockheader.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blockheader.go b/blockheader.go index 519305b9..e3ad89df 100644 --- a/blockheader.go +++ b/blockheader.go @@ -40,9 +40,9 @@ type BlockHeader struct { Nonce uint32 } -// blockHashLen is a constant that represents how much of the block header is -// used when computing the block sha 0:blockHashLen -const blockHashLen = 80 +// blockHeaderLen is a constant that represents the number of bytes for a block +// header. +const blockHeaderLen = 80 // BlockSha computes the block identifier hash for the given block header. func (h *BlockHeader) BlockSha() (ShaHash, error) { @@ -55,7 +55,7 @@ func (h *BlockHeader) BlockSha() (ShaHash, error) { var buf bytes.Buffer var sha ShaHash _ = writeBlockHeader(&buf, 0, h) - _ = sha.SetBytes(DoubleSha256(buf.Bytes()[0:blockHashLen])) + _ = sha.SetBytes(DoubleSha256(buf.Bytes()[0:blockHeaderLen])) // Even though this function can't currently fail, it still returns // a potential error to help future proof the API should a failure