Skip to content

Commit

Permalink
Remove deprecated closing support from closingd.
Browse files Browse the repository at this point in the history
This was changed in the spec in January, and bd1aa93 added it 2018-02-02.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Jul 29, 2018
1 parent ab331f7 commit 8ee21bc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
21 changes: 0 additions & 21 deletions closingd/closing.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* FIXME: We don't relay from gossipd at all here. */
#include <bitcoin/script.h>
#include <closingd/gen_closing_wire.h>
#include <common/close_tx.h>
Expand Down Expand Up @@ -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,
Expand All @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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);

Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions closingd/closing_wire.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion lightningd/closing_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ee21bc

Please sign in to comment.