mirror of
https://github.com/LBRYFoundation/lbcutil.git
synced 2025-08-23 17:47:30 +00:00
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.
|
// 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
|
// It is used to allow fast indexing into transactions within the raw byte
|
||||||
// stream.
|
// stream.
|
||||||
func (b *Block) TxLoc() (txlocD []btcwire.TxLoc, err error) {
|
func (b *Block) TxLoc() ([]btcwire.TxLoc, error) {
|
||||||
rawMsg, pver, err := b.Bytes()
|
rawMsg, pver, err := b.Bytes()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return nil, err
|
||||||
}
|
}
|
||||||
rbuf := bytes.NewBuffer(rawMsg)
|
rbuf := bytes.NewBuffer(rawMsg)
|
||||||
|
|
||||||
var mblock btcwire.MsgBlock
|
var mblock btcwire.MsgBlock
|
||||||
txLocs, err := mblock.BtcDecodeTxLoc(rbuf, pver)
|
txLocs, err := mblock.BtcDecodeTxLoc(rbuf, pver)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return nil, err
|
||||||
}
|
}
|
||||||
return txLocs, err
|
return txLocs, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue