Merge pull request #5895 from LN-Zap/upstream/fix/sweeps-missing-label

sweep: add label to sweep transactions
This commit is contained in:
Oliver Gugger 2021-10-26 15:25:55 +02:00 committed by GitHub
commit 6450f0c080
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -434,6 +434,8 @@ messages directly. There is no routing/path finding involved.
* [Fix REST/WebSocket API itest that lead to overall test * [Fix REST/WebSocket API itest that lead to overall test
timeout](https://github.com/lightningnetwork/lnd/pull/5845). timeout](https://github.com/lightningnetwork/lnd/pull/5845).
* [Fix missing label on sweep transactions](https://github.com/lightningnetwork/lnd/pull/5895).
## Database ## Database
* [Ensure single writer for legacy * [Ensure single writer for legacy

View file

@ -15,6 +15,7 @@ import (
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
"github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/input" "github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/labels"
"github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwallet/chainfee" "github.com/lightningnetwork/lnd/lnwallet/chainfee"
) )
@ -1237,7 +1238,9 @@ func (s *UtxoSweeper) sweep(inputs inputSet, feeRate chainfee.SatPerKWeight,
}), }),
) )
err = s.cfg.Wallet.PublishTransaction(tx, "") err = s.cfg.Wallet.PublishTransaction(
tx, labels.MakeLabel(labels.LabelTypeSweepTransaction, nil),
)
// In case of an unexpected error, don't try to recover. // In case of an unexpected error, don't try to recover.
if err != nil && err != lnwallet.ErrDoubleSpend { if err != nil && err != lnwallet.ErrDoubleSpend {