mirror of
https://github.com/lightningnetwork/lnd.git
synced 2026-08-13 12:32:48 +02:00
Migrate all btcd dependencies to the new per-package v2 modules (wire/v2, txscript/v2, chaincfg/v2, chainhash/v2, btcutil/v2, psbt/v2, btcec/v2) introduced by btcd v0.26.0, and pin the tagged ecosystem versions: btcwallet v0.17.0, neutrino v0.18.0 and lightning-onion v1.4.0. The bulk of the import rewrite was produced by the scripted diff from https://github.com/btcsuite/btcd/pull/2547 (followed by 'make rpc'). The address symbols that moved out of btcutil into the new address package are imported as btcaddr where a local "address" variable would otherwise shadow them. The go.mod/go.sum updates and the remaining manual compilation fixes are folded into this single commit so it builds on its own (the migration was previously split into a reproducible scripted-diff plus follow-ups, intended to be squashed on merge).
29 lines
828 B
Go
29 lines
828 B
Go
package lnd
|
|
|
|
import (
|
|
"github.com/btcsuite/btcd/chainhash/v2"
|
|
"github.com/lightningnetwork/lnd/lnwallet"
|
|
)
|
|
|
|
// sweeperWallet is a wrapper around the LightningWallet that implements the
|
|
// sweeper's Wallet interface.
|
|
type sweeperWallet struct {
|
|
*lnwallet.LightningWallet
|
|
}
|
|
|
|
// newSweeperWallet creates a new sweeper wallet from the given
|
|
// LightningWallet.
|
|
func newSweeperWallet(w *lnwallet.LightningWallet) *sweeperWallet {
|
|
return &sweeperWallet{
|
|
LightningWallet: w,
|
|
}
|
|
}
|
|
|
|
// CancelRebroadcast cancels the rebroadcast of the given transaction.
|
|
func (s *sweeperWallet) CancelRebroadcast(txid chainhash.Hash) {
|
|
// For neutrino, we don't config the rebroadcaster for the wallet as it
|
|
// manages the rebroadcasting logic in neutrino itself.
|
|
if s.Cfg.Rebroadcaster != nil {
|
|
s.Cfg.Rebroadcaster.MarkAsConfirmed(txid)
|
|
}
|
|
}
|