Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
Various feedback from cdecker, and testing from @openoms.
  • Loading branch information
rustyrussell committed Mar 10, 2021
1 parent 599113e commit 85477a2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions closingd/closingd.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ static struct bitcoin_tx *close_tx(const tal_t *ctx,
out_minus_fee[LOCAL],
out_minus_fee[REMOTE],
dust_limit);
assert(tx);
if (!tx)
peer_failed_err(pps, channel_id,
"Both outputs below dust limit:"
Expand Down Expand Up @@ -696,7 +695,7 @@ int main(int argc, char *argv[])
type_to_string(tmpctx, struct amount_sat, &offer[LOCAL]));
status_debug("fee negotiation step = %s", fee_negotiation_step_str);
if (wrong_funding)
status_unusual("Seting wrong_funding_txid to %s:%u",
status_unusual("Setting wrong_funding_txid to %s:%u",
type_to_string(tmpctx, struct bitcoin_txid,
&wrong_funding->txid),
wrong_funding->n);
Expand Down
8 changes: 4 additions & 4 deletions doc/lightningd-config.5
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,9 @@ This usually requires \fBexperimental-onion-messages\fR as well\. See


Specifying this allows the \fBwrong_funding\fR field in shutdown: if a
remote node has opened a channel using the incorrect txid (and it
hasn't been used yet at all) this allows them to negotiate a clean
shutdown with the txid they offer\.
remote node has opened a channel but claims it used the incorrect txid
(and the channel hasn't been used yet at all) this allows them to
negotiate a clean shutdown with the txid they offer\.

.SH BUGS

Expand All @@ -617,4 +617,4 @@ Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
Note: the modules in the ccan/ directory have their own licenses, but
the rest of the code is covered by the BSD-style MIT license\.

\" SHA256STAMP:ecfd7ac60b50a20cad39dfa0e423e4885256a94658b5886f577df50773555e7e
\" SHA256STAMP:b0cdc467650b05758f90f2523ab8b45e526ac818e426cb2c2bc42cb98673e373
6 changes: 3 additions & 3 deletions doc/lightningd-config.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,9 @@ lightning-offer(7) and lightning-fetchinvoice(7).
**experimental-shutdown-wrong-funding**

Specifying this allows the `wrong_funding` field in shutdown: if a
remote node has opened a channel using the incorrect txid (and it
hasn't been used yet at all) this allows them to negotiate a clean
shutdown with the txid they offer.
remote node has opened a channel but claims it used the incorrect txid
(and the channel hasn't been used yet at all) this allows them to
negotiate a clean shutdown with the txid they offer.

BUGS
----
Expand Down
4 changes: 2 additions & 2 deletions lightningd/peer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -1647,7 +1647,7 @@ static struct command_result *json_close(struct command *cmd,

if (wrong_funding) {
if (!feature_negotiated(cmd->ld->our_features,
peer->their_features,
channel->peer->their_features,
OPT_SHUTDOWN_WRONG_FUNDING)) {
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
"wrong_funding feature not negotiated"
Expand All @@ -1656,7 +1656,7 @@ static struct command_result *json_close(struct command *cmd,
->bits[INIT_FEATURE],
OPT_SHUTDOWN_WRONG_FUNDING)
? "yes" : "no",
feature_offered(peer->their_features,
feature_offered(channel->peer->their_features,
OPT_SHUTDOWN_WRONG_FUNDING)
? "yes" : "no");
}
Expand Down

0 comments on commit 85477a2

Please sign in to comment.