Convert TxLoc to use normal returns.
This commit is contained in:
parent
969fbd1500
commit
e98dc50b69
1 changed files with 3 additions and 3 deletions
6
block.go
6
block.go
|
@ -158,17 +158,17 @@ func (b *Block) ProtocolVersion() uint32 {
|
|||
// TxLoc() returns the offsets and lengths of each transaction in a raw block.
|
||||
// It is used to allow fast indexing into transactions within the raw byte
|
||||
// stream.
|
||||
func (b *Block) TxLoc() (txlocD []btcwire.TxLoc, err error) {
|
||||
func (b *Block) TxLoc() ([]btcwire.TxLoc, error) {
|
||||
rawMsg, pver, err := b.Bytes()
|
||||
if err != nil {
|
||||
return
|
||||
return nil, err
|
||||
}
|
||||
rbuf := bytes.NewBuffer(rawMsg)
|
||||
|
||||
var mblock btcwire.MsgBlock
|
||||
txLocs, err := mblock.BtcDecodeTxLoc(rbuf, pver)
|
||||
if err != nil {
|
||||
return
|
||||
return nil, err
|
||||
}
|
||||
return txLocs, err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue