wire: Fix MsgCFHeaders.Decode()
This commit is contained in:
parent
29b5ece196
commit
71ccc95502
1 changed files with 2 additions and 3 deletions
|
@ -60,15 +60,14 @@ func (msg *MsgCFHeaders) BtcDecode(r io.Reader, pver uint32) error {
|
|||
|
||||
// Create a contiguous slice of headers to deserialize into in order to
|
||||
// reduce the number of allocations.
|
||||
headers := make([]chainhash.Hash, count)
|
||||
var cfh chainhash.Hash
|
||||
msg.HeaderHashes = make([]*chainhash.Hash, 0, count)
|
||||
for i := uint64(0); i < count; i++ {
|
||||
cfh := &headers[i]
|
||||
err := readElement(r, &cfh)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
msg.AddCFHeader(cfh)
|
||||
msg.AddCFHeader(&cfh)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue