mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
df: bunch of driveby formatting fixes
This commit is contained in:
committed by
Christian Decker
parent
85ecef2849
commit
1b6deaffc8
@@ -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,
|
msg = towire_dualopend_got_offer_reply(NULL, payload->accepter_funding,
|
||||||
payload->funding_feerate_per_kw,
|
payload->funding_feerate_per_kw,
|
||||||
payload->psbt,
|
payload->psbt,
|
||||||
@@ -1877,18 +1875,17 @@ void peer_start_dualopend(struct peer *peer,
|
|||||||
const u8 *msg;
|
const u8 *msg;
|
||||||
|
|
||||||
assert(!peer->uncommitted_channel);
|
assert(!peer->uncommitted_channel);
|
||||||
|
|
||||||
uc = peer->uncommitted_channel = new_uncommitted_channel(peer);
|
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_COMMITMENT_POINT
|
||||||
| HSM_CAP_SIGN_REMOTE_TX);
|
| HSM_CAP_SIGN_REMOTE_TX);
|
||||||
|
|
||||||
uc->open_daemon = new_channel_subd(peer->ld,
|
uc->open_daemon = new_channel_subd(peer->ld,
|
||||||
"lightning_dualopend",
|
"lightning_dualopend",
|
||||||
uc, UNCOMMITTED, &peer->id,
|
uc, UNCOMMITTED, &peer->id,
|
||||||
uc->log,
|
uc->log, true,
|
||||||
true, dualopend_wire_name,
|
dualopend_wire_name,
|
||||||
dual_opend_msg,
|
dual_opend_msg,
|
||||||
opend_channel_errmsg,
|
opend_channel_errmsg,
|
||||||
opend_channel_set_billboard,
|
opend_channel_set_billboard,
|
||||||
@@ -1896,11 +1893,13 @@ void peer_start_dualopend(struct peer *peer,
|
|||||||
take(&pps->gossip_fd),
|
take(&pps->gossip_fd),
|
||||||
take(&pps->gossip_store_fd),
|
take(&pps->gossip_store_fd),
|
||||||
take(&hsmfd), NULL);
|
take(&hsmfd), NULL);
|
||||||
|
|
||||||
if (!uc->open_daemon) {
|
if (!uc->open_daemon) {
|
||||||
uncommitted_channel_disconnect(uc, LOG_BROKEN,
|
char *errmsg;
|
||||||
tal_fmt(tmpctx,
|
errmsg = tal_fmt(tmpctx,
|
||||||
"Running lightning_dualopend: %s",
|
"Running lightning_dualopend: %s",
|
||||||
strerror(errno)));
|
strerror(errno));
|
||||||
|
uncommitted_channel_disconnect(uc, LOG_BROKEN, errmsg);
|
||||||
tal_free(uc);
|
tal_free(uc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1912,23 +1911,23 @@ void peer_start_dualopend(struct peer *peer,
|
|||||||
/* BOLT #2:
|
/* BOLT #2:
|
||||||
*
|
*
|
||||||
* The sender:
|
* The sender:
|
||||||
* - SHOULD set `minimum_depth` to a number of blocks it considers
|
* - SHOULD set `minimum_depth` to a number of blocks it
|
||||||
* reasonable to avoid double-spending of the funding transaction.
|
* considers reasonable to avoid double-spending of the
|
||||||
|
* funding transaction.
|
||||||
*/
|
*/
|
||||||
uc->minimum_depth = peer->ld->config.anchor_confirms;
|
uc->minimum_depth = peer->ld->config.anchor_confirms;
|
||||||
|
|
||||||
msg = towire_dualopend_init(NULL,
|
msg = towire_dualopend_init(NULL, chainparams,
|
||||||
chainparams,
|
peer->ld->our_features,
|
||||||
peer->ld->our_features,
|
peer->their_features,
|
||||||
peer->their_features,
|
&uc->our_config,
|
||||||
&uc->our_config,
|
max_to_self_delay,
|
||||||
max_to_self_delay,
|
min_effective_htlc_capacity,
|
||||||
min_effective_htlc_capacity,
|
pps, &uc->local_basepoints,
|
||||||
pps, &uc->local_basepoints,
|
&uc->local_funding_pubkey,
|
||||||
&uc->local_funding_pubkey,
|
uc->minimum_depth,
|
||||||
uc->minimum_depth,
|
feerate_min(peer->ld, NULL),
|
||||||
feerate_min(peer->ld, NULL),
|
feerate_max(peer->ld, NULL),
|
||||||
feerate_max(peer->ld, NULL),
|
send_msg);
|
||||||
send_msg);
|
|
||||||
subd_send_msg(uc->open_daemon, take(msg));
|
subd_send_msg(uc->open_daemon, take(msg));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -735,8 +735,8 @@ static void dualopend_send_custommsg(struct state *state, const u8 *msg)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static u8 *psbt_to_tx_sigs_msg(const tal_t *ctx,
|
static u8 *psbt_to_tx_sigs_msg(const tal_t *ctx,
|
||||||
struct state *state,
|
struct state *state,
|
||||||
const struct wally_psbt *psbt)
|
const struct wally_psbt *psbt)
|
||||||
{
|
{
|
||||||
const struct witness_stack **ws =
|
const struct witness_stack **ws =
|
||||||
psbt_to_witness_stacks(tmpctx, psbt,
|
psbt_to_witness_stacks(tmpctx, psbt,
|
||||||
@@ -1674,7 +1674,8 @@ static void accepter_start(struct state *state, const u8 *oc2_msg)
|
|||||||
&state->feerate_per_kw_commitment)),
|
&state->feerate_per_kw_commitment)),
|
||||||
&state->localconf,
|
&state->localconf,
|
||||||
&state->remoteconf,
|
&state->remoteconf,
|
||||||
&state->our_points, &state->their_points,
|
&state->our_points,
|
||||||
|
&state->their_points,
|
||||||
&state->our_funding_pubkey,
|
&state->our_funding_pubkey,
|
||||||
&state->their_funding_pubkey,
|
&state->their_funding_pubkey,
|
||||||
true, true,
|
true, true,
|
||||||
@@ -1894,7 +1895,8 @@ static void opener_start(struct state *state, u8 *msg)
|
|||||||
sync_crypto_write(state->pps, take(msg));
|
sync_crypto_write(state->pps, take(msg));
|
||||||
|
|
||||||
/* This is usually a very transient state... */
|
/* 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. */
|
/* ... since their reply should be immediate. */
|
||||||
msg = opening_negotiate_msg(tmpctx, state, true);
|
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));
|
"Parsing accept_channel2 %s", tal_hex(msg, msg));
|
||||||
|
|
||||||
if (a_tlv->option_upfront_shutdown_script) {
|
if (a_tlv->option_upfront_shutdown_script) {
|
||||||
state->upfront_shutdown_script[REMOTE] = tal_steal(state,
|
state->upfront_shutdown_script[REMOTE]
|
||||||
a_tlv->option_upfront_shutdown_script->shutdown_scriptpubkey);
|
= tal_steal(state,
|
||||||
|
a_tlv->option_upfront_shutdown_script
|
||||||
|
->shutdown_scriptpubkey);
|
||||||
} else
|
} else
|
||||||
state->upfront_shutdown_script[REMOTE] = NULL;
|
state->upfront_shutdown_script[REMOTE] = NULL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user