From 1b0f97a4832b9c69acaa3c0fcd325510995564cd Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Thu, 14 Dec 2023 18:50:28 -0800 Subject: [PATCH] chancloser: move initFeeBaseline to BeginNegotiation --- lnwallet/chancloser/chancloser.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lnwallet/chancloser/chancloser.go b/lnwallet/chancloser/chancloser.go index 47283d29a..b88f2b97e 100644 --- a/lnwallet/chancloser/chancloser.go +++ b/lnwallet/chancloser/chancloser.go @@ -529,10 +529,6 @@ func (c *ChanCloser) ReceiveShutdown( // transaction. c.remoteDeliveryScript = msg.Address - // Now that we know their desired delivery script, we can - // compute what our max/ideal fee will be. - c.initFeeBaseline() - // We'll generate a shutdown message of our own to send across // the wire. localShutdown, err := c.initChanShutdown() @@ -586,10 +582,6 @@ func (c *ChanCloser) ReceiveShutdown( // think the closing transaction should look like. c.state = closeAwaitingFlush - // Now that we know their desired delivery script, we can - // compute what our max/ideal fee will be. - c.initFeeBaseline() - // If this is a taproot channel, then we'll want to stash the // local+remote nonces so we can properly create a new musig // session for signing. @@ -631,6 +623,10 @@ func (c *ChanCloser) BeginNegotiation() ( switch c.state { case closeAwaitingFlush: + // Now that we know their desired delivery script, we can + // compute what our max/ideal fee will be. + c.initFeeBaseline() + // At this point, we can now start the fee negotiation state, by // constructing and sending our initial signature for what we // think the closing transaction should look like.