Reduce our stated max closing-transaction fee to be the true value 2021-09-tighter-max_fee-constant
authorMatt Corallo <git@bluematt.me>
Thu, 9 Sep 2021 01:09:41 +0000 (01:09 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 10 Sep 2021 00:24:58 +0000 (00:24 +0000)
commitb348d9cb605c8fc00e653585b522dd628fbf14c7
tree848f92c89eae81dda226b76bd2457c604ea927af
parent4c4d99b291c5336130d3d5cfeffa8ab88fd97783
Reduce our stated max closing-transaction fee to be the true value

When communicating the maximum fee we're willing to accept on a
cooperative closing transaction to our peer, we currently tell them
we'll accept `u64::max_value()` if they're the ones who have to pay
it. Spec-wise this is fine - they aren't allowed to try to claim
our balance, and we don't care how much of their own funds they
want to spend on transaction fees.

However, the Eclair folks prefer to check all values on the wire
do not exceed 21 million BTC, which seems like generally good
practice to avoid overflows and such issues. Thus, our close
messages are rejected by Eclair.

Here we simply relax our stated maximum to be the real value - our
counterparty's current balance in satoshis.

Fixes #1071
lightning/src/ln/channel.rs