From e98dc50b693520575b9ab1423d52b3476b94d93a Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Thu, 30 May 2013 11:31:22 -0500 Subject: [PATCH] Convert TxLoc to use normal returns. --- block.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block.go b/block.go index 8e144ca..24698dc 100644 --- a/block.go +++ b/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 }