peer+chancloser: allow restarting coop close process

On startup, we'll check whether we have the coop close chan status
and have already broadcasted a coop close txn, and then make a
decision on whether to restart the process based on that.
This commit is contained in:
eugene
2022-04-26 12:44:18 -04:00
parent a94466e936
commit d881679de0
2 changed files with 107 additions and 0 deletions

View File

@@ -483,6 +483,10 @@ func (c *ChanCloser) ProcessCloseMsg(msg lnwire.Message) ([]lnwire.Message,
feeProposal := calcCompromiseFee(c.chanPoint, c.idealFeeSat,
c.lastFeeProposal, remoteProposedFee,
)
if feeProposal > c.idealFeeSat*3 {
return nil, false, fmt.Errorf("couldn't find" +
" compromise fee")
}
// With our new fee proposal calculated, we'll craft a new close
// signed signature to send to the other party so we can continue