Check for missing txs before dereferencing details
This commit is contained in:
parent
d2c851431b
commit
eefc610904
1 changed files with 4 additions and 0 deletions
|
@ -1936,6 +1936,10 @@ func (w *Wallet) SignTransaction(tx *wire.MsgTx, hashType txscript.SigHashType,
|
||||||
prevIndex := txIn.PreviousOutPoint.Index
|
prevIndex := txIn.PreviousOutPoint.Index
|
||||||
txDetails, err := w.TxStore.TxDetails(prevHash)
|
txDetails, err := w.TxStore.TxDetails(prevHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("Cannot query previous transaction "+
|
||||||
|
"details for %v: %v", txIn.PreviousOutPoint, err)
|
||||||
|
}
|
||||||
|
if txDetails == nil {
|
||||||
return nil, fmt.Errorf("%v not found",
|
return nil, fmt.Errorf("%v not found",
|
||||||
txIn.PreviousOutPoint)
|
txIn.PreviousOutPoint)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue