Skip to content

Commit 733efcf

Browse files
committed
BOLTs: import spec additions for option_simple_close.
Signed-off-by: Rusty Russell <[email protected]>
1 parent 58e1428 commit 733efcf

File tree

14 files changed

+72
-3
lines changed

14 files changed

+72
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CCANDIR := ccan
2626

2727
# Where we keep the BOLT RFCs
2828
BOLTDIR := ../bolts/
29-
DEFAULT_BOLTVERSION := acd383145dd8c3fecd69ce94e4a789767b984ac0
29+
DEFAULT_BOLTVERSION := ccfa38ed4f592c3711156bb4ded77f44ec01101d
3030
# Can be overridden on cmdline.
3131
BOLTVERSION := $(DEFAULT_BOLTVERSION)
3232

channeld/channeld.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4554,6 +4554,8 @@ static void peer_in(struct peer *peer, const u8 *msg)
45544554
case WIRE_FUNDING_CREATED:
45554555
case WIRE_FUNDING_SIGNED:
45564556
case WIRE_CLOSING_SIGNED:
4557+
case WIRE_CLOSING_COMPLETE:
4558+
case WIRE_CLOSING_SIG:
45574559
case WIRE_TX_ADD_INPUT:
45584560
case WIRE_TX_REMOVE_INPUT:
45594561
case WIRE_TX_ADD_OUTPUT:

closingd/closingd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static void send_offer(struct per_peer_state *pps,
165165

166166
/* BOLT #3:
167167
*
168-
* ## Closing Transaction
168+
* ## Legacy Closing Transaction
169169
*...
170170
* Each node offering a signature... MAY eliminate its
171171
* own output.

common/close_tx.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ struct bitcoin_tx *create_close_tx(const tal_t *ctx,
2929

3030
/* BOLT #3:
3131
*
32-
* ## Closing Transaction
32+
* ## Legacy Closing Transaction
33+
*
34+
* This variant is used for `closing_signed` messages (i.e. where
35+
* `option_simple_close` is not negotiated).
3336
*
3437
* Note that there are two possible variants for each node.
3538
*

common/gossmap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,6 +1792,8 @@ const void *gossmap_stream_next(const tal_t *ctx,
17921792
case WIRE_SPLICE_LOCKED:
17931793
case WIRE_SHUTDOWN:
17941794
case WIRE_CLOSING_SIGNED:
1795+
case WIRE_CLOSING_COMPLETE:
1796+
case WIRE_CLOSING_SIG:
17951797
case WIRE_UPDATE_ADD_HTLC:
17961798
case WIRE_UPDATE_FULFILL_HTLC:
17971799
case WIRE_UPDATE_FAIL_HTLC:

common/interactivetx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ static u8 *read_next_msg(const tal_t *ctx,
157157
case WIRE_FUNDING_CREATED:
158158
case WIRE_FUNDING_SIGNED:
159159
case WIRE_CLOSING_SIGNED:
160+
case WIRE_CLOSING_COMPLETE:
161+
case WIRE_CLOSING_SIG:
160162
case WIRE_UPDATE_ADD_HTLC:
161163
case WIRE_UPDATE_FULFILL_HTLC:
162164
case WIRE_UPDATE_FAIL_HTLC:
@@ -747,6 +749,8 @@ char *process_interactivetx_updates(const tal_t *ctx,
747749
case WIRE_CHANNEL_READY:
748750
case WIRE_SHUTDOWN:
749751
case WIRE_CLOSING_SIGNED:
752+
case WIRE_CLOSING_COMPLETE:
753+
case WIRE_CLOSING_SIG:
750754
case WIRE_UPDATE_ADD_HTLC:
751755
case WIRE_UPDATE_FULFILL_HTLC:
752756
case WIRE_UPDATE_FAIL_HTLC:

common/shutdown_scriptpubkey.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* 3. if (and only if) `option_shutdown_anysegwit` is negotiated:
1111
* * `OP_1` through `OP_16` inclusive, followed by a single push of 2 to 40 bytes
1212
* (witness program versions 1 through 16)
13+
* 4. if (and only if) `option_simple_close` is negotiated:
14+
* * `OP_RETURN` followed by one of:
15+
* * `6` to `75` inclusive followed by exactly that many bytes
16+
* * `76` followed by `76` to `80` followed by exactly that many bytes
1317
*
1418
* A receiving node:
1519
*...

connectd/gossip_rcvd_filter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ static bool is_msg_gossip_broadcast(const u8 *cursor)
6767
case WIRE_CHANNEL_READY:
6868
case WIRE_SHUTDOWN:
6969
case WIRE_CLOSING_SIGNED:
70+
case WIRE_CLOSING_COMPLETE:
71+
case WIRE_CLOSING_SIG:
7072
case WIRE_UPDATE_ADD_HTLC:
7173
case WIRE_UPDATE_FULFILL_HTLC:
7274
case WIRE_UPDATE_FAIL_HTLC:

connectd/gossip_store.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ static bool public_msg_type(enum peer_wire type)
7676
case WIRE_TX_ABORT:
7777
case WIRE_SHUTDOWN:
7878
case WIRE_CLOSING_SIGNED:
79+
case WIRE_CLOSING_COMPLETE:
80+
case WIRE_CLOSING_SIG:
7981
case WIRE_UPDATE_ADD_HTLC:
8082
case WIRE_UPDATE_FULFILL_HTLC:
8183
case WIRE_UPDATE_FAIL_HTLC:

connectd/multiplex.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ static bool is_urgent(enum peer_wire type)
364364
case WIRE_TX_ACK_RBF:
365365
case WIRE_SHUTDOWN:
366366
case WIRE_CLOSING_SIGNED:
367+
case WIRE_CLOSING_COMPLETE:
368+
case WIRE_CLOSING_SIG:
367369
case WIRE_UPDATE_ADD_HTLC:
368370
case WIRE_UPDATE_FULFILL_HTLC:
369371
case WIRE_UPDATE_FAIL_HTLC:

0 commit comments

Comments
 (0)