From a6c76f9079fee627f94635e261b37f6e39f32277 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 13 Apr 2018 10:33:03 +0930 Subject: [PATCH] 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 --- closingd/closing.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/closingd/closing.c b/closingd/closing.c index 12f690208..fc7caaab7 100644 --- a/closingd/closing.c +++ b/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 */