From b711120dca661f6e30769a3d15c070a3235f8acf Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 10 Aug 2022 18:31:37 -0700 Subject: [PATCH] sweep: change outputs are now P2TR --- sweep/tx_input_set.go | 2 +- sweep/txgenerator.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sweep/tx_input_set.go b/sweep/tx_input_set.go index 9dc48901c..576471032 100644 --- a/sweep/tx_input_set.go +++ b/sweep/tx_input_set.go @@ -139,7 +139,7 @@ func newTxInputSet(wallet Wallet, feePerKW chainfee.SatPerKWeight, func (t *txInputSet) enoughInput() bool { // If we have a change output above dust, then we certainly have enough // inputs to the transaction. - if t.changeOutput >= lnwallet.DustLimitForSize(input.P2WPKHSize) { + if t.changeOutput >= lnwallet.DustLimitForSize(input.P2TRSize) { return true } diff --git a/sweep/txgenerator.go b/sweep/txgenerator.go index 3b07f2d64..20e80a00c 100644 --- a/sweep/txgenerator.go +++ b/sweep/txgenerator.go @@ -111,8 +111,8 @@ func generateInputPartitionings(sweepableInputs []txInput, // continuing with the remaining inputs will only lead to sets // with an even lower output value. if !txInputs.enoughInput() { - // The change output is always a p2wpkh here. - dl := lnwallet.DustLimitForSize(input.P2WPKHSize) + // The change output is always a p2tr here. + dl := lnwallet.DustLimitForSize(input.P2TRSize) log.Debugf("Set value %v (r=%v, c=%v) below dust "+ "limit of %v", txInputs.totalOutput(), txInputs.requiredOutput, txInputs.changeOutput,