Merge pull request #653 from wpaulino/improve-tx-record-err-msg
wtxmgr: improve error message for failed tx record retrieval
This commit is contained in:
commit
b08b47817c
1 changed files with 5 additions and 2 deletions
|
@ -7,6 +7,7 @@ package wtxmgr
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/blockchain"
|
"github.com/btcsuite/btcd/blockchain"
|
||||||
|
@ -725,7 +726,8 @@ func (s *Store) UnspentOutputs(ns walletdb.ReadBucket) ([]Credit, error) {
|
||||||
// output amount and pkScript.
|
// output amount and pkScript.
|
||||||
rec, err := fetchTxRecord(ns, &op.Hash, &block)
|
rec, err := fetchTxRecord(ns, &op.Hash, &block)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("unable to retrieve transaction %v: "+
|
||||||
|
"%v", op.Hash, err)
|
||||||
}
|
}
|
||||||
txOut := rec.MsgTx.TxOut[op.Index]
|
txOut := rec.MsgTx.TxOut[op.Index]
|
||||||
cred := Credit{
|
cred := Credit{
|
||||||
|
@ -768,7 +770,8 @@ func (s *Store) UnspentOutputs(ns walletdb.ReadBucket) ([]Credit, error) {
|
||||||
var rec TxRecord
|
var rec TxRecord
|
||||||
err = readRawTxRecord(&op.Hash, recVal, &rec)
|
err = readRawTxRecord(&op.Hash, recVal, &rec)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("unable to retrieve raw transaction "+
|
||||||
|
"%v: %v", op.Hash, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
txOut := rec.MsgTx.TxOut[op.Index]
|
txOut := rec.MsgTx.TxOut[op.Index]
|
||||||
|
|
Loading…
Reference in a new issue