Skip to content

Commit

Permalink
splice: (todo merge) update to master
Browse files Browse the repository at this point in the history
  • Loading branch information
ddustin committed Mar 3, 2023
1 parent 08ad7eb commit 64b3ea3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
30 changes: 21 additions & 9 deletions common/interactivetx.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ static bool is_segwit_output(const tal_t *ctx,
struct wally_tx_output *output,
const u8 *redeemscript)
{
/* Since redeemscript was removed from the spce, we assume it is
* segwit without checking for now. */
if (!redeemscript)
return true;

const u8 *wit_prog;
if (tal_bytelen(redeemscript) > 0)
wit_prog = redeemscript;
Expand Down Expand Up @@ -146,9 +151,11 @@ static u8 *read_next_msg(const tal_t *ctx,
case WIRE_TX_REMOVE_OUTPUT:
case WIRE_TX_COMPLETE:
return msg;
case WIRE_TX_ABORT:
/* TODO */
case WIRE_TX_SIGNATURES:
case WIRE_CHANNEL_READY:
case WIRE_INIT_RBF:
case WIRE_TX_INIT_RBF:
case WIRE_OPEN_CHANNEL2:
case WIRE_INIT:
case WIRE_ERROR:
Expand All @@ -170,7 +177,7 @@ static u8 *read_next_msg(const tal_t *ctx,
case WIRE_GOSSIP_TIMESTAMP_FILTER:
case WIRE_ONION_MESSAGE:
case WIRE_ACCEPT_CHANNEL2:
case WIRE_ACK_RBF:
case WIRE_TX_ACK_RBF:
case WIRE_CHANNEL_ANNOUNCEMENT:
case WIRE_CHANNEL_UPDATE:
case WIRE_NODE_ANNOUNCEMENT:
Expand All @@ -182,6 +189,8 @@ static u8 *read_next_msg(const tal_t *ctx,
case WIRE_PING:
case WIRE_PONG:
case WIRE_SHUTDOWN:
case WIRE_PEER_STORAGE:
case WIRE_YOUR_PEER_STORAGE:
#if EXPERIMENTAL_FEATURES
case WIRE_STFU:
case WIRE_SPLICE:
Expand Down Expand Up @@ -231,8 +240,7 @@ static char *send_next(const tal_t *ctx,

msg = towire_tx_add_input(NULL, cid, serial_id,
prevtx, in->tx_input.index,
in->tx_input.sequence,
NULL);
in->tx_input.sequence);

tal_arr_remove(&set->added_ins, 0);
}
Expand Down Expand Up @@ -394,7 +402,7 @@ char *process_interactivetx_updates(const tal_t *ctx,
t = fromwire_peektype(msg);
switch (t) {
case WIRE_TX_ADD_INPUT: {
const u8 *tx_bytes, *redeemscript;
const u8 *tx_bytes, *redeemscript = NULL;
u32 sequence;
size_t len;
struct bitcoin_tx *tx;
Expand All @@ -404,9 +412,9 @@ char *process_interactivetx_updates(const tal_t *ctx,
&serial_id,
cast_const2(u8 **,
&tx_bytes),
&outpoint.n, &sequence,
&outpoint.n, &sequence/*,
cast_const2(u8 **,
&redeemscript)))
&redeemscript)*/))
return tal_fmt(ctx,
"Parsing tx_add_input %s",
tal_hex(ctx, msg));
Expand Down Expand Up @@ -681,6 +689,8 @@ char *process_interactivetx_updates(const tal_t *ctx,
if (received_tx_complete)
*received_tx_complete = true;
break;
case WIRE_TX_ABORT:
/* Todo */
case WIRE_INIT:
case WIRE_ERROR:
case WIRE_WARNING:
Expand All @@ -706,8 +716,8 @@ char *process_interactivetx_updates(const tal_t *ctx,
case WIRE_TX_SIGNATURES:
case WIRE_OPEN_CHANNEL2:
case WIRE_ACCEPT_CHANNEL2:
case WIRE_INIT_RBF:
case WIRE_ACK_RBF:
case WIRE_TX_INIT_RBF:
case WIRE_TX_ACK_RBF:
case WIRE_CHANNEL_ANNOUNCEMENT:
case WIRE_CHANNEL_UPDATE:
case WIRE_NODE_ANNOUNCEMENT:
Expand All @@ -717,6 +727,8 @@ char *process_interactivetx_updates(const tal_t *ctx,
case WIRE_REPLY_SHORT_CHANNEL_IDS_END:
case WIRE_PING:
case WIRE_PONG:
case WIRE_PEER_STORAGE:
case WIRE_YOUR_PEER_STORAGE:
#if EXPERIMENTAL_FEATURES
case WIRE_SPLICE:
case WIRE_SPLICE_ACK:
Expand Down
3 changes: 3 additions & 0 deletions connectd/gossip_store.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ static bool public_msg_type(enum peer_wire type)
case WIRE_YOUR_PEER_STORAGE:
#if EXPERIMENTAL_FEATURES
case WIRE_STFU:
case WIRE_SPLICE:
case WIRE_SPLICE_ACK:
case WIRE_SPLICE_LOCKED:
#endif
return false;
case WIRE_CHANNEL_ANNOUNCEMENT:
Expand Down
3 changes: 2 additions & 1 deletion lightningd/channel_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,8 @@ static void handle_add_inflight(struct lightningd *ld,
channel->lease_chan_max_msat,
channel->lease_chan_max_ppt,
0,
channel->push);
AMOUNT_MSAT(0),
AMOUNT_SAT(0));


log_debug(channel->log, "lightningd adding inflight with txid %s",
Expand Down
2 changes: 1 addition & 1 deletion wire/extracted_peer_exp_wire.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
msgtype,stfu,2
msgdata,stfu,channel_id,channel_id,
msgdata,stfu,initiator,u8,
+msgtype,splice,74
+msgtype,splice,75
+msgdata,splice,channel_id,channel_id,
+msgdata,splice,chain_hash,chain_hash,
+msgdata,splice,funding_satoshis,u64,
Expand Down

0 comments on commit 64b3ea3

Please sign in to comment.