Browse Source

closingd: even with old clients, still require funding offer < commitment fee.

For older clients we could do more exhaustive checks, but effort is better
spent on removing this altogether post 0.6 as clients upgrade.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
a6c76f9079
  1. 10
      closingd/closing.c

10
closingd/closing.c

@ -338,8 +338,7 @@ struct feerange {
static void init_feerange(struct feerange *feerange,
u64 commitment_fee,
const u64 offer[NUM_SIDES],
bool allow_mistakes)
const u64 offer[NUM_SIDES])
{
feerange->min = 0;
@ -350,7 +349,7 @@ static void init_feerange(struct feerange *feerange,
* in [BOLT #3](03-transactions.md#fee-calculation).
*/
feerange->max = commitment_fee;
feerange->allow_mistakes = allow_mistakes;
feerange->allow_mistakes = false;
if (offer[LOCAL] > offer[REMOTE])
feerange->higher_side = LOCAL;
@ -528,12 +527,15 @@ 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);
init_feerange(&feerange, commitment_fee, offer);
/* Apply (and check) funder offer now. */
adjust_feerange(&cs, gossip_index, &channel_id,
&feerange, offer[funder], funder);
/* Older spec clients would make offers independently, so allow */
feerange.allow_mistakes = deprecated_api;
/* Now any extra rounds required. */
while (offer[LOCAL] != offer[REMOTE]) {
/* Still don't agree: adjust feerange based on previous offer */

Loading…
Cancel
Save