mfc: add happy path-way for v2 in multifundchannel

Tested and works with both sides funding! Yay.

Doesn't do any amount of reasonable cleanup or handling of errors.
This commit is contained in:
niftynei
2020-10-20 20:18:19 -05:00
committed by neil saitug
parent 78d32b12d0
commit 5b6b012af9
6 changed files with 1425 additions and 211 deletions

View File

@@ -3,6 +3,7 @@
#include <plugins/spender/fundchannel.h>
#include <plugins/spender/multifundchannel.h>
#include <plugins/spender/multiwithdraw.h>
#include <plugins/spender/openchannel.h>
/*~ The spender plugin contains various commands that handle
* spending from the onchain wallet. */
@@ -10,6 +11,7 @@
static
void spender_init(struct plugin *p, const char *b, const jsmntok_t *t)
{
openchannel_init(p, b, t);
/* whatever_init(p, b, t); */
}
@@ -17,6 +19,7 @@ int main(int argc, char **argv)
{
char *owner = tal(NULL, char);
struct plugin_command *commands;
struct plugin_notification *notifs;
setup_locale();
@@ -27,10 +30,13 @@ int main(int argc, char **argv)
tal_expand(&commands, multifundchannel_commands, num_multifundchannel_commands);
/* tal_expand(&commands, whatever_commands, num_whatever_commands); */
notifs = tal_arr(owner, struct plugin_notification, 0);
tal_expand(&notifs, openchannel_notifs, num_openchannel_notifs);
plugin_main(argv, &spender_init, PLUGIN_STATIC, true,
NULL,
commands, tal_count(commands),
NULL, 0,
notifs, tal_count(notifs),
NULL, 0,
NULL);