Browse Source

df: bunch of driveby formatting fixes

ppa
niftynei 4 years ago
committed by Christian Decker
parent
commit
1b6deaffc8
  1. 25
      lightningd/dual_open_control.c
  2. 12
      openingd/dualopend.c

25
lightningd/dual_open_control.c

@ -458,8 +458,6 @@ openchannel2_hook_cb(struct openchannel2_payload *payload STEALS)
}
}
/* If there's no plugin, the psbt will be NULL. We should pass an empty
* PSBT over, in this case */
msg = towire_dualopend_got_offer_reply(NULL, payload->accepter_funding,
payload->funding_feerate_per_kw,
payload->psbt,
@ -1877,18 +1875,17 @@ void peer_start_dualopend(struct peer *peer,
const u8 *msg;
assert(!peer->uncommitted_channel);
uc = peer->uncommitted_channel = new_uncommitted_channel(peer);
hsmfd = hsm_get_client_fd(peer->ld, &uc->peer->id, uc->dbid,
hsmfd = hsm_get_client_fd(peer->ld, &peer->id, uc->dbid,
HSM_CAP_COMMITMENT_POINT
| HSM_CAP_SIGN_REMOTE_TX);
uc->open_daemon = new_channel_subd(peer->ld,
"lightning_dualopend",
uc, UNCOMMITTED, &peer->id,
uc->log,
true, dualopend_wire_name,
uc->log, true,
dualopend_wire_name,
dual_opend_msg,
opend_channel_errmsg,
opend_channel_set_billboard,
@ -1896,11 +1893,13 @@ void peer_start_dualopend(struct peer *peer,
take(&pps->gossip_fd),
take(&pps->gossip_store_fd),
take(&hsmfd), NULL);
if (!uc->open_daemon) {
uncommitted_channel_disconnect(uc, LOG_BROKEN,
tal_fmt(tmpctx,
char *errmsg;
errmsg = tal_fmt(tmpctx,
"Running lightning_dualopend: %s",
strerror(errno)));
strerror(errno));
uncommitted_channel_disconnect(uc, LOG_BROKEN, errmsg);
tal_free(uc);
return;
}
@ -1912,13 +1911,13 @@ void peer_start_dualopend(struct peer *peer,
/* BOLT #2:
*
* The sender:
* - SHOULD set `minimum_depth` to a number of blocks it considers
* reasonable to avoid double-spending of the funding transaction.
* - SHOULD set `minimum_depth` to a number of blocks it
* considers reasonable to avoid double-spending of the
* funding transaction.
*/
uc->minimum_depth = peer->ld->config.anchor_confirms;
msg = towire_dualopend_init(NULL,
chainparams,
msg = towire_dualopend_init(NULL, chainparams,
peer->ld->our_features,
peer->their_features,
&uc->our_config,

12
openingd/dualopend.c

@ -1674,7 +1674,8 @@ static void accepter_start(struct state *state, const u8 *oc2_msg)
&state->feerate_per_kw_commitment)),
&state->localconf,
&state->remoteconf,
&state->our_points, &state->their_points,
&state->our_points,
&state->their_points,
&state->our_funding_pubkey,
&state->their_funding_pubkey,
true, true,
@ -1894,7 +1895,8 @@ static void opener_start(struct state *state, u8 *msg)
sync_crypto_write(state->pps, take(msg));
/* This is usually a very transient state... */
peer_billboard(false, "channel open: offered, waiting for accept_channel2");
peer_billboard(false, "channel open: offered, waiting for"
" accept_channel2");
/* ... since their reply should be immediate. */
msg = opening_negotiate_msg(tmpctx, state, true);
@ -1925,8 +1927,10 @@ static void opener_start(struct state *state, u8 *msg)
"Parsing accept_channel2 %s", tal_hex(msg, msg));
if (a_tlv->option_upfront_shutdown_script) {
state->upfront_shutdown_script[REMOTE] = tal_steal(state,
a_tlv->option_upfront_shutdown_script->shutdown_scriptpubkey);
state->upfront_shutdown_script[REMOTE]
= tal_steal(state,
a_tlv->option_upfront_shutdown_script
->shutdown_scriptpubkey);
} else
state->upfront_shutdown_script[REMOTE] = NULL;

Loading…
Cancel
Save