lnd/funding
Olaoluwa Osuntokun f630cfd4d7 funding: ensure a local funding w/ explicit type can't be downgraded
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.
2021-11-24 14:32:55 -06:00
..
batch.go multi: allow skipping the PSBT finalize step 2021-10-04 11:17:08 +02:00
batch_test.go multi: allow skipping the PSBT finalize step 2021-10-04 11:17:08 +02:00
commitment_type_negotiation.go funding: ensure a local funding w/ explicit type can't be downgraded 2021-11-24 14:32:55 -06:00
commitment_type_negotiation_test.go funding: ensure a local funding w/ explicit type can't be downgraded 2021-11-24 14:32:55 -06:00
interfaces.go funding+peer: rename Manager interface to Controller 2020-12-17 09:36:34 -05:00
log.go lnd+funding: register funding logger 2020-12-17 09:36:34 -05:00
manager.go funding: ensure a local funding w/ explicit type can't be downgraded 2021-11-24 14:32:55 -06:00
manager_test.go multi: refactor SignMessage to specify hashing 2021-10-14 15:42:44 +02:00