Browse Source

closingd: make sure we restrict feerange with initial offer.

@ZmnSCPxj points out that this is allowed, though invalid:

1. commitment_fee = 1000
2. funder: 800
3. fundee: 200
4. funder: 900

We need to adjust the feerange using the initial funder offer.
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
1faec99c59
  1. 4
      closingd/closing.c

4
closingd/closing.c

@ -530,6 +530,10 @@ int main(int argc, char *argv[])
/* Now we have first two points, we can init fee range. */
init_feerange(&feerange, commitment_fee, offer, deprecated_api);
/* Apply (and check) funder offer now. */
adjust_feerange(&cs, gossip_index, &channel_id,
&feerange, offer[funder], funder);
/* Now any extra rounds required. */
while (offer[LOCAL] != offer[REMOTE]) {
/* Still don't agree: adjust feerange based on previous offer */

Loading…
Cancel
Save