lnwallet/btcwallet/btcwallet: adds extra double spend case

Adds an extra case to the select statement to catch
an error produced by btcd. The error is meant to signal
that an output was previously spent, which can appear
under certain race conditions in spending/broadcasting.
This caused our final itest to fail because it would
not try to recraft the justice txn.
This commit is contained in:
Conner Fromknecht
2018-02-20 20:48:53 -08:00
parent 34efb380be
commit 4449038ae5

View File

@@ -427,6 +427,10 @@ func (b *BtcWallet) PublishTransaction(tx *wire.MsgTx) error {
// Output was already spent.
return lnwallet.ErrDoubleSpend
}
if strings.Contains(err.Error(), "already been spent") {
// Output was already spent.
return lnwallet.ErrDoubleSpend
}
if strings.Contains(err.Error(), "orphan transaction") {
// Transaction is spending either output that
// is missing or already spent.