From 8ee21bc35255bac4e0177b9916ff741d11e6a7a0 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 29 Jul 2018 11:31:16 +0930 Subject: [PATCH] Remove deprecated closing support from closingd. This was changed in the spec in January, and bd1aa935b added it 2018-02-02. Signed-off-by: Rusty Russell --- closingd/closing.c | 21 --------------------- closingd/closing_wire.csv | 2 -- lightningd/closing_control.c | 1 - 3 files changed, 24 deletions(-) diff --git a/closingd/closing.c b/closingd/closing.c index f0a9f0357..048452475 100644 --- a/closingd/closing.c +++ b/closingd/closing.c @@ -1,4 +1,3 @@ -/* FIXME: We don't relay from gossipd at all here. */ #include #include #include @@ -337,8 +336,6 @@ static uint64_t receive_offer(struct crypto_state *cs, struct feerange { enum side higher_side; u64 min, max; - - bool allow_mistakes; }; static void init_feerange(struct feerange *feerange, @@ -354,7 +351,6 @@ static void init_feerange(struct feerange *feerange, * in [BOLT #3](03-transactions.md#fee-calculation). */ feerange->max = commitment_fee; - feerange->allow_mistakes = false; if (offer[LOCAL] > offer[REMOTE]) feerange->higher_side = LOCAL; @@ -371,18 +367,6 @@ static void adjust_feerange(struct crypto_state *cs, struct feerange *feerange, u64 offer, enum side side) { - if (offer < feerange->min || offer > feerange->max) { - if (!feerange->allow_mistakes || side != REMOTE) - peer_failed(cs, channel_id, - "%s offer %"PRIu64 - " not between %"PRIu64" and %"PRIu64, - side == LOCAL ? "local" : "remote", - offer, feerange->min, feerange->max); - - status_trace("Allowing deprecated out-of-range fee"); - return; - } - /* BOLT #2: * * - MUST propose a value "strictly between" the received @@ -444,7 +428,6 @@ int main(int argc, char *argv[]) bool reconnected; u64 next_index[NUM_SIDES], revocations_received; enum side whose_turn; - bool deprecated_api; u8 *channel_reestablish; subdaemon_setup(argc, argv); @@ -470,7 +453,6 @@ int main(int argc, char *argv[]) &next_index[LOCAL], &next_index[REMOTE], &revocations_received, - &deprecated_api, &channel_reestablish)) master_badmsg(WIRE_CLOSING_INIT, msg); @@ -537,9 +519,6 @@ int main(int argc, char *argv[]) /* Apply (and check) funder offer now. */ adjust_feerange(&cs, &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 */ diff --git a/closingd/closing_wire.csv b/closingd/closing_wire.csv index e47bf5d0f..1dc45cb24 100644 --- a/closingd/closing_wire.csv +++ b/closingd/closing_wire.csv @@ -23,8 +23,6 @@ closing_init,,reconnected,bool closing_init,,next_index_local,u64 closing_init,,next_index_remote,u64 closing_init,,revocations_received,u64 -# This means we allow closing negotiations out of bounds. -closing_init,,deprecated_api,bool closing_init,,channel_reestablish_len,u16 closing_init,,channel_reestablish,channel_reestablish_len*u8 diff --git a/lightningd/closing_control.c b/lightningd/closing_control.c index debc67260..fbe6c71a0 100644 --- a/lightningd/closing_control.c +++ b/lightningd/closing_control.c @@ -214,7 +214,6 @@ void peer_start_closingd(struct channel *channel, channel->next_index[LOCAL], channel->next_index[REMOTE], num_revocations, - deprecated_apis, channel_reestablish); /* We don't expect a response: it will give us feedback on