Reject outbound channels if the total reserve is larger than funding 2022-05-lol-more-underflow
authorMatt Corallo <git@bluematt.me>
Mon, 2 May 2022 20:45:17 +0000 (20:45 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 2 May 2022 20:45:17 +0000 (20:45 +0000)
commitf2de2f3ff7166abf05baf3bd083378b7b4742585
treee51d0ae02e8d48a9d4321336e6da417007012dbc
parent9bdce47f0e0516e37c89c09f1975dfc06b5870b1
Reject outbound channels if the total reserve is larger than funding

In 2826af75a5761859dedcddc870de0753ae4ecde4 we fixed a fuzz crash
in which the total reserve values in a channel were greater than
the funding amount, checked when an incoming channel is accepted.

This, however, did not fix the same issue for outbound channels,
where a peer can accept a channel with a nonsense reserve value in
the `accept_channel` message. The `full_stack_target` fuzzer
eventually found its way into the same issue, which this resolves.

Thanks (again) to Chaincode Labs for providing the fuzzing
resources which found this bug!
lightning/src/ln/channel.rs