]> git.bitcoin.ninja Git - rust-lightning/commit
Correct initial commitment tx fee affordability checks on open
authorMatt Corallo <git@bluematt.me>
Wed, 10 Nov 2021 01:36:26 +0000 (01:36 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 23 Nov 2021 01:20:43 +0000 (01:20 +0000)
commit940ef05371221138a930b1afc1243cb1cdf63873
tree6599b86d8081045742fc0fec42f8579ff681f602
parent1d30e06893ff6e19fbbe472ea74ef150f296cbfc
Correct initial commitment tx fee affordability checks on open

Previously, we would reject inbound channels if the funder wasn't
able to meet our channel reserve on their first commitment
transaction only if they also failed to push enough to us for us
to not meet their initial channel reserve as well.

There's not a lot of reason to care about us meeting their reserve,
however - its largely expected that they may not push enough to us
in the initial open to meet it, and its not actually our problem if
they don't.

Further, we used our own fee, instead of the channel's actual fee,
to calculate fee affordability of the initial commitment
transaction.

We resolve both issues here, rewriting the combined affordability
check conditionals in inbound channel open handling and adding a
fee affordability check for outbound channels as well.

The prior code may have allowed a counterparty to start the channel
with "no punishment" states - violating the reason for the reserve
threshold.
fuzz/src/full_stack.rs
lightning/src/ln/channel.rs
lightning/src/ln/functional_tests.rs