shachain: switch encode/decode methods to use io.Reader/Writer
* Help avoid a bug related to passing a copy of bytes.Buffer into Encode/Decode instead of a pointer
This commit is contained in:
parent
5840786922
commit
c2403d4b2d
@ -5,6 +5,7 @@ import (
|
||||
"crypto/rand"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"io"
|
||||
"sync"
|
||||
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
@ -170,11 +171,11 @@ func (h *HyperShaChain) LocatePreImage(outputScript []byte) (uint64, *[32]byte)
|
||||
}
|
||||
|
||||
// MarshallBinary...
|
||||
func (h *HyperShaChain) Encode(b bytes.Buffer) error {
|
||||
func (h *HyperShaChain) Encode(b io.Writer) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// UnmarshallBinary...
|
||||
func (h *HyperShaChain) Decode(b bytes.Buffer) error {
|
||||
func (h *HyperShaChain) Decode(b io.Reader) error {
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user