Skip to content

Commit 8105050

Browse files
committed
splice: Add plugin for magic “splice all” command
The command called “splice” can take a json payload or a ‘splice script’, process it into a list of ‘actions’ and then execute those actions. These actions include or will include everything you would want to do with a splice: * Splice into a channel * Splice out of a channel * Fund from wallet * Deposit to wallet * Send funds to bitcoin address Changelog-Added: A new magic “splice” command is added that can take a ‘splice script’ or json payload and perform any complex splice across multiple channels merging the result into a single transaction. Some features are disabled and will be added in time.
1 parent 0eccd9d commit 8105050

File tree

4 files changed

+1106
-2
lines changed

4 files changed

+1106
-2
lines changed

plugins/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@ PLUGIN_SPENDER_SRC := \
4848
plugins/spender/main.c \
4949
plugins/spender/multifundchannel.c \
5050
plugins/spender/multiwithdraw.c \
51-
plugins/spender/openchannel.c
51+
plugins/spender/openchannel.c \
52+
plugins/spender/splice.c
5253
PLUGIN_SPENDER_HEADER := \
5354
plugins/spender/multifundchannel.h \
5455
plugins/spender/multiwithdraw.h \
5556
plugins/spender/fundchannel.h \
5657
plugins/spender/multifundchannel.h \
57-
plugins/spender/openchannel.h
58+
plugins/spender/openchannel.h \
59+
plugins/spender/splice.h
5860
PLUGIN_SPENDER_OBJS := $(PLUGIN_SPENDER_SRC:.c=.o)
5961

6062
PLUGIN_FUNDER_SRC := \
@@ -164,6 +166,7 @@ PLUGIN_COMMON_OBJS := \
164166
common/pseudorand.o \
165167
common/random_select.o \
166168
common/scb_wiregen.o \
169+
common/splice_script.o \
167170
common/setup.o \
168171
common/status_levels.o \
169172
common/type_to_string.o \

plugins/spender/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <plugins/spender/multifundchannel.h>
44
#include <plugins/spender/multiwithdraw.h>
55
#include <plugins/spender/openchannel.h>
6+
#include <plugins/spender/splice.h>
67

78
/*~ The spender plugin contains various commands that handle
89
* spending from the onchain wallet. */
@@ -27,6 +28,7 @@ int main(int argc, char **argv)
2728
tal_expand(&commands, multiwithdraw_commands, num_multiwithdraw_commands);
2829
tal_expand(&commands, fundchannel_commands, num_fundchannel_commands);
2930
tal_expand(&commands, multifundchannel_commands, num_multifundchannel_commands);
31+
tal_expand(&commands, splice_commands, num_splice_commands);
3032
/* tal_expand(&commands, whatever_commands, num_whatever_commands); */
3133

3234
notifs = tal_arr(NULL, struct plugin_notification, 0);

0 commit comments

Comments
 (0)