lnwallet: return ErrNoOutputs in case no outputs are sent to

This commit is contained in:
Johan T. Halseth committed 2019-03-15 23:47:15 +01:00
1 parent a5becc2063
commit 306c0c8aab
2 files changed
+11

No files matched your search

+7
View File
@@ -299,6 +299,10 @@ func (b *BtcWallet) SendOutputs(outputs []*wire.TxOut,
// SendOutputs.
feeSatPerKB := btcutil.Amount(feeRate.FeePerKVByte())
// Sanity check outputs.
if len(outputs) < 1 {
return nil, lnwallet.ErrNoOutputs
}
return b.wallet.SendOutputs(outputs, defaultAccount, 1, feeSatPerKB)
}
@@ -321,6 +325,9 @@ func (b *BtcWallet) CreateSimpleTx(outputs []*wire.TxOut,
feeSatPerKB := btcutil.Amount(feeRate.FeePerKVByte())
// Sanity check outputs.
if len(outputs) < 1 {
return nil, lnwallet.ErrNoOutputs
}
for _, output := range outputs {
err := txrules.CheckOutput(output, feeSatPerKB)
if err != nil {