mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
87fc58ecfe
The new migration removes the sweeper-last-tx top level bucket from the channel.db database.
24 lines
541 B
Go
24 lines
541 B
Go
package migration31
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/btcsuite/btcwallet/walletdb"
|
|
"github.com/lightningnetwork/lnd/kvdb"
|
|
)
|
|
|
|
// DeleteLastPublishedTxTLB deletes the top level bucket with the key
|
|
// "sweeper-last-tx".
|
|
func DeleteLastPublishedTxTLB(tx kvdb.RwTx) error {
|
|
log.Infof("Deleting top-level bucket: %x ...", lastTxBucketKey)
|
|
|
|
err := tx.DeleteTopLevelBucket(lastTxBucketKey)
|
|
if err != nil && !errors.Is(err, walletdb.ErrBucketNotFound) {
|
|
return err
|
|
}
|
|
|
|
log.Infof("Deleted top-level bucket: %x", lastTxBucketKey)
|
|
|
|
return nil
|
|
}
|