Browse Source

df: rename the dual_open wires to match other daemon wires

fix-mocks
niftynei 4 years ago
committed by Rusty Russell
parent
commit
9f74dd9fb3
  1. 58
      lightningd/dual_open_control.c
  2. 4
      lightningd/opening_common.c
  3. 58
      openingd/dualopend.c
  4. 170
      openingd/dualopend_wire.csv
  5. 156
      openingd/dualopend_wiregen.c
  6. 90
      openingd/dualopend_wiregen.h

58
lightningd/dual_open_control.c

@ -183,7 +183,7 @@ static const u8 *hook_extract_shutdown_script(struct subd* dualopend,
if (!json_tok_streq(buffer, t, "continue")) { if (!json_tok_streq(buffer, t, "continue")) {
char *errmsg = "Client error. Unable to continue"; char *errmsg = "Client error. Unable to continue";
subd_send_msg(dualopend, subd_send_msg(dualopend,
take(towire_dual_open_fail(NULL, errmsg))); take(towire_dualopend_fail(NULL, errmsg)));
return NULL; return NULL;
} }
@ -234,7 +234,7 @@ hook_extract_psbt(const tal_t *ctx, struct subd *dualopend, const char *buffer,
if (dualopend) { if (dualopend) {
char *errmsg = "Client error. Unable to continue"; char *errmsg = "Client error. Unable to continue";
subd_send_msg(dualopend, subd_send_msg(dualopend,
take(towire_dual_open_fail(NULL, errmsg))); take(towire_dualopend_fail(NULL, errmsg)));
} }
return false; return false;
} }
@ -285,7 +285,7 @@ hook_extract_amount(struct subd *dualopend,
if (!json_tok_streq(buffer, t, "continue")) { if (!json_tok_streq(buffer, t, "continue")) {
char *errmsg = "Client error. Unable to continue"; char *errmsg = "Client error. Unable to continue";
subd_send_msg(dualopend, subd_send_msg(dualopend,
take(towire_dual_open_fail(NULL, errmsg))); take(towire_dualopend_fail(NULL, errmsg)));
return false; return false;
} }
@ -440,7 +440,7 @@ openchannel2_hook_cb(struct openchannel2_payload *payload STEALS)
/* If there's no plugin, the psbt will be NULL. We should pass an empty /* If there's no plugin, the psbt will be NULL. We should pass an empty
* PSBT over, in this case */ * PSBT over, in this case */
msg = towire_dual_open_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,
payload->our_shutdown_scriptpubkey); payload->our_shutdown_scriptpubkey);
@ -498,7 +498,7 @@ openchannel2_changed_hook_cb(struct openchannel2_psbt_payload *payload STEALS)
payload); payload);
subd_send_msg(dualopend, subd_send_msg(dualopend,
take(towire_dual_open_psbt_updated(NULL, take(towire_dualopend_psbt_updated(NULL,
payload->psbt))); payload->psbt)));
} }
@ -685,7 +685,7 @@ static void opener_psbt_changed(struct subd *dualopend,
struct json_stream *response; struct json_stream *response;
struct command *cmd = uc->fc->cmd; struct command *cmd = uc->fc->cmd;
if (!fromwire_dual_open_psbt_changed(cmd, msg, if (!fromwire_dualopend_psbt_changed(cmd, msg,
&cid, &funding_serial, &cid, &funding_serial,
&psbt)) { &psbt)) {
log_broken(dualopend->log, log_broken(dualopend->log,
@ -736,7 +736,7 @@ static void accepter_commit_received(struct subd *dualopend,
/* This is a new channel_info.their_config so set its ID to 0 */ /* This is a new channel_info.their_config so set its ID to 0 */
channel_info.their_config.id = 0; channel_info.their_config.id = 0;
if (!fromwire_dual_open_commit_rcvd(tmpctx, msg, if (!fromwire_dualopend_commit_rcvd(tmpctx, msg,
&channel_info.their_config, &channel_info.their_config,
&remote_commit, &remote_commit,
&pbase, &pbase,
@ -760,9 +760,9 @@ static void accepter_commit_received(struct subd *dualopend,
&uc->our_config.channel_reserve, &uc->our_config.channel_reserve,
&local_upfront_shutdown_script, &local_upfront_shutdown_script,
&remote_upfront_shutdown_script)) { &remote_upfront_shutdown_script)) {
log_broken(uc->log, "bad WIRE_DUAL_OPEN_COMMIT_RCVD %s", log_broken(uc->log, "bad WIRE_DUALOPEND_COMMIT_RCVD %s",
tal_hex(msg, msg)); tal_hex(msg, msg));
uncommitted_channel_disconnect(uc, LOG_BROKEN, "bad WIRE_DUAL_OPEN_COMMIT_RCVD"); uncommitted_channel_disconnect(uc, LOG_BROKEN, "bad WIRE_DUALOPEND_COMMIT_RCVD");
close(fds[0]); close(fds[0]);
close(fds[1]); close(fds[1]);
close(fds[3]); close(fds[3]);
@ -853,7 +853,7 @@ static void opener_commit_received(struct subd *dualopend,
/* This is a new channel_info.their_config so set its ID to 0 */ /* This is a new channel_info.their_config so set its ID to 0 */
channel_info.their_config.id = 0; channel_info.their_config.id = 0;
if (!fromwire_dual_open_commit_rcvd(tmpctx, msg, if (!fromwire_dualopend_commit_rcvd(tmpctx, msg,
&channel_info.their_config, &channel_info.their_config,
&remote_commit, &remote_commit,
&pbase, &pbase,
@ -877,9 +877,9 @@ static void opener_commit_received(struct subd *dualopend,
&uc->our_config.channel_reserve, &uc->our_config.channel_reserve,
&local_upfront_shutdown_script, &local_upfront_shutdown_script,
&remote_upfront_shutdown_script)) { &remote_upfront_shutdown_script)) {
log_broken(uc->log, "bad WIRE_DUAL_OPEN_COMMIT_RCVD %s", log_broken(uc->log, "bad WIRE_DUALOPEND_COMMIT_RCVD %s",
tal_hex(msg, msg)); tal_hex(msg, msg));
err_reason = "bad WIRE_DUAL_OPEN_COMMIT_RCVD"; err_reason = "bad WIRE_DUALOPEND_COMMIT_RCVD";
uncommitted_channel_disconnect(uc, LOG_BROKEN, err_reason); uncommitted_channel_disconnect(uc, LOG_BROKEN, err_reason);
close(fds[0]); close(fds[0]);
close(fds[1]); close(fds[1]);
@ -965,7 +965,7 @@ static void accepter_psbt_changed(struct subd *dualopend,
payload->psbt = NULL; payload->psbt = NULL;
payload->rcvd = tal(payload, struct commit_rcvd); payload->rcvd = tal(payload, struct commit_rcvd);
if (!fromwire_dual_open_psbt_changed(payload, msg, if (!fromwire_dualopend_psbt_changed(payload, msg,
&payload->rcvd->cid, &payload->rcvd->cid,
&unused, &unused,
&payload->psbt)) { &payload->psbt)) {
@ -987,7 +987,7 @@ static void accepter_got_offer(struct subd *dualopend,
if (peer_active_channel(uc->peer)) { if (peer_active_channel(uc->peer)) {
subd_send_msg(dualopend, subd_send_msg(dualopend,
take(towire_dual_open_fail(NULL, "Already have active channel"))); take(towire_dualopend_fail(NULL, "Already have active channel")));
return; return;
} }
@ -998,7 +998,7 @@ static void accepter_got_offer(struct subd *dualopend,
payload->our_shutdown_scriptpubkey = NULL; payload->our_shutdown_scriptpubkey = NULL;
payload->peer_id = uc->peer->id; payload->peer_id = uc->peer->id;
if (!fromwire_dual_open_got_offer(payload, msg, if (!fromwire_dualopend_got_offer(payload, msg,
&payload->their_funding, &payload->their_funding,
&payload->dust_limit_satoshis, &payload->dust_limit_satoshis,
&payload->max_htlc_value_in_flight_msat, &payload->max_htlc_value_in_flight_msat,
@ -1081,7 +1081,7 @@ static struct command_result *json_open_channel_update(struct command *cmd,
uc->fc->cmd = cmd; uc->fc->cmd = cmd;
msg = towire_dual_open_psbt_updated(NULL, psbt); msg = towire_dualopend_psbt_updated(NULL, psbt);
subd_send_msg(uc->open_daemon, take(msg)); subd_send_msg(uc->open_daemon, take(msg));
return command_still_pending(cmd); return command_still_pending(cmd);
} }
@ -1224,7 +1224,7 @@ static struct command_result *json_open_channel_init(struct command *cmd,
fc->our_upfront_shutdown_script fc->our_upfront_shutdown_script
= tal_steal(fc, fc->our_upfront_shutdown_script); = tal_steal(fc, fc->our_upfront_shutdown_script);
msg = towire_dual_open_opener_init(NULL, msg = towire_dualopend_opener_init(NULL,
psbt, *amount, psbt, *amount,
fc->our_upfront_shutdown_script, fc->our_upfront_shutdown_script,
*feerate_per_kw, *feerate_per_kw,
@ -1242,10 +1242,10 @@ static unsigned int dual_opend_msg(struct subd *dualopend,
struct uncommitted_channel *uc = dualopend->channel; struct uncommitted_channel *uc = dualopend->channel;
switch (t) { switch (t) {
case WIRE_DUAL_OPEN_GOT_OFFER: case WIRE_DUALOPEND_GOT_OFFER:
accepter_got_offer(dualopend, uc, msg); accepter_got_offer(dualopend, uc, msg);
return 0; return 0;
case WIRE_DUAL_OPEN_PSBT_CHANGED: case WIRE_DUALOPEND_PSBT_CHANGED:
if (uc->fc) { if (uc->fc) {
if (!uc->fc->cmd) { if (!uc->fc->cmd) {
log_unusual(dualopend->log, log_unusual(dualopend->log,
@ -1258,7 +1258,7 @@ static unsigned int dual_opend_msg(struct subd *dualopend,
} else } else
accepter_psbt_changed(dualopend, msg); accepter_psbt_changed(dualopend, msg);
return 0; return 0;
case WIRE_DUAL_OPEN_COMMIT_RCVD: case WIRE_DUALOPEND_COMMIT_RCVD:
if (tal_count(fds) != 3) if (tal_count(fds) != 3)
return 3; return 3;
if (uc->fc) { if (uc->fc) {
@ -1275,16 +1275,16 @@ static unsigned int dual_opend_msg(struct subd *dualopend,
accepter_commit_received(dualopend, accepter_commit_received(dualopend,
uc, fds, msg); uc, fds, msg);
return 0; return 0;
case WIRE_DUAL_OPEN_FAILED: case WIRE_DUALOPEND_FAILED:
case WIRE_DUAL_OPEN_DEV_MEMLEAK_REPLY: case WIRE_DUALOPEND_DEV_MEMLEAK_REPLY:
/* Messages we send */ /* Messages we send */
case WIRE_DUAL_OPEN_INIT: case WIRE_DUALOPEND_INIT:
case WIRE_DUAL_OPEN_OPENER_INIT: case WIRE_DUALOPEND_OPENER_INIT:
case WIRE_DUAL_OPEN_GOT_OFFER_REPLY: case WIRE_DUALOPEND_GOT_OFFER_REPLY:
case WIRE_DUAL_OPEN_FAIL: case WIRE_DUALOPEND_FAIL:
case WIRE_DUAL_OPEN_PSBT_UPDATED: case WIRE_DUALOPEND_PSBT_UPDATED:
case WIRE_DUAL_OPEN_DEV_MEMLEAK: case WIRE_DUALOPEND_DEV_MEMLEAK:
break; break;
} }
@ -1380,7 +1380,7 @@ void peer_start_dualopend(struct peer *peer,
*/ */
uc->minimum_depth = peer->ld->config.anchor_confirms; uc->minimum_depth = peer->ld->config.anchor_confirms;
msg = towire_dual_open_init(NULL, msg = towire_dualopend_init(NULL,
chainparams, chainparams,
peer->ld->our_features, peer->ld->our_features,
peer->their_features, peer->their_features,

4
lightningd/opening_common.c

@ -173,7 +173,7 @@ static void opening_memleak_req_done(struct subd *open_daemon,
tal_del_destructor2(open_daemon, opening_died_forget_memleak, cmd); tal_del_destructor2(open_daemon, opening_died_forget_memleak, cmd);
if (!fromwire_openingd_dev_memleak_reply(msg, &found_leak) && if (!fromwire_openingd_dev_memleak_reply(msg, &found_leak) &&
!fromwire_dual_open_dev_memleak_reply(msg, !fromwire_dualopend_dev_memleak_reply(msg,
&found_leak)) { &found_leak)) {
was_pending(command_fail(cmd, LIGHTNINGD, was_pending(command_fail(cmd, LIGHTNINGD,
"Bad opening_dev_memleak")); "Bad opening_dev_memleak"));
@ -210,7 +210,7 @@ static void opening_memleak_req_next(struct command *cmd, struct peer *prev)
continue; continue;
if (streq(open_daemon->name, "dualopend")) if (streq(open_daemon->name, "dualopend"))
msg = towire_dual_open_dev_memleak(NULL); msg = towire_dualopend_dev_memleak(NULL);
else else
msg = towire_openingd_dev_memleak(NULL); msg = towire_openingd_dev_memleak(NULL);

58
openingd/dualopend.c

@ -250,7 +250,7 @@ static void negotiation_aborted(struct state *state, bool am_opener,
/* If necessary, tell master that funding failed. */ /* If necessary, tell master that funding failed. */
if (am_opener) { if (am_opener) {
u8 *msg = towire_dual_open_failed(NULL, why); u8 *msg = towire_dualopend_failed(NULL, why);
wire_sync_write(REQ_FD, take(msg)); wire_sync_write(REQ_FD, take(msg));
} }
@ -635,7 +635,7 @@ static void handle_dev_memleak(struct state *state, const u8 *msg)
/* If there's anything left, dump it to logs, and return true. */ /* If there's anything left, dump it to logs, and return true. */
found_leak = dump_memleak(memtable); found_leak = dump_memleak(memtable);
wire_sync_write(REQ_FD, wire_sync_write(REQ_FD,
take(towire_dual_open_dev_memleak_reply(NULL, take(towire_dualopend_dev_memleak_reply(NULL,
found_leak))); found_leak)));
} }
@ -657,19 +657,19 @@ fetch_psbt_changes(struct state *state, const struct wally_psbt *psbt)
struct wally_psbt *updated_psbt; struct wally_psbt *updated_psbt;
/* Go ask lightningd what other changes we've got */ /* Go ask lightningd what other changes we've got */
msg = towire_dual_open_psbt_changed(NULL, &state->channel_id, msg = towire_dualopend_psbt_changed(NULL, &state->channel_id,
state->funding_serial, state->funding_serial,
psbt); psbt);
wire_sync_write(REQ_FD, take(msg)); wire_sync_write(REQ_FD, take(msg));
msg = wire_sync_read(tmpctx, REQ_FD); msg = wire_sync_read(tmpctx, REQ_FD);
if (fromwire_dual_open_fail(msg, msg, &err)) if (fromwire_dualopend_fail(msg, msg, &err))
status_failed(STATUS_FAIL_MASTER_IO, "%s", err); status_failed(STATUS_FAIL_MASTER_IO, "%s", err);
else if (fromwire_dual_open_psbt_updated(state, msg, &updated_psbt)) { else if (fromwire_dualopend_psbt_updated(state, msg, &updated_psbt)) {
return updated_psbt; return updated_psbt;
#if DEVELOPER #if DEVELOPER
} else if (fromwire_dual_open_dev_memleak(msg)) { } else if (fromwire_dualopend_dev_memleak(msg)) {
handle_dev_memleak(state, msg); handle_dev_memleak(state, msg);
#endif /* DEVELOPER */ #endif /* DEVELOPER */
} else } else
@ -795,7 +795,7 @@ static u8 *opening_negotiate_msg(const tal_t *ctx, struct state *state,
/* Close connection on all_channels error. */ /* Close connection on all_channels error. */
if (all_channels) { if (all_channels) {
if (am_opener) { if (am_opener) {
msg = towire_dual_open_failed(NULL, err); msg = towire_dualopend_failed(NULL, err);
wire_sync_write(REQ_FD, take(msg)); wire_sync_write(REQ_FD, take(msg));
} }
peer_failed_received_errmsg(state->pps, err, peer_failed_received_errmsg(state->pps, err,
@ -1268,7 +1268,7 @@ static u8 *accepter_start(struct state *state, const u8 *oc2_msg)
&state->their_points.revocation); &state->their_points.revocation);
/* FIXME: pass the podle back also */ /* FIXME: pass the podle back also */
msg = towire_dual_open_got_offer(NULL, msg = towire_dualopend_got_offer(NULL,
state->opener_funding, state->opener_funding,
state->remoteconf.dust_limit, state->remoteconf.dust_limit,
state->remoteconf.max_htlc_value_in_flight, state->remoteconf.max_htlc_value_in_flight,
@ -1286,8 +1286,8 @@ static u8 *accepter_start(struct state *state, const u8 *oc2_msg)
wire_sync_write(REQ_FD, take(msg)); wire_sync_write(REQ_FD, take(msg));
msg = wire_sync_read(tmpctx, REQ_FD); msg = wire_sync_read(tmpctx, REQ_FD);
if ((msg_type = fromwire_peektype(msg)) == WIRE_DUAL_OPEN_FAIL) { if ((msg_type = fromwire_peektype(msg)) == WIRE_DUALOPEND_FAIL) {
if (!fromwire_dual_open_fail(msg, msg, &err_reason)) if (!fromwire_dualopend_fail(msg, msg, &err_reason))
master_badmsg(msg_type, msg); master_badmsg(msg_type, msg);
u8 *errmsg = towire_errorfmt(tmpctx, &state->channel_id, u8 *errmsg = towire_errorfmt(tmpctx, &state->channel_id,
@ -1295,12 +1295,12 @@ static u8 *accepter_start(struct state *state, const u8 *oc2_msg)
sync_crypto_write(state->pps, take(errmsg)); sync_crypto_write(state->pps, take(errmsg));
return NULL; return NULL;
} }
if (!fromwire_dual_open_got_offer_reply(state, msg, if (!fromwire_dualopend_got_offer_reply(state, msg,
&state->accepter_funding, &state->accepter_funding,
&state->feerate_per_kw_funding, &state->feerate_per_kw_funding,
&psbt, &psbt,
&state->upfront_shutdown_script[LOCAL])) &state->upfront_shutdown_script[LOCAL]))
master_badmsg(WIRE_DUAL_OPEN_GOT_OFFER_REPLY, msg); master_badmsg(WIRE_DUALOPEND_GOT_OFFER_REPLY, msg);
if (!psbt) if (!psbt)
psbt = create_psbt(state, 0, 0, state->tx_locktime); psbt = create_psbt(state, 0, 0, state->tx_locktime);
@ -1547,7 +1547,7 @@ static u8 *accepter_start(struct state *state, const u8 *oc2_msg)
/* Send the commitment_signed controller; will save to db /* Send the commitment_signed controller; will save to db
* and pass messages along to channeld to send along! */ * and pass messages along to channeld to send along! */
return towire_dual_open_commit_rcvd(state, return towire_dualopend_commit_rcvd(state,
&state->remoteconf, &state->remoteconf,
remote_commit, remote_commit,
pbase, pbase,
@ -1594,14 +1594,14 @@ static u8 *opener_start(struct state *state, u8 *msg)
secp256k1_ecdsa_signature *htlc_sigs; secp256k1_ecdsa_signature *htlc_sigs;
u32 feerate_min, feerate_max, feerate_best; u32 feerate_min, feerate_max, feerate_best;
if (!fromwire_dual_open_opener_init(state, msg, if (!fromwire_dualopend_opener_init(state, msg,
&psbt, &psbt,
&state->opener_funding, &state->opener_funding,
&state->upfront_shutdown_script[LOCAL], &state->upfront_shutdown_script[LOCAL],
&state->feerate_per_kw_commitment, &state->feerate_per_kw_commitment,
&state->feerate_per_kw_funding, &state->feerate_per_kw_funding,
&channel_flags)) &channel_flags))
master_badmsg(WIRE_DUAL_OPEN_OPENER_INIT, msg); master_badmsg(WIRE_DUALOPEND_OPENER_INIT, msg);
state->our_role = TX_INITIATOR; state->our_role = TX_INITIATOR;
state->tx_locktime = psbt->tx->locktime; state->tx_locktime = psbt->tx->locktime;
@ -1972,7 +1972,7 @@ static u8 *opener_start(struct state *state, u8 *msg)
peer_billboard(false, "channel open: commitment received, " peer_billboard(false, "channel open: commitment received, "
"sending to lightningd to save"); "sending to lightningd to save");
return towire_dual_open_commit_rcvd(state, return towire_dualopend_commit_rcvd(state,
&state->remoteconf, &state->remoteconf,
remote_commit, remote_commit,
pbase, pbase,
@ -2046,23 +2046,23 @@ static u8 *handle_master_in(struct state *state)
enum dualopend_wire t = fromwire_peektype(msg); enum dualopend_wire t = fromwire_peektype(msg);
switch (t) { switch (t) {
case WIRE_DUAL_OPEN_DEV_MEMLEAK: case WIRE_DUALOPEND_DEV_MEMLEAK:
#if DEVELOPER #if DEVELOPER
handle_dev_memleak(state, msg); handle_dev_memleak(state, msg);
#endif #endif
return NULL; return NULL;
case WIRE_DUAL_OPEN_OPENER_INIT: case WIRE_DUALOPEND_OPENER_INIT:
return opener_start(state, msg); return opener_start(state, msg);
/* mostly handled inline */ /* mostly handled inline */
case WIRE_DUAL_OPEN_INIT: case WIRE_DUALOPEND_INIT:
case WIRE_DUAL_OPEN_DEV_MEMLEAK_REPLY: case WIRE_DUALOPEND_DEV_MEMLEAK_REPLY:
case WIRE_DUAL_OPEN_FAILED: case WIRE_DUALOPEND_FAILED:
case WIRE_DUAL_OPEN_FAIL: case WIRE_DUALOPEND_FAIL:
case WIRE_DUAL_OPEN_GOT_OFFER: case WIRE_DUALOPEND_GOT_OFFER:
case WIRE_DUAL_OPEN_GOT_OFFER_REPLY: case WIRE_DUALOPEND_GOT_OFFER_REPLY:
case WIRE_DUAL_OPEN_COMMIT_RCVD: case WIRE_DUALOPEND_COMMIT_RCVD:
case WIRE_DUAL_OPEN_PSBT_CHANGED: case WIRE_DUALOPEND_PSBT_CHANGED:
case WIRE_DUAL_OPEN_PSBT_UPDATED: case WIRE_DUALOPEND_PSBT_UPDATED:
break; break;
} }
@ -2148,7 +2148,7 @@ int main(int argc, char *argv[])
/*~ The very first thing we read from lightningd is our init msg */ /*~ The very first thing we read from lightningd is our init msg */
msg = wire_sync_read(tmpctx, REQ_FD); msg = wire_sync_read(tmpctx, REQ_FD);
if (!fromwire_dual_open_init(state, msg, if (!fromwire_dualopend_init(state, msg,
&chainparams, &chainparams,
&state->our_features, &state->our_features,
&state->their_features, &state->their_features,
@ -2161,7 +2161,7 @@ int main(int argc, char *argv[])
&state->minimum_depth, &state->minimum_depth,
&state->min_feerate, &state->max_feerate, &state->min_feerate, &state->max_feerate,
&inner)) &inner))
master_badmsg(WIRE_DUAL_OPEN_INIT, msg); master_badmsg(WIRE_DUALOPEND_INIT, msg);
/* 3 == peer, 4 == gossipd, 5 = gossip_store, 6 = hsmd */ /* 3 == peer, 4 == gossipd, 5 = gossip_store, 6 = hsmd */
per_peer_state_set_fds(state->pps, 3, 4, 5); per_peer_state_set_fds(state->pps, 3, 4, 5);

170
openingd/dualopend_wire.csv

@ -8,114 +8,114 @@
#include <common/penalty_base.h> #include <common/penalty_base.h>
#include <common/per_peer_state.h> #include <common/per_peer_state.h>
msgtype,dual_open_init,7000 msgtype,dualopend_init,7000
# Which network are we configured for? # Which network are we configured for?
msgdata,dual_open_init,chainparams,chainparams, msgdata,dualopend_init,chainparams,chainparams,
msgdata,dual_open_init,our_feature_set,feature_set, msgdata,dualopend_init,our_feature_set,feature_set,
msgdata,dual_open_init,their_init_features_len,u16, msgdata,dualopend_init,their_init_features_len,u16,
msgdata,dual_open_init,their_init_features,u8,their_init_features_len msgdata,dualopend_init,their_init_features,u8,their_init_features_len
# Base configuration we'll offer # Base configuration we'll offer
msgdata,dual_open_init,our_config,channel_config, msgdata,dualopend_init,our_config,channel_config,
# Minimum/maximum configuration values we'll accept # Minimum/maximum configuration values we'll accept
msgdata,dual_open_init,max_to_self_delay,u32, msgdata,dualopend_init,max_to_self_delay,u32,
msgdata,dual_open_init,min_effective_htlc_capacity_msat,amount_msat, msgdata,dualopend_init,min_effective_htlc_capacity_msat,amount_msat,
msgdata,dual_open_init,pps,per_peer_state, msgdata,dualopend_init,pps,per_peer_state,
msgdata,dual_open_init,our_basepoints,basepoints, msgdata,dualopend_init,our_basepoints,basepoints,
msgdata,dual_open_init,our_funding_pubkey,pubkey, msgdata,dualopend_init,our_funding_pubkey,pubkey,
# Constraints in case the other end tries to open a channel. # Constraints in case the other end tries to open a channel.
msgdata,dual_open_init,minimum_depth,u32, msgdata,dualopend_init,minimum_depth,u32,
msgdata,dual_open_init,min_feerate,u32, msgdata,dualopend_init,min_feerate,u32,
msgdata,dual_open_init,max_feerate,u32, msgdata,dualopend_init,max_feerate,u32,
# Optional msg to send. # Optional msg to send.
msgdata,dual_open_init,len,u16, msgdata,dualopend_init,len,u16,
msgdata,dual_open_init,msg,u8,len msgdata,dualopend_init,msg,u8,len
# dualopend->master: they offered channel, should we continue? # dualopend->master: they offered channel, should we continue?
msgtype,dual_open_got_offer,7005 msgtype,dualopend_got_offer,7005
msgdata,dual_open_got_offer,opener_funding,amount_sat, msgdata,dualopend_got_offer,opener_funding,amount_sat,
msgdata,dual_open_got_offer,dust_limit_satoshis,amount_sat, msgdata,dualopend_got_offer,dust_limit_satoshis,amount_sat,
msgdata,dual_open_got_offer,max_htlc_value_in_flight_msat,amount_msat, msgdata,dualopend_got_offer,max_htlc_value_in_flight_msat,amount_msat,
msgdata,dual_open_got_offer,htlc_minimum_msat,amount_msat, msgdata,dualopend_got_offer,htlc_minimum_msat,amount_msat,
msgdata,dual_open_got_offer,feerate_funding_max,u32, msgdata,dualopend_got_offer,feerate_funding_max,u32,
msgdata,dual_open_got_offer,feerate_funding_min,u32, msgdata,dualopend_got_offer,feerate_funding_min,u32,
msgdata,dual_open_got_offer,feerate_funding_best,u32, msgdata,dualopend_got_offer,feerate_funding_best,u32,
msgdata,dual_open_got_offer,feerate_per_kw,u32, msgdata,dualopend_got_offer,feerate_per_kw,u32,
msgdata,dual_open_got_offer,to_self_delay,u16, msgdata,dualopend_got_offer,to_self_delay,u16,
msgdata,dual_open_got_offer,max_accepted_htlcs,u16, msgdata,dualopend_got_offer,max_accepted_htlcs,u16,
msgdata,dual_open_got_offer,channel_flags,u8, msgdata,dualopend_got_offer,channel_flags,u8,
msgdata,dual_open_got_offer,locktime,u32, msgdata,dualopend_got_offer,locktime,u32,
msgdata,dual_open_got_offer,shutdown_len,u16, msgdata,dualopend_got_offer,shutdown_len,u16,
msgdata,dual_open_got_offer,shutdown_scriptpubkey,u8,shutdown_len msgdata,dualopend_got_offer,shutdown_scriptpubkey,u8,shutdown_len
# master->dualopend: reply back with our first funding info/contribs # master->dualopend: reply back with our first funding info/contribs
msgtype,dual_open_got_offer_reply,7105 msgtype,dualopend_got_offer_reply,7105
msgdata,dual_open_got_offer_reply,accepter_funding,amount_sat, msgdata,dualopend_got_offer_reply,accepter_funding,amount_sat,
msgdata,dual_open_got_offer_reply,feerate_funding,u32, msgdata,dualopend_got_offer_reply,feerate_funding,u32,
msgdata,dual_open_got_offer_reply,psbt,wally_psbt, msgdata,dualopend_got_offer_reply,psbt,wally_psbt,
msgdata,dual_open_got_offer_reply,shutdown_len,u16, msgdata,dualopend_got_offer_reply,shutdown_len,u16,
msgdata,dual_open_got_offer_reply,our_shutdown_scriptpubkey,?u8,shutdown_len msgdata,dualopend_got_offer_reply,our_shutdown_scriptpubkey,?u8,shutdown_len
# dualopend->master: ready to commit channel open to database and # dualopend->master: ready to commit channel open to database and
# get some signatures for the funding_tx. # get some signatures for the funding_tx.
msgtype,dual_open_commit_rcvd,7007 msgtype,dualopend_commit_rcvd,7007
msgdata,dual_open_commit_rcvd,their_config,channel_config, msgdata,dualopend_commit_rcvd,their_config,channel_config,
msgdata,dual_open_commit_rcvd,remote_first_commit,bitcoin_tx, msgdata,dualopend_commit_rcvd,remote_first_commit,bitcoin_tx,
msgdata,dual_open_commit_rcvd,pbase,?penalty_base, msgdata,dualopend_commit_rcvd,pbase,?penalty_base,
msgdata,dual_open_commit_rcvd,first_commit_sig,bitcoin_signature, msgdata,dualopend_commit_rcvd,first_commit_sig,bitcoin_signature,
msgdata,dual_open_commit_rcvd,psbt,wally_psbt, msgdata,dualopend_commit_rcvd,psbt,wally_psbt,
msgdata,dual_open_commit_rcvd,channel_id,channel_id, msgdata,dualopend_commit_rcvd,channel_id,channel_id,
msgdata,dual_open_commit_rcvd,pps,per_peer_state, msgdata,dualopend_commit_rcvd,pps,per_peer_state,
msgdata,dual_open_commit_rcvd,revocation_basepoint,pubkey, msgdata,dualopend_commit_rcvd,revocation_basepoint,pubkey,
msgdata,dual_open_commit_rcvd,payment_basepoint,pubkey, msgdata,dualopend_commit_rcvd,payment_basepoint,pubkey,
msgdata,dual_open_commit_rcvd,htlc_basepoint,pubkey, msgdata,dualopend_commit_rcvd,htlc_basepoint,pubkey,
msgdata,dual_open_commit_rcvd,delayed_payment_basepoint,pubkey, msgdata,dualopend_commit_rcvd,delayed_payment_basepoint,pubkey,
msgdata,dual_open_commit_rcvd,their_per_commit_point,pubkey, msgdata,dualopend_commit_rcvd,their_per_commit_point,pubkey,
msgdata,dual_open_commit_rcvd,remote_fundingkey,pubkey, msgdata,dualopend_commit_rcvd,remote_fundingkey,pubkey,
msgdata,dual_open_commit_rcvd,funding_txid,bitcoin_txid, msgdata,dualopend_commit_rcvd,funding_txid,bitcoin_txid,
msgdata,dual_open_commit_rcvd,funding_txout,u16, msgdata,dualopend_commit_rcvd,funding_txout,u16,
msgdata,dual_open_commit_rcvd,funding_satoshis,amount_sat, msgdata,dualopend_commit_rcvd,funding_satoshis,amount_sat,
msgdata,dual_open_commit_rcvd,our_funding_sats,amount_sat, msgdata,dualopend_commit_rcvd,our_funding_sats,amount_sat,
msgdata,dual_open_commit_rcvd,channel_flags,u8, msgdata,dualopend_commit_rcvd,channel_flags,u8,
msgdata,dual_open_commit_rcvd,feerate_per_kw,u32, msgdata,dualopend_commit_rcvd,feerate_per_kw,u32,
# our commitment signatures, for the peer # our commitment signatures, for the peer
msgdata,dual_open_commit_rcvd,msglen,u16, msgdata,dualopend_commit_rcvd,msglen,u16,
msgdata,dual_open_commit_rcvd,commitment_msg,u8,msglen msgdata,dualopend_commit_rcvd,commitment_msg,u8,msglen
msgdata,dual_open_commit_rcvd,our_channel_reserve_satoshis,amount_sat, msgdata,dualopend_commit_rcvd,our_channel_reserve_satoshis,amount_sat,
msgdata,dual_open_commit_rcvd,local_shutdown_len,u16, msgdata,dualopend_commit_rcvd,local_shutdown_len,u16,
msgdata,dual_open_commit_rcvd,local_shutdown_scriptpubkey,u8,local_shutdown_len msgdata,dualopend_commit_rcvd,local_shutdown_scriptpubkey,u8,local_shutdown_len
msgdata,dual_open_commit_rcvd,remote_shutdown_len,u16, msgdata,dualopend_commit_rcvd,remote_shutdown_len,u16,
msgdata,dual_open_commit_rcvd,remote_shutdown_scriptpubkey,u8,remote_shutdown_len msgdata,dualopend_commit_rcvd,remote_shutdown_scriptpubkey,u8,remote_shutdown_len
# dualopend->master: peer updated the psbt # dualopend->master: peer updated the psbt
msgtype,dual_open_psbt_changed,7107 msgtype,dualopend_psbt_changed,7107
msgdata,dual_open_psbt_changed,channel_id,channel_id, msgdata,dualopend_psbt_changed,channel_id,channel_id,
msgdata,dual_open_psbt_changed,funding_serial,u64, msgdata,dualopend_psbt_changed,funding_serial,u64,
msgdata,dual_open_psbt_changed,psbt,wally_psbt, msgdata,dualopend_psbt_changed,psbt,wally_psbt,
# master->dualopend: we updated the psbt # master->dualopend: we updated the psbt
msgtype,dual_open_psbt_updated,7108 msgtype,dualopend_psbt_updated,7108
msgdata,dual_open_psbt_updated,psbt,wally_psbt, msgdata,dualopend_psbt_updated,psbt,wally_psbt,
# master->dualopend: fail this channel open # master->dualopend: fail this channel open
msgtype,dual_open_fail,7003 msgtype,dualopend_fail,7003
msgdata,dual_open_fail,reason,wirestring, msgdata,dualopend_fail,reason,wirestring,
# dualopend->master: we failed to negotiate channel # dualopend->master: we failed to negotiate channel
msgtype,dual_open_failed,7004 msgtype,dualopend_failed,7004
msgdata,dual_open_failed,reason,wirestring, msgdata,dualopend_failed,reason,wirestring,
# master->dualopend: hello, I'd like to start a channel open # master->dualopend: hello, I'd like to start a channel open
msgtype,dual_open_opener_init,7200 msgtype,dualopend_opener_init,7200
msgdata,dual_open_opener_init,psbt,wally_psbt, msgdata,dualopend_opener_init,psbt,wally_psbt,
msgdata,dual_open_opener_init,funding_amount,amount_sat, msgdata,dualopend_opener_init,funding_amount,amount_sat,
msgdata,dual_open_opener_init,local_shutdown_len,u16, msgdata,dualopend_opener_init,local_shutdown_len,u16,
msgdata,dual_open_opener_init,local_shutdown_scriptpubkey,u8,local_shutdown_len msgdata,dualopend_opener_init,local_shutdown_scriptpubkey,u8,local_shutdown_len
msgdata,dual_open_opener_init,feerate_per_kw,u32, msgdata,dualopend_opener_init,feerate_per_kw,u32,
msgdata,dual_open_opener_init,feerate_per_kw_funding,u32, msgdata,dualopend_opener_init,feerate_per_kw_funding,u32,
msgdata,dual_open_opener_init,channel_flags,u8, msgdata,dualopend_opener_init,channel_flags,u8,
# master -> dualopend: do you have a memleak? # master -> dualopend: do you have a memleak?
msgtype,dual_open_dev_memleak,7033 msgtype,dualopend_dev_memleak,7033
msgtype,dual_open_dev_memleak_reply,7133 msgtype,dualopend_dev_memleak_reply,7133
msgdata,dual_open_dev_memleak_reply,leak,bool, msgdata,dualopend_dev_memleak_reply,leak,bool,

Can't render this file because it has a wrong number of fields in line 11.

156
openingd/dualopend_wiregen.c

@ -20,17 +20,17 @@ const char *dualopend_wire_name(int e)
static char invalidbuf[sizeof("INVALID ") + STR_MAX_CHARS(e)]; static char invalidbuf[sizeof("INVALID ") + STR_MAX_CHARS(e)];
switch ((enum dualopend_wire)e) { switch ((enum dualopend_wire)e) {
case WIRE_DUAL_OPEN_INIT: return "WIRE_DUAL_OPEN_INIT"; case WIRE_DUALOPEND_INIT: return "WIRE_DUALOPEND_INIT";
case WIRE_DUAL_OPEN_GOT_OFFER: return "WIRE_DUAL_OPEN_GOT_OFFER"; case WIRE_DUALOPEND_GOT_OFFER: return "WIRE_DUALOPEND_GOT_OFFER";
case WIRE_DUAL_OPEN_GOT_OFFER_REPLY: return "WIRE_DUAL_OPEN_GOT_OFFER_REPLY"; case WIRE_DUALOPEND_GOT_OFFER_REPLY: return "WIRE_DUALOPEND_GOT_OFFER_REPLY";
case WIRE_DUAL_OPEN_COMMIT_RCVD: return "WIRE_DUAL_OPEN_COMMIT_RCVD"; case WIRE_DUALOPEND_COMMIT_RCVD: return "WIRE_DUALOPEND_COMMIT_RCVD";
case WIRE_DUAL_OPEN_PSBT_CHANGED: return "WIRE_DUAL_OPEN_PSBT_CHANGED"; case WIRE_DUALOPEND_PSBT_CHANGED: return "WIRE_DUALOPEND_PSBT_CHANGED";
case WIRE_DUAL_OPEN_PSBT_UPDATED: return "WIRE_DUAL_OPEN_PSBT_UPDATED"; case WIRE_DUALOPEND_PSBT_UPDATED: return "WIRE_DUALOPEND_PSBT_UPDATED";
case WIRE_DUAL_OPEN_FAIL: return "WIRE_DUAL_OPEN_FAIL"; case WIRE_DUALOPEND_FAIL: return "WIRE_DUALOPEND_FAIL";
case WIRE_DUAL_OPEN_FAILED: return "WIRE_DUAL_OPEN_FAILED"; case WIRE_DUALOPEND_FAILED: return "WIRE_DUALOPEND_FAILED";
case WIRE_DUAL_OPEN_OPENER_INIT: return "WIRE_DUAL_OPEN_OPENER_INIT"; case WIRE_DUALOPEND_OPENER_INIT: return "WIRE_DUALOPEND_OPENER_INIT";
case WIRE_DUAL_OPEN_DEV_MEMLEAK: return "WIRE_DUAL_OPEN_DEV_MEMLEAK"; case WIRE_DUALOPEND_DEV_MEMLEAK: return "WIRE_DUALOPEND_DEV_MEMLEAK";
case WIRE_DUAL_OPEN_DEV_MEMLEAK_REPLY: return "WIRE_DUAL_OPEN_DEV_MEMLEAK_REPLY"; case WIRE_DUALOPEND_DEV_MEMLEAK_REPLY: return "WIRE_DUALOPEND_DEV_MEMLEAK_REPLY";
} }
snprintf(invalidbuf, sizeof(invalidbuf), "INVALID %i", e); snprintf(invalidbuf, sizeof(invalidbuf), "INVALID %i", e);
@ -40,17 +40,17 @@ const char *dualopend_wire_name(int e)
bool dualopend_wire_is_defined(u16 type) bool dualopend_wire_is_defined(u16 type)
{ {
switch ((enum dualopend_wire)type) { switch ((enum dualopend_wire)type) {
case WIRE_DUAL_OPEN_INIT:; case WIRE_DUALOPEND_INIT:;
case WIRE_DUAL_OPEN_GOT_OFFER:; case WIRE_DUALOPEND_GOT_OFFER:;
case WIRE_DUAL_OPEN_GOT_OFFER_REPLY:; case WIRE_DUALOPEND_GOT_OFFER_REPLY:;
case WIRE_DUAL_OPEN_COMMIT_RCVD:; case WIRE_DUALOPEND_COMMIT_RCVD:;
case WIRE_DUAL_OPEN_PSBT_CHANGED:; case WIRE_DUALOPEND_PSBT_CHANGED:;
case WIRE_DUAL_OPEN_PSBT_UPDATED:; case WIRE_DUALOPEND_PSBT_UPDATED:;
case WIRE_DUAL_OPEN_FAIL:; case WIRE_DUALOPEND_FAIL:;
case WIRE_DUAL_OPEN_FAILED:; case WIRE_DUALOPEND_FAILED:;
case WIRE_DUAL_OPEN_OPENER_INIT:; case WIRE_DUALOPEND_OPENER_INIT:;
case WIRE_DUAL_OPEN_DEV_MEMLEAK:; case WIRE_DUALOPEND_DEV_MEMLEAK:;
case WIRE_DUAL_OPEN_DEV_MEMLEAK_REPLY:; case WIRE_DUALOPEND_DEV_MEMLEAK_REPLY:;
return true; return true;
} }
return false; return false;
@ -60,14 +60,14 @@ bool dualopend_wire_is_defined(u16 type)
/* WIRE: DUAL_OPEN_INIT */ /* WIRE: DUALOPEND_INIT */
u8 *towire_dual_open_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_feature_set, const u8 *their_init_features, const struct channel_config *our_config, u32 max_to_self_delay, struct amount_msat min_effective_htlc_capacity_msat, const struct per_peer_state *pps, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, u32 minimum_depth, u32 min_feerate, u32 max_feerate, const u8 *msg) u8 *towire_dualopend_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_feature_set, const u8 *their_init_features, const struct channel_config *our_config, u32 max_to_self_delay, struct amount_msat min_effective_htlc_capacity_msat, const struct per_peer_state *pps, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, u32 minimum_depth, u32 min_feerate, u32 max_feerate, const u8 *msg)
{ {
u16 their_init_features_len = tal_count(their_init_features); u16 their_init_features_len = tal_count(their_init_features);
u16 len = tal_count(msg); u16 len = tal_count(msg);
u8 *p = tal_arr(ctx, u8, 0); u8 *p = tal_arr(ctx, u8, 0);
towire_u16(&p, WIRE_DUAL_OPEN_INIT); towire_u16(&p, WIRE_DUALOPEND_INIT);
/* Which network are we configured for? */ /* Which network are we configured for? */
towire_chainparams(&p, chainparams); towire_chainparams(&p, chainparams);
towire_feature_set(&p, our_feature_set); towire_feature_set(&p, our_feature_set);
@ -91,7 +91,7 @@ u8 *towire_dual_open_init(const tal_t *ctx, const struct chainparams *chainparam
return memcheck(p, tal_count(p)); return memcheck(p, tal_count(p));
} }
bool fromwire_dual_open_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_feature_set, u8 **their_init_features, struct channel_config *our_config, u32 *max_to_self_delay, struct amount_msat *min_effective_htlc_capacity_msat, struct per_peer_state **pps, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, u32 *minimum_depth, u32 *min_feerate, u32 *max_feerate, u8 **msg) bool fromwire_dualopend_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_feature_set, u8 **their_init_features, struct channel_config *our_config, u32 *max_to_self_delay, struct amount_msat *min_effective_htlc_capacity_msat, struct per_peer_state **pps, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, u32 *minimum_depth, u32 *min_feerate, u32 *max_feerate, u8 **msg)
{ {
u16 their_init_features_len; u16 their_init_features_len;
u16 len; u16 len;
@ -99,7 +99,7 @@ bool fromwire_dual_open_init(const tal_t *ctx, const void *p, const struct chain
const u8 *cursor = p; const u8 *cursor = p;
size_t plen = tal_count(p); size_t plen = tal_count(p);
if (fromwire_u16(&cursor, &plen) != WIRE_DUAL_OPEN_INIT) if (fromwire_u16(&cursor, &plen) != WIRE_DUALOPEND_INIT)
return false; return false;
/* Which network are we configured for? */ /* Which network are we configured for? */
fromwire_chainparams(&cursor, &plen, chainparams); fromwire_chainparams(&cursor, &plen, chainparams);
@ -128,14 +128,14 @@ bool fromwire_dual_open_init(const tal_t *ctx, const void *p, const struct chain
return cursor != NULL; return cursor != NULL;
} }
/* WIRE: DUAL_OPEN_GOT_OFFER */ /* WIRE: DUALOPEND_GOT_OFFER */
/* dualopend->master: they offered channel */ /* dualopend->master: they offered channel */
u8 *towire_dual_open_got_offer(const tal_t *ctx, struct amount_sat opener_funding, struct amount_sat dust_limit_satoshis, struct amount_msat max_htlc_value_in_flight_msat, struct amount_msat htlc_minimum_msat, u32 feerate_funding_max, u32 feerate_funding_min, u32 feerate_funding_best, u32 feerate_per_kw, u16 to_self_delay, u16 max_accepted_htlcs, u8 channel_flags, u32 locktime, const u8 *shutdown_scriptpubkey) u8 *towire_dualopend_got_offer(const tal_t *ctx, struct amount_sat opener_funding, struct amount_sat dust_limit_satoshis, struct amount_msat max_htlc_value_in_flight_msat, struct amount_msat htlc_minimum_msat, u32 feerate_funding_max, u32 feerate_funding_min, u32 feerate_funding_best, u32 feerate_per_kw, u16 to_self_delay, u16 max_accepted_htlcs, u8 channel_flags, u32 locktime, const u8 *shutdown_scriptpubkey)
{ {
u16 shutdown_len = tal_count(shutdown_scriptpubkey); u16 shutdown_len = tal_count(shutdown_scriptpubkey);
u8 *p = tal_arr(ctx, u8, 0); u8 *p = tal_arr(ctx, u8, 0);
towire_u16(&p, WIRE_DUAL_OPEN_GOT_OFFER); towire_u16(&p, WIRE_DUALOPEND_GOT_OFFER);
towire_amount_sat(&p, opener_funding); towire_amount_sat(&p, opener_funding);
towire_amount_sat(&p, dust_limit_satoshis); towire_amount_sat(&p, dust_limit_satoshis);
towire_amount_msat(&p, max_htlc_value_in_flight_msat); towire_amount_msat(&p, max_htlc_value_in_flight_msat);
@ -153,14 +153,14 @@ u8 *towire_dual_open_got_offer(const tal_t *ctx, struct amount_sat opener_fundin
return memcheck(p, tal_count(p)); return memcheck(p, tal_count(p));
} }
bool fromwire_dual_open_got_offer(const tal_t *ctx, const void *p, struct amount_sat *opener_funding, struct amount_sat *dust_limit_satoshis, struct amount_msat *max_htlc_value_in_flight_msat, struct amount_msat *htlc_minimum_msat, u32 *feerate_funding_max, u32 *feerate_funding_min, u32 *feerate_funding_best, u32 *feerate_per_kw, u16 *to_self_delay, u16 *max_accepted_htlcs, u8 *channel_flags, u32 *locktime, u8 **shutdown_scriptpubkey) bool fromwire_dualopend_got_offer(const tal_t *ctx, const void *p, struct amount_sat *opener_funding, struct amount_sat *dust_limit_satoshis, struct amount_msat *max_htlc_value_in_flight_msat, struct amount_msat *htlc_minimum_msat, u32 *feerate_funding_max, u32 *feerate_funding_min, u32 *feerate_funding_best, u32 *feerate_per_kw, u16 *to_self_delay, u16 *max_accepted_htlcs, u8 *channel_flags, u32 *locktime, u8 **shutdown_scriptpubkey)
{ {
u16 shutdown_len; u16 shutdown_len;
const u8 *cursor = p; const u8 *cursor = p;
size_t plen = tal_count(p); size_t plen = tal_count(p);
if (fromwire_u16(&cursor, &plen) != WIRE_DUAL_OPEN_GOT_OFFER) if (fromwire_u16(&cursor, &plen) != WIRE_DUALOPEND_GOT_OFFER)
return false; return false;
*opener_funding = fromwire_amount_sat(&cursor, &plen); *opener_funding = fromwire_amount_sat(&cursor, &plen);
*dust_limit_satoshis = fromwire_amount_sat(&cursor, &plen); *dust_limit_satoshis = fromwire_amount_sat(&cursor, &plen);
@ -181,14 +181,14 @@ bool fromwire_dual_open_got_offer(const tal_t *ctx, const void *p, struct amount
return cursor != NULL; return cursor != NULL;
} }
/* WIRE: DUAL_OPEN_GOT_OFFER_REPLY */ /* WIRE: DUALOPEND_GOT_OFFER_REPLY */
/* master->dualopend: reply back with our first funding info/contribs */ /* master->dualopend: reply back with our first funding info/contribs */
u8 *towire_dual_open_got_offer_reply(const tal_t *ctx, struct amount_sat accepter_funding, u32 feerate_funding, const struct wally_psbt *psbt, const u8 *our_shutdown_scriptpubkey) u8 *towire_dualopend_got_offer_reply(const tal_t *ctx, struct amount_sat accepter_funding, u32 feerate_funding, const struct wally_psbt *psbt, const u8 *our_shutdown_scriptpubkey)
{ {
u16 shutdown_len = tal_count(our_shutdown_scriptpubkey); u16 shutdown_len = tal_count(our_shutdown_scriptpubkey);
u8 *p = tal_arr(ctx, u8, 0); u8 *p = tal_arr(ctx, u8, 0);
towire_u16(&p, WIRE_DUAL_OPEN_GOT_OFFER_REPLY); towire_u16(&p, WIRE_DUALOPEND_GOT_OFFER_REPLY);
towire_amount_sat(&p, accepter_funding); towire_amount_sat(&p, accepter_funding);
towire_u32(&p, feerate_funding); towire_u32(&p, feerate_funding);
towire_wally_psbt(&p, psbt); towire_wally_psbt(&p, psbt);
@ -197,14 +197,14 @@ u8 *towire_dual_open_got_offer_reply(const tal_t *ctx, struct amount_sat accepte
return memcheck(p, tal_count(p)); return memcheck(p, tal_count(p));
} }
bool fromwire_dual_open_got_offer_reply(const tal_t *ctx, const void *p, struct amount_sat *accepter_funding, u32 *feerate_funding, struct wally_psbt **psbt, u8 **our_shutdown_scriptpubkey) bool fromwire_dualopend_got_offer_reply(const tal_t *ctx, const void *p, struct amount_sat *accepter_funding, u32 *feerate_funding, struct wally_psbt **psbt, u8 **our_shutdown_scriptpubkey)
{ {
u16 shutdown_len; u16 shutdown_len;
const u8 *cursor = p; const u8 *cursor = p;
size_t plen = tal_count(p); size_t plen = tal_count(p);
if (fromwire_u16(&cursor, &plen) != WIRE_DUAL_OPEN_GOT_OFFER_REPLY) if (fromwire_u16(&cursor, &plen) != WIRE_DUALOPEND_GOT_OFFER_REPLY)
return false; return false;
*accepter_funding = fromwire_amount_sat(&cursor, &plen); *accepter_funding = fromwire_amount_sat(&cursor, &plen);
*feerate_funding = fromwire_u32(&cursor, &plen); *feerate_funding = fromwire_u32(&cursor, &plen);
@ -216,17 +216,17 @@ bool fromwire_dual_open_got_offer_reply(const tal_t *ctx, const void *p, struct
return cursor != NULL; return cursor != NULL;
} }
/* WIRE: DUAL_OPEN_COMMIT_RCVD */ /* WIRE: DUALOPEND_COMMIT_RCVD */
/* dualopend->master: ready to commit channel open to database and */ /* dualopend->master: ready to commit channel open to database and */
/* get some signatures for the funding_tx. */ /* get some signatures for the funding_tx. */
u8 *towire_dual_open_commit_rcvd(const tal_t *ctx, const struct channel_config *their_config, const struct bitcoin_tx *remote_first_commit, const struct penalty_base *pbase, const struct bitcoin_signature *first_commit_sig, const struct wally_psbt *psbt, const struct channel_id *channel_id, const struct per_peer_state *pps, const struct pubkey *revocation_basepoint, const struct pubkey *payment_basepoint, const struct pubkey *htlc_basepoint, const struct pubkey *delayed_payment_basepoint, const struct pubkey *their_per_commit_point, const struct pubkey *remote_fundingkey, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshis, struct amount_sat our_funding_sats, u8 channel_flags, u32 feerate_per_kw, const u8 *commitment_msg, struct amount_sat our_channel_reserve_satoshis, const u8 *local_shutdown_scriptpubkey, const u8 *remote_shutdown_scriptpubkey) u8 *towire_dualopend_commit_rcvd(const tal_t *ctx, const struct channel_config *their_config, const struct bitcoin_tx *remote_first_commit, const struct penalty_base *pbase, const struct bitcoin_signature *first_commit_sig, const struct wally_psbt *psbt, const struct channel_id *channel_id, const struct per_peer_state *pps, const struct pubkey *revocation_basepoint, const struct pubkey *payment_basepoint, const struct pubkey *htlc_basepoint, const struct pubkey *delayed_payment_basepoint, const struct pubkey *their_per_commit_point, const struct pubkey *remote_fundingkey, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshis, struct amount_sat our_funding_sats, u8 channel_flags, u32 feerate_per_kw, const u8 *commitment_msg, struct amount_sat our_channel_reserve_satoshis, const u8 *local_shutdown_scriptpubkey, const u8 *remote_shutdown_scriptpubkey)
{ {
u16 msglen = tal_count(commitment_msg); u16 msglen = tal_count(commitment_msg);
u16 local_shutdown_len = tal_count(local_shutdown_scriptpubkey); u16 local_shutdown_len = tal_count(local_shutdown_scriptpubkey);
u16 remote_shutdown_len = tal_count(remote_shutdown_scriptpubkey); u16 remote_shutdown_len = tal_count(remote_shutdown_scriptpubkey);
u8 *p = tal_arr(ctx, u8, 0); u8 *p = tal_arr(ctx, u8, 0);
towire_u16(&p, WIRE_DUAL_OPEN_COMMIT_RCVD); towire_u16(&p, WIRE_DUALOPEND_COMMIT_RCVD);
towire_channel_config(&p, their_config); towire_channel_config(&p, their_config);
towire_bitcoin_tx(&p, remote_first_commit); towire_bitcoin_tx(&p, remote_first_commit);
if (!pbase) if (!pbase)
@ -262,7 +262,7 @@ u8 *towire_dual_open_commit_rcvd(const tal_t *ctx, const struct channel_config *
return memcheck(p, tal_count(p)); return memcheck(p, tal_count(p));
} }
bool fromwire_dual_open_commit_rcvd(const tal_t *ctx, const void *p, struct channel_config *their_config, struct bitcoin_tx **remote_first_commit, struct penalty_base **pbase, struct bitcoin_signature *first_commit_sig, struct wally_psbt **psbt, struct channel_id *channel_id, struct per_peer_state **pps, struct pubkey *revocation_basepoint, struct pubkey *payment_basepoint, struct pubkey *htlc_basepoint, struct pubkey *delayed_payment_basepoint, struct pubkey *their_per_commit_point, struct pubkey *remote_fundingkey, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshis, struct amount_sat *our_funding_sats, u8 *channel_flags, u32 *feerate_per_kw, u8 **commitment_msg, struct amount_sat *our_channel_reserve_satoshis, u8 **local_shutdown_scriptpubkey, u8 **remote_shutdown_scriptpubkey) bool fromwire_dualopend_commit_rcvd(const tal_t *ctx, const void *p, struct channel_config *their_config, struct bitcoin_tx **remote_first_commit, struct penalty_base **pbase, struct bitcoin_signature *first_commit_sig, struct wally_psbt **psbt, struct channel_id *channel_id, struct per_peer_state **pps, struct pubkey *revocation_basepoint, struct pubkey *payment_basepoint, struct pubkey *htlc_basepoint, struct pubkey *delayed_payment_basepoint, struct pubkey *their_per_commit_point, struct pubkey *remote_fundingkey, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshis, struct amount_sat *our_funding_sats, u8 *channel_flags, u32 *feerate_per_kw, u8 **commitment_msg, struct amount_sat *our_channel_reserve_satoshis, u8 **local_shutdown_scriptpubkey, u8 **remote_shutdown_scriptpubkey)
{ {
u16 msglen; u16 msglen;
u16 local_shutdown_len; u16 local_shutdown_len;
@ -271,7 +271,7 @@ bool fromwire_dual_open_commit_rcvd(const tal_t *ctx, const void *p, struct chan
const u8 *cursor = p; const u8 *cursor = p;
size_t plen = tal_count(p); size_t plen = tal_count(p);
if (fromwire_u16(&cursor, &plen) != WIRE_DUAL_OPEN_COMMIT_RCVD) if (fromwire_u16(&cursor, &plen) != WIRE_DUALOPEND_COMMIT_RCVD)
return false; return false;
fromwire_channel_config(&cursor, &plen, their_config); fromwire_channel_config(&cursor, &plen, their_config);
*remote_first_commit = fromwire_bitcoin_tx(ctx, &cursor, &plen); *remote_first_commit = fromwire_bitcoin_tx(ctx, &cursor, &plen);
@ -314,25 +314,25 @@ bool fromwire_dual_open_commit_rcvd(const tal_t *ctx, const void *p, struct chan
return cursor != NULL; return cursor != NULL;
} }
/* WIRE: DUAL_OPEN_PSBT_CHANGED */ /* WIRE: DUALOPEND_PSBT_CHANGED */
/* dualopend->master: peer updated the psbt */ /* dualopend->master: peer updated the psbt */
u8 *towire_dual_open_psbt_changed(const tal_t *ctx, const struct channel_id *channel_id, u64 funding_serial, const struct wally_psbt *psbt) u8 *towire_dualopend_psbt_changed(const tal_t *ctx, const struct channel_id *channel_id, u64 funding_serial, const struct wally_psbt *psbt)
{ {
u8 *p = tal_arr(ctx, u8, 0); u8 *p = tal_arr(ctx, u8, 0);
towire_u16(&p, WIRE_DUAL_OPEN_PSBT_CHANGED); towire_u16(&p, WIRE_DUALOPEND_PSBT_CHANGED);
towire_channel_id(&p, channel_id); towire_channel_id(&p, channel_id);
towire_u64(&p, funding_serial); towire_u64(&p, funding_serial);
towire_wally_psbt(&p, psbt); towire_wally_psbt(&p, psbt);
return memcheck(p, tal_count(p)); return memcheck(p, tal_count(p));
} }
bool fromwire_dual_open_psbt_changed(const tal_t *ctx, const void *p, struct channel_id *channel_id, u64 *funding_serial, struct wally_psbt **psbt) bool fromwire_dualopend_psbt_changed(const tal_t *ctx, const void *p, struct channel_id *channel_id, u64 *funding_serial, struct wally_psbt **psbt)
{ {
const u8 *cursor = p; const u8 *cursor = p;
size_t plen = tal_count(p); size_t plen = tal_count(p);
if (fromwire_u16(&cursor, &plen) != WIRE_DUAL_OPEN_PSBT_CHANGED) if (fromwire_u16(&cursor, &plen) != WIRE_DUALOPEND_PSBT_CHANGED)
return false; return false;
fromwire_channel_id(&cursor, &plen, channel_id); fromwire_channel_id(&cursor, &plen, channel_id);
*funding_serial = fromwire_u64(&cursor, &plen); *funding_serial = fromwire_u64(&cursor, &plen);
@ -340,80 +340,80 @@ bool fromwire_dual_open_psbt_changed(const tal_t *ctx, const void *p, struct cha
return cursor != NULL; return cursor != NULL;
} }
/* WIRE: DUAL_OPEN_PSBT_UPDATED */ /* WIRE: DUALOPEND_PSBT_UPDATED */
/* master->dualopend: we updated the psbt */ /* master->dualopend: we updated the psbt */
u8 *towire_dual_open_psbt_updated(const tal_t *ctx, const struct wally_psbt *psbt) u8 *towire_dualopend_psbt_updated(const tal_t *ctx, const struct wally_psbt *psbt)
{ {
u8 *p = tal_arr(ctx, u8, 0); u8 *p = tal_arr(ctx, u8, 0);
towire_u16(&p, WIRE_DUAL_OPEN_PSBT_UPDATED); towire_u16(&p, WIRE_DUALOPEND_PSBT_UPDATED);
towire_wally_psbt(&p, psbt); towire_wally_psbt(&p, psbt);
return memcheck(p, tal_count(p)); return memcheck(p, tal_count(p));
} }
bool fromwire_dual_open_psbt_updated(const tal_t *ctx, const void *p, struct wally_psbt **psbt) bool fromwire_dualopend_psbt_updated(const tal_t *ctx, const void *p, struct wally_psbt **psbt)
{ {
const u8 *cursor = p; const u8 *cursor = p;
size_t plen = tal_count(p); size_t plen = tal_count(p);
if (fromwire_u16(&cursor, &plen) != WIRE_DUAL_OPEN_PSBT_UPDATED) if (fromwire_u16(&cursor, &plen) != WIRE_DUALOPEND_PSBT_UPDATED)
return false; return false;
*psbt = fromwire_wally_psbt(ctx, &cursor, &plen); *psbt = fromwire_wally_psbt(ctx, &cursor, &plen);
return cursor != NULL; return cursor != NULL;
} }
/* WIRE: DUAL_OPEN_FAIL */ /* WIRE: DUALOPEND_FAIL */
/* master->dualopend: fail this channel open */ /* master->dualopend: fail this channel open */
u8 *towire_dual_open_fail(const tal_t *ctx, const wirestring *reason) u8 *towire_dualopend_fail(const tal_t *ctx, const wirestring *reason)
{ {
u8 *p = tal_arr(ctx, u8, 0); u8 *p = tal_arr(ctx, u8, 0);
towire_u16(&p, WIRE_DUAL_OPEN_FAIL); towire_u16(&p, WIRE_DUALOPEND_FAIL);
towire_wirestring(&p, reason); towire_wirestring(&p, reason);
return memcheck(p, tal_count(p)); return memcheck(p, tal_count(p));
} }
bool fromwire_dual_open_fail(const tal_t *ctx, const void *p, wirestring **reason) bool fromwire_dualopend_fail(const tal_t *ctx, const void *p, wirestring **reason)
{ {
const u8 *cursor = p; const u8 *cursor = p;
size_t plen = tal_count(p); size_t plen = tal_count(p);
if (fromwire_u16(&cursor, &plen) != WIRE_DUAL_OPEN_FAIL) if (fromwire_u16(&cursor, &plen) != WIRE_DUALOPEND_FAIL)
return false; return false;
*reason = fromwire_wirestring(ctx, &cursor, &plen); *reason = fromwire_wirestring(ctx, &cursor, &plen);
return cursor != NULL; return cursor != NULL;
} }
/* WIRE: DUAL_OPEN_FAILED */ /* WIRE: DUALOPEND_FAILED */
/* dualopend->master: we failed to negotiate channel */ /* dualopend->master: we failed to negotiate channel */
u8 *towire_dual_open_failed(const tal_t *ctx, const wirestring *reason) u8 *towire_dualopend_failed(const tal_t *ctx, const wirestring *reason)
{ {
u8 *p = tal_arr(ctx, u8, 0); u8 *p = tal_arr(ctx, u8, 0);
towire_u16(&p, WIRE_DUAL_OPEN_FAILED); towire_u16(&p, WIRE_DUALOPEND_FAILED);
towire_wirestring(&p, reason); towire_wirestring(&p, reason);
return memcheck(p, tal_count(p)); return memcheck(p, tal_count(p));
} }
bool fromwire_dual_open_failed(const tal_t *ctx, const void *p, wirestring **reason) bool fromwire_dualopend_failed(const tal_t *ctx, const void *p, wirestring **reason)
{ {
const u8 *cursor = p; const u8 *cursor = p;
size_t plen = tal_count(p); size_t plen = tal_count(p);
if (fromwire_u16(&cursor, &plen) != WIRE_DUAL_OPEN_FAILED) if (fromwire_u16(&cursor, &plen) != WIRE_DUALOPEND_FAILED)
return false; return false;
*reason = fromwire_wirestring(ctx, &cursor, &plen); *reason = fromwire_wirestring(ctx, &cursor, &plen);
return cursor != NULL; return cursor != NULL;
} }
/* WIRE: DUAL_OPEN_OPENER_INIT */ /* WIRE: DUALOPEND_OPENER_INIT */
/* master->dualopend: hello */ /* master->dualopend: hello */
u8 *towire_dual_open_opener_init(const tal_t *ctx, const struct wally_psbt *psbt, struct amount_sat funding_amount, const u8 *local_shutdown_scriptpubkey, u32 feerate_per_kw, u32 feerate_per_kw_funding, u8 channel_flags) u8 *towire_dualopend_opener_init(const tal_t *ctx, const struct wally_psbt *psbt, struct amount_sat funding_amount, const u8 *local_shutdown_scriptpubkey, u32 feerate_per_kw, u32 feerate_per_kw_funding, u8 channel_flags)
{ {
u16 local_shutdown_len = tal_count(local_shutdown_scriptpubkey); u16 local_shutdown_len = tal_count(local_shutdown_scriptpubkey);
u8 *p = tal_arr(ctx, u8, 0); u8 *p = tal_arr(ctx, u8, 0);
towire_u16(&p, WIRE_DUAL_OPEN_OPENER_INIT); towire_u16(&p, WIRE_DUALOPEND_OPENER_INIT);
towire_wally_psbt(&p, psbt); towire_wally_psbt(&p, psbt);
towire_amount_sat(&p, funding_amount); towire_amount_sat(&p, funding_amount);
towire_u16(&p, local_shutdown_len); towire_u16(&p, local_shutdown_len);
@ -424,14 +424,14 @@ u8 *towire_dual_open_opener_init(const tal_t *ctx, const struct wally_psbt *psbt
return memcheck(p, tal_count(p)); return memcheck(p, tal_count(p));
} }
bool fromwire_dual_open_opener_init(const tal_t *ctx, const void *p, struct wally_psbt **psbt, struct amount_sat *funding_amount, u8 **local_shutdown_scriptpubkey, u32 *feerate_per_kw, u32 *feerate_per_kw_funding, u8 *channel_flags) bool fromwire_dualopend_opener_init(const tal_t *ctx, const void *p, struct wally_psbt **psbt, struct amount_sat *funding_amount, u8 **local_shutdown_scriptpubkey, u32 *feerate_per_kw, u32 *feerate_per_kw_funding, u8 *channel_flags)
{ {
u16 local_shutdown_len; u16 local_shutdown_len;
const u8 *cursor = p; const u8 *cursor = p;
size_t plen = tal_count(p); size_t plen = tal_count(p);
if (fromwire_u16(&cursor, &plen) != WIRE_DUAL_OPEN_OPENER_INIT) if (fromwire_u16(&cursor, &plen) != WIRE_DUALOPEND_OPENER_INIT)
return false; return false;
*psbt = fromwire_wally_psbt(ctx, &cursor, &plen); *psbt = fromwire_wally_psbt(ctx, &cursor, &plen);
*funding_amount = fromwire_amount_sat(&cursor, &plen); *funding_amount = fromwire_amount_sat(&cursor, &plen);
@ -445,44 +445,44 @@ bool fromwire_dual_open_opener_init(const tal_t *ctx, const void *p, struct wall
return cursor != NULL; return cursor != NULL;
} }
/* WIRE: DUAL_OPEN_DEV_MEMLEAK */ /* WIRE: DUALOPEND_DEV_MEMLEAK */
/* master -> dualopend: do you have a memleak? */ /* master -> dualopend: do you have a memleak? */
u8 *towire_dual_open_dev_memleak(const tal_t *ctx) u8 *towire_dualopend_dev_memleak(const tal_t *ctx)
{ {
u8 *p = tal_arr(ctx, u8, 0); u8 *p = tal_arr(ctx, u8, 0);
towire_u16(&p, WIRE_DUAL_OPEN_DEV_MEMLEAK); towire_u16(&p, WIRE_DUALOPEND_DEV_MEMLEAK);
return memcheck(p, tal_count(p)); return memcheck(p, tal_count(p));
} }
bool fromwire_dual_open_dev_memleak(const void *p) bool fromwire_dualopend_dev_memleak(const void *p)
{ {
const u8 *cursor = p; const u8 *cursor = p;
size_t plen = tal_count(p); size_t plen = tal_count(p);
if (fromwire_u16(&cursor, &plen) != WIRE_DUAL_OPEN_DEV_MEMLEAK) if (fromwire_u16(&cursor, &plen) != WIRE_DUALOPEND_DEV_MEMLEAK)
return false; return false;
return cursor != NULL; return cursor != NULL;
} }
/* WIRE: DUAL_OPEN_DEV_MEMLEAK_REPLY */ /* WIRE: DUALOPEND_DEV_MEMLEAK_REPLY */
u8 *towire_dual_open_dev_memleak_reply(const tal_t *ctx, bool leak) u8 *towire_dualopend_dev_memleak_reply(const tal_t *ctx, bool leak)
{ {
u8 *p = tal_arr(ctx, u8, 0); u8 *p = tal_arr(ctx, u8, 0);
towire_u16(&p, WIRE_DUAL_OPEN_DEV_MEMLEAK_REPLY); towire_u16(&p, WIRE_DUALOPEND_DEV_MEMLEAK_REPLY);
towire_bool(&p, leak); towire_bool(&p, leak);
return memcheck(p, tal_count(p)); return memcheck(p, tal_count(p));
} }
bool fromwire_dual_open_dev_memleak_reply(const void *p, bool *leak) bool fromwire_dualopend_dev_memleak_reply(const void *p, bool *leak)
{ {
const u8 *cursor = p; const u8 *cursor = p;
size_t plen = tal_count(p); size_t plen = tal_count(p);
if (fromwire_u16(&cursor, &plen) != WIRE_DUAL_OPEN_DEV_MEMLEAK_REPLY) if (fromwire_u16(&cursor, &plen) != WIRE_DUALOPEND_DEV_MEMLEAK_REPLY)
return false; return false;
*leak = fromwire_bool(&cursor, &plen); *leak = fromwire_bool(&cursor, &plen);
return cursor != NULL; return cursor != NULL;
} }
// SHA256STAMP:f08f0c25f359d5c8f843d78c94eca9b0543b39e62a34983f6572adf92ff02aaa // SHA256STAMP:c00536896059d3bd16cd8e1512674abcda83fd680e171dfc016a796f7b4be522

90
openingd/dualopend_wiregen.h

@ -18,27 +18,27 @@
#include <common/per_peer_state.h> #include <common/per_peer_state.h>
enum dualopend_wire { enum dualopend_wire {
WIRE_DUAL_OPEN_INIT = 7000, WIRE_DUALOPEND_INIT = 7000,
/* dualopend->master: they offered channel */ /* dualopend->master: they offered channel */
WIRE_DUAL_OPEN_GOT_OFFER = 7005, WIRE_DUALOPEND_GOT_OFFER = 7005,
/* master->dualopend: reply back with our first funding info/contribs */ /* master->dualopend: reply back with our first funding info/contribs */
WIRE_DUAL_OPEN_GOT_OFFER_REPLY = 7105, WIRE_DUALOPEND_GOT_OFFER_REPLY = 7105,
/* dualopend->master: ready to commit channel open to database and */ /* dualopend->master: ready to commit channel open to database and */
/* get some signatures for the funding_tx. */ /* get some signatures for the funding_tx. */
WIRE_DUAL_OPEN_COMMIT_RCVD = 7007, WIRE_DUALOPEND_COMMIT_RCVD = 7007,
/* dualopend->master: peer updated the psbt */ /* dualopend->master: peer updated the psbt */
WIRE_DUAL_OPEN_PSBT_CHANGED = 7107, WIRE_DUALOPEND_PSBT_CHANGED = 7107,
/* master->dualopend: we updated the psbt */ /* master->dualopend: we updated the psbt */
WIRE_DUAL_OPEN_PSBT_UPDATED = 7108, WIRE_DUALOPEND_PSBT_UPDATED = 7108,
/* master->dualopend: fail this channel open */ /* master->dualopend: fail this channel open */
WIRE_DUAL_OPEN_FAIL = 7003, WIRE_DUALOPEND_FAIL = 7003,
/* dualopend->master: we failed to negotiate channel */ /* dualopend->master: we failed to negotiate channel */
WIRE_DUAL_OPEN_FAILED = 7004, WIRE_DUALOPEND_FAILED = 7004,
/* master->dualopend: hello */ /* master->dualopend: hello */
WIRE_DUAL_OPEN_OPENER_INIT = 7200, WIRE_DUALOPEND_OPENER_INIT = 7200,
/* master -> dualopend: do you have a memleak? */ /* master -> dualopend: do you have a memleak? */
WIRE_DUAL_OPEN_DEV_MEMLEAK = 7033, WIRE_DUALOPEND_DEV_MEMLEAK = 7033,
WIRE_DUAL_OPEN_DEV_MEMLEAK_REPLY = 7133, WIRE_DUALOPEND_DEV_MEMLEAK_REPLY = 7133,
}; };
const char *dualopend_wire_name(int e); const char *dualopend_wire_name(int e);
@ -53,60 +53,60 @@ const char *dualopend_wire_name(int e);
bool dualopend_wire_is_defined(u16 type); bool dualopend_wire_is_defined(u16 type);
/* WIRE: DUAL_OPEN_INIT */ /* WIRE: DUALOPEND_INIT */
u8 *towire_dual_open_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_feature_set, const u8 *their_init_features, const struct channel_config *our_config, u32 max_to_self_delay, struct amount_msat min_effective_htlc_capacity_msat, const struct per_peer_state *pps, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, u32 minimum_depth, u32 min_feerate, u32 max_feerate, const u8 *msg); u8 *towire_dualopend_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_feature_set, const u8 *their_init_features, const struct channel_config *our_config, u32 max_to_self_delay, struct amount_msat min_effective_htlc_capacity_msat, const struct per_peer_state *pps, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, u32 minimum_depth, u32 min_feerate, u32 max_feerate, const u8 *msg);
bool fromwire_dual_open_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_feature_set, u8 **their_init_features, struct channel_config *our_config, u32 *max_to_self_delay, struct amount_msat *min_effective_htlc_capacity_msat, struct per_peer_state **pps, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, u32 *minimum_depth, u32 *min_feerate, u32 *max_feerate, u8 **msg); bool fromwire_dualopend_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_feature_set, u8 **their_init_features, struct channel_config *our_config, u32 *max_to_self_delay, struct amount_msat *min_effective_htlc_capacity_msat, struct per_peer_state **pps, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, u32 *minimum_depth, u32 *min_feerate, u32 *max_feerate, u8 **msg);
/* WIRE: DUAL_OPEN_GOT_OFFER */ /* WIRE: DUALOPEND_GOT_OFFER */
/* dualopend->master: they offered channel */ /* dualopend->master: they offered channel */
u8 *towire_dual_open_got_offer(const tal_t *ctx, struct amount_sat opener_funding, struct amount_sat dust_limit_satoshis, struct amount_msat max_htlc_value_in_flight_msat, struct amount_msat htlc_minimum_msat, u32 feerate_funding_max, u32 feerate_funding_min, u32 feerate_funding_best, u32 feerate_per_kw, u16 to_self_delay, u16 max_accepted_htlcs, u8 channel_flags, u32 locktime, const u8 *shutdown_scriptpubkey); u8 *towire_dualopend_got_offer(const tal_t *ctx, struct amount_sat opener_funding, struct amount_sat dust_limit_satoshis, struct amount_msat max_htlc_value_in_flight_msat, struct amount_msat htlc_minimum_msat, u32 feerate_funding_max, u32 feerate_funding_min, u32 feerate_funding_best, u32 feerate_per_kw, u16 to_self_delay, u16 max_accepted_htlcs, u8 channel_flags, u32 locktime, const u8 *shutdown_scriptpubkey);
bool fromwire_dual_open_got_offer(const tal_t *ctx, const void *p, struct amount_sat *opener_funding, struct amount_sat *dust_limit_satoshis, struct amount_msat *max_htlc_value_in_flight_msat, struct amount_msat *htlc_minimum_msat, u32 *feerate_funding_max, u32 *feerate_funding_min, u32 *feerate_funding_best, u32 *feerate_per_kw, u16 *to_self_delay, u16 *max_accepted_htlcs, u8 *channel_flags, u32 *locktime, u8 **shutdown_scriptpubkey); bool fromwire_dualopend_got_offer(const tal_t *ctx, const void *p, struct amount_sat *opener_funding, struct amount_sat *dust_limit_satoshis, struct amount_msat *max_htlc_value_in_flight_msat, struct amount_msat *htlc_minimum_msat, u32 *feerate_funding_max, u32 *feerate_funding_min, u32 *feerate_funding_best, u32 *feerate_per_kw, u16 *to_self_delay, u16 *max_accepted_htlcs, u8 *channel_flags, u32 *locktime, u8 **shutdown_scriptpubkey);
/* WIRE: DUAL_OPEN_GOT_OFFER_REPLY */ /* WIRE: DUALOPEND_GOT_OFFER_REPLY */
/* master->dualopend: reply back with our first funding info/contribs */ /* master->dualopend: reply back with our first funding info/contribs */
u8 *towire_dual_open_got_offer_reply(const tal_t *ctx, struct amount_sat accepter_funding, u32 feerate_funding, const struct wally_psbt *psbt, const u8 *our_shutdown_scriptpubkey); u8 *towire_dualopend_got_offer_reply(const tal_t *ctx, struct amount_sat accepter_funding, u32 feerate_funding, const struct wally_psbt *psbt, const u8 *our_shutdown_scriptpubkey);
bool fromwire_dual_open_got_offer_reply(const tal_t *ctx, const void *p, struct amount_sat *accepter_funding, u32 *feerate_funding, struct wally_psbt **psbt, u8 **our_shutdown_scriptpubkey); bool fromwire_dualopend_got_offer_reply(const tal_t *ctx, const void *p, struct amount_sat *accepter_funding, u32 *feerate_funding, struct wally_psbt **psbt, u8 **our_shutdown_scriptpubkey);
/* WIRE: DUAL_OPEN_COMMIT_RCVD */ /* WIRE: DUALOPEND_COMMIT_RCVD */
/* dualopend->master: ready to commit channel open to database and */ /* dualopend->master: ready to commit channel open to database and */
/* get some signatures for the funding_tx. */ /* get some signatures for the funding_tx. */
u8 *towire_dual_open_commit_rcvd(const tal_t *ctx, const struct channel_config *their_config, const struct bitcoin_tx *remote_first_commit, const struct penalty_base *pbase, const struct bitcoin_signature *first_commit_sig, const struct wally_psbt *psbt, const struct channel_id *channel_id, const struct per_peer_state *pps, const struct pubkey *revocation_basepoint, const struct pubkey *payment_basepoint, const struct pubkey *htlc_basepoint, const struct pubkey *delayed_payment_basepoint, const struct pubkey *their_per_commit_point, const struct pubkey *remote_fundingkey, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshis, struct amount_sat our_funding_sats, u8 channel_flags, u32 feerate_per_kw, const u8 *commitment_msg, struct amount_sat our_channel_reserve_satoshis, const u8 *local_shutdown_scriptpubkey, const u8 *remote_shutdown_scriptpubkey); u8 *towire_dualopend_commit_rcvd(const tal_t *ctx, const struct channel_config *their_config, const struct bitcoin_tx *remote_first_commit, const struct penalty_base *pbase, const struct bitcoin_signature *first_commit_sig, const struct wally_psbt *psbt, const struct channel_id *channel_id, const struct per_peer_state *pps, const struct pubkey *revocation_basepoint, const struct pubkey *payment_basepoint, const struct pubkey *htlc_basepoint, const struct pubkey *delayed_payment_basepoint, const struct pubkey *their_per_commit_point, const struct pubkey *remote_fundingkey, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshis, struct amount_sat our_funding_sats, u8 channel_flags, u32 feerate_per_kw, const u8 *commitment_msg, struct amount_sat our_channel_reserve_satoshis, const u8 *local_shutdown_scriptpubkey, const u8 *remote_shutdown_scriptpubkey);
bool fromwire_dual_open_commit_rcvd(const tal_t *ctx, const void *p, struct channel_config *their_config, struct bitcoin_tx **remote_first_commit, struct penalty_base **pbase, struct bitcoin_signature *first_commit_sig, struct wally_psbt **psbt, struct channel_id *channel_id, struct per_peer_state **pps, struct pubkey *revocation_basepoint, struct pubkey *payment_basepoint, struct pubkey *htlc_basepoint, struct pubkey *delayed_payment_basepoint, struct pubkey *their_per_commit_point, struct pubkey *remote_fundingkey, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshis, struct amount_sat *our_funding_sats, u8 *channel_flags, u32 *feerate_per_kw, u8 **commitment_msg, struct amount_sat *our_channel_reserve_satoshis, u8 **local_shutdown_scriptpubkey, u8 **remote_shutdown_scriptpubkey); bool fromwire_dualopend_commit_rcvd(const tal_t *ctx, const void *p, struct channel_config *their_config, struct bitcoin_tx **remote_first_commit, struct penalty_base **pbase, struct bitcoin_signature *first_commit_sig, struct wally_psbt **psbt, struct channel_id *channel_id, struct per_peer_state **pps, struct pubkey *revocation_basepoint, struct pubkey *payment_basepoint, struct pubkey *htlc_basepoint, struct pubkey *delayed_payment_basepoint, struct pubkey *their_per_commit_point, struct pubkey *remote_fundingkey, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshis, struct amount_sat *our_funding_sats, u8 *channel_flags, u32 *feerate_per_kw, u8 **commitment_msg, struct amount_sat *our_channel_reserve_satoshis, u8 **local_shutdown_scriptpubkey, u8 **remote_shutdown_scriptpubkey);
/* WIRE: DUAL_OPEN_PSBT_CHANGED */ /* WIRE: DUALOPEND_PSBT_CHANGED */
/* dualopend->master: peer updated the psbt */ /* dualopend->master: peer updated the psbt */
u8 *towire_dual_open_psbt_changed(const tal_t *ctx, const struct channel_id *channel_id, u64 funding_serial, const struct wally_psbt *psbt); u8 *towire_dualopend_psbt_changed(const tal_t *ctx, const struct channel_id *channel_id, u64 funding_serial, const struct wally_psbt *psbt);
bool fromwire_dual_open_psbt_changed(const tal_t *ctx, const void *p, struct channel_id *channel_id, u64 *funding_serial, struct wally_psbt **psbt); bool fromwire_dualopend_psbt_changed(const tal_t *ctx, const void *p, struct channel_id *channel_id, u64 *funding_serial, struct wally_psbt **psbt);
/* WIRE: DUAL_OPEN_PSBT_UPDATED */ /* WIRE: DUALOPEND_PSBT_UPDATED */
/* master->dualopend: we updated the psbt */ /* master->dualopend: we updated the psbt */
u8 *towire_dual_open_psbt_updated(const tal_t *ctx, const struct wally_psbt *psbt); u8 *towire_dualopend_psbt_updated(const tal_t *ctx, const struct wally_psbt *psbt);
bool fromwire_dual_open_psbt_updated(const tal_t *ctx, const void *p, struct wally_psbt **psbt); bool fromwire_dualopend_psbt_updated(const tal_t *ctx, const void *p, struct wally_psbt **psbt);
/* WIRE: DUAL_OPEN_FAIL */ /* WIRE: DUALOPEND_FAIL */
/* master->dualopend: fail this channel open */ /* master->dualopend: fail this channel open */
u8 *towire_dual_open_fail(const tal_t *ctx, const wirestring *reason); u8 *towire_dualopend_fail(const tal_t *ctx, const wirestring *reason);
bool fromwire_dual_open_fail(const tal_t *ctx, const void *p, wirestring **reason); bool fromwire_dualopend_fail(const tal_t *ctx, const void *p, wirestring **reason);
/* WIRE: DUAL_OPEN_FAILED */ /* WIRE: DUALOPEND_FAILED */
/* dualopend->master: we failed to negotiate channel */ /* dualopend->master: we failed to negotiate channel */
u8 *towire_dual_open_failed(const tal_t *ctx, const wirestring *reason); u8 *towire_dualopend_failed(const tal_t *ctx, const wirestring *reason);
bool fromwire_dual_open_failed(const tal_t *ctx, const void *p, wirestring **reason); bool fromwire_dualopend_failed(const tal_t *ctx, const void *p, wirestring **reason);
/* WIRE: DUAL_OPEN_OPENER_INIT */ /* WIRE: DUALOPEND_OPENER_INIT */
/* master->dualopend: hello */ /* master->dualopend: hello */
u8 *towire_dual_open_opener_init(const tal_t *ctx, const struct wally_psbt *psbt, struct amount_sat funding_amount, const u8 *local_shutdown_scriptpubkey, u32 feerate_per_kw, u32 feerate_per_kw_funding, u8 channel_flags); u8 *towire_dualopend_opener_init(const tal_t *ctx, const struct wally_psbt *psbt, struct amount_sat funding_amount, const u8 *local_shutdown_scriptpubkey, u32 feerate_per_kw, u32 feerate_per_kw_funding, u8 channel_flags);
bool fromwire_dual_open_opener_init(const tal_t *ctx, const void *p, struct wally_psbt **psbt, struct amount_sat *funding_amount, u8 **local_shutdown_scriptpubkey, u32 *feerate_per_kw, u32 *feerate_per_kw_funding, u8 *channel_flags); bool fromwire_dualopend_opener_init(const tal_t *ctx, const void *p, struct wally_psbt **psbt, struct amount_sat *funding_amount, u8 **local_shutdown_scriptpubkey, u32 *feerate_per_kw, u32 *feerate_per_kw_funding, u8 *channel_flags);
/* WIRE: DUAL_OPEN_DEV_MEMLEAK */ /* WIRE: DUALOPEND_DEV_MEMLEAK */
/* master -> dualopend: do you have a memleak? */ /* master -> dualopend: do you have a memleak? */
u8 *towire_dual_open_dev_memleak(const tal_t *ctx); u8 *towire_dualopend_dev_memleak(const tal_t *ctx);
bool fromwire_dual_open_dev_memleak(const void *p); bool fromwire_dualopend_dev_memleak(const void *p);
/* WIRE: DUAL_OPEN_DEV_MEMLEAK_REPLY */ /* WIRE: DUALOPEND_DEV_MEMLEAK_REPLY */
u8 *towire_dual_open_dev_memleak_reply(const tal_t *ctx, bool leak); u8 *towire_dualopend_dev_memleak_reply(const tal_t *ctx, bool leak);
bool fromwire_dual_open_dev_memleak_reply(const void *p, bool *leak); bool fromwire_dualopend_dev_memleak_reply(const void *p, bool *leak);
#endif /* LIGHTNING_OPENINGD_DUALOPEND_WIREGEN_H */ #endif /* LIGHTNING_OPENINGD_DUALOPEND_WIREGEN_H */
// SHA256STAMP:f08f0c25f359d5c8f843d78c94eca9b0543b39e62a34983f6572adf92ff02aaa // SHA256STAMP:c00536896059d3bd16cd8e1512674abcda83fd680e171dfc016a796f7b4be522

Loading…
Cancel
Save