refactor GetDisplayPrevHash(), part of block header
This commit is contained in:
parent
a18cb41c92
commit
7b78663312
|
@ -44,14 +44,7 @@ func (b *Block) GetEncodableHash() []byte {
|
|||
}
|
||||
|
||||
func (b *Block) GetDisplayPrevHash() []byte {
|
||||
rhash := make([]byte, len(b.hdr.HashPrevBlock))
|
||||
copy(rhash, b.hdr.HashPrevBlock)
|
||||
// Reverse byte order
|
||||
for i := 0; i < len(rhash)/2; i++ {
|
||||
j := len(rhash) - 1 - i
|
||||
rhash[i], rhash[j] = rhash[j], rhash[i]
|
||||
}
|
||||
return rhash
|
||||
return b.hdr.GetDisplayPrevHash()
|
||||
}
|
||||
|
||||
func (b *Block) HasSaplingTransactions() bool {
|
||||
|
|
|
@ -227,3 +227,14 @@ func (hdr *blockHeader) GetEncodableHash() []byte {
|
|||
|
||||
return digest[:]
|
||||
}
|
||||
|
||||
func (hdr *blockHeader) GetDisplayPrevHash() []byte {
|
||||
rhash := make([]byte, len(hdr.HashPrevBlock))
|
||||
copy(rhash, hdr.HashPrevBlock)
|
||||
// Reverse byte order
|
||||
for i := 0; i < len(rhash)/2; i++ {
|
||||
j := len(rhash) - 1 - i
|
||||
rhash[i], rhash[j] = rhash[j], rhash[i]
|
||||
}
|
||||
return rhash
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue