GetDisplayPrevHash() should not change its argument
This commit is contained in:
parent
57b12e5841
commit
886250e660
|
@ -44,13 +44,14 @@ func (b *Block) GetEncodableHash() []byte {
|
|||
}
|
||||
|
||||
func (b *Block) GetDisplayPrevHash() []byte {
|
||||
h := b.hdr.HashPrevBlock
|
||||
rhash := make([]byte, len(b.hdr.HashPrevBlock))
|
||||
copy(rhash, b.hdr.HashPrevBlock)
|
||||
// Reverse byte order
|
||||
for i := 0; i < len(h)/2; i++ {
|
||||
j := len(h) - 1 - i
|
||||
h[i], h[j] = h[j], h[i]
|
||||
for i := 0; i < len(rhash)/2; i++ {
|
||||
j := len(rhash) - 1 - i
|
||||
rhash[i], rhash[j] = rhash[j], rhash[i]
|
||||
}
|
||||
return h
|
||||
return rhash
|
||||
}
|
||||
|
||||
func (b *Block) HasSaplingTransactions() bool {
|
||||
|
|
Loading…
Reference in New Issue