cln/closingd/Makefile
Níckolas Goline 9f2f4350df
closingd: add lightning_simpleclosed for option_simple_close
New subdaemon implementing the BOLT2 simple close protocol, replacing `lightning_closingd` when `option_simple_close` is negotiated:
- Each peer independently sends `closing_complete` with their fee proposal;
- The other side signs it and sends `closing_sig`;
- Both sides broadcast two conflicting closing transactions and whichever confirms first wins.

Key protocol details:
- Closer pays the fee and closee receives their exact channel balance;
- TLV variants selected per BOLT2: `closer_output_only`, `closer_and_closee_outputs`, `closee_output_only`;
- Sequence 0xFFFFFFFD enables RBF via re-sending `closing_complete`;
- Script mismatch on `closee_scriptpubkey` warns and fails to reconnect;

common/shutdown_scriptpubkey.h/c: removed `static` from `is_valid_op_return` so it can be used in `simpleclosed.c`
2026-07-02 13:30:17 -03:00

33 lines
1.1 KiB
Makefile

#! /usr/bin/make
CLOSINGD_HEADERS := closingd/closingd_wiregen.h
CLOSINGD_SRC := closingd/closingd.c \
$(CLOSINGD_HEADERS:.h=.c)
CLOSINGD_OBJS := $(CLOSINGD_SRC:.c=.o)
$(CLOSINGD_OBJS): $(CLOSINGD_HEADERS)
# Simple close daemon
SIMPLECLOSED_HEADERS := closingd/simpleclosed_wiregen.h
SIMPLECLOSED_SRC := closingd/simpleclosed.c \
$(SIMPLECLOSED_HEADERS:.h=.c)
SIMPLECLOSED_OBJS := $(SIMPLECLOSED_SRC:.c=.o)
$(SIMPLECLOSED_OBJS): $(SIMPLECLOSED_HEADERS)
# Make sure these depend on everything.
ALL_C_SOURCES += $(CLOSINGD_SRC) $(SIMPLECLOSED_SRC)
ALL_C_HEADERS += $(CLOSINGD_HEADERS) $(SIMPLECLOSED_HEADERS)
ALL_PROGRAMS += lightningd/lightning_closingd lightningd/lightning_simpleclosed
# Here's what lightningd depends on
LIGHTNINGD_CONTROL_HEADERS += closingd/closingd_wiregen.h closingd/simpleclosed_wiregen.h
LIGHTNINGD_CONTROL_OBJS += closingd/closingd_wiregen.o closingd/simpleclosed_wiregen.o
lightningd/lightning_closingd: $(CLOSINGD_OBJS) $(HSMD_CLIENT_OBJS) libcommon.a
lightningd/lightning_simpleclosed: $(SIMPLECLOSED_OBJS) $(HSMD_CLIENT_OBJS) libcommon.a
-include closingd/test/Makefile