mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-08-30 08:51:28 +00:00
Rename blockHashLen to blockHeaderLen.
The old name no longer makes sense because the hash length is the same as the header length.
This commit is contained in:
parent
843e71515a
commit
5032b07c66
1 changed files with 4 additions and 4 deletions
|
@ -40,9 +40,9 @@ type BlockHeader struct {
|
||||||
Nonce uint32
|
Nonce uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// blockHashLen is a constant that represents how much of the block header is
|
// blockHeaderLen is a constant that represents the number of bytes for a block
|
||||||
// used when computing the block sha 0:blockHashLen
|
// header.
|
||||||
const blockHashLen = 80
|
const blockHeaderLen = 80
|
||||||
|
|
||||||
// BlockSha computes the block identifier hash for the given block header.
|
// BlockSha computes the block identifier hash for the given block header.
|
||||||
func (h *BlockHeader) BlockSha() (ShaHash, error) {
|
func (h *BlockHeader) BlockSha() (ShaHash, error) {
|
||||||
|
@ -55,7 +55,7 @@ func (h *BlockHeader) BlockSha() (ShaHash, error) {
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
var sha ShaHash
|
var sha ShaHash
|
||||||
_ = writeBlockHeader(&buf, 0, h)
|
_ = 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
|
// Even though this function can't currently fail, it still returns
|
||||||
// a potential error to help future proof the API should a failure
|
// a potential error to help future proof the API should a failure
|
||||||
|
|
Loading…
Add table
Reference in a new issue