manager: distinguish between lnwallet and btcwallet/wallet err

Unfortunately there are two error messages that are very similar (the
only difference is "doesn't" vs. "does not") and can both be returned,
depending on the code path taken.
This commit is contained in:
Oliver Gugger 2021-01-07 16:39:41 +01:00
parent e3e384fc4f
commit 52131d8690
No known key found for this signature in database
GPG key ID: 8E4256593F177720

View file

@ -15,6 +15,7 @@ import (
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcutil/txsort"
"github.com/btcsuite/btcwallet/wallet"
"github.com/btcsuite/btcwallet/wallet/txrules"
"github.com/btcsuite/btcwallet/wtxmgr"
"github.com/lightninglabs/lndclient"
@ -1249,9 +1250,15 @@ func (m *Manager) BumpAccountFee(ctx context.Context,
err := m.cfg.Wallet.BumpFee(ctx, op, newFeeRate)
if err != nil {
// Output isn't known to lnd, continue to the next one.
// Unfortunately there are two slightly different error
// messages that can be returned, depending on what code
// path is taken.
if strings.Contains(err.Error(), lnwallet.ErrNotMine.Error()) {
continue
}
if strings.Contains(err.Error(), wallet.ErrNotMine.Error()) {
continue
}
// A fatal error occurred, return it.
return err