mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-20 13:34:32 +01:00
In this commit, we fix an API inconsistency introduced by a recent fix. Without this commit, it would be possible for a local user to attempt an explicit funding type, but then _fallback_ to implicit negotiation if the remote party didn't have the bit set. We resolve this by adding a new bit of information to ensure that if we're the funder and want explicit chan negotiation, we don't settle for anything less. A new test case has been added to exercise this behavior. To recap for posterity, the following issues were found and fixed in the negotiation logic: 1. If the remote party sent a channel type (in accept channel), but we didn't, then we would error out. We no longer error out and instead ensure the channel type they sent matches what we derived via implicit funding. 2. If the remote party _did not_ have the bit set, but they sent a chan type (in open channel), we would error out. We no longer error out, but instead will fall back to implicit negotiation. Ultimately we want to eventually flip the explicit funding bit to _required_ to eliminate any other future ambiguities and also ensure that it isn't possible to inadvertently fall back to implicit funding, when the _user_ expects explicit funding. |
||
---|---|---|
.. | ||
batch.go | ||
batch_test.go | ||
commitment_type_negotiation.go | ||
commitment_type_negotiation_test.go | ||
interfaces.go | ||
log.go | ||
manager.go | ||
manager_test.go |