-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openchannel hook: add new close_to
field
#3280
openchannel hook: add new close_to
field
#3280
Conversation
f6a9391
to
5d534f7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bonus points of you remove DEV_OPENINGD_UPFRONT_SHUTDOWN_SCRIPT hack now we have proper support, but that's technically a separate issue.
lightningd/opening_control.c
Outdated
" openchannel.close_to hook: %.*s", | ||
t->end - t->start, buffer + t->start); | ||
case ADDRESS_PARSE_WRONG_NETWORK: | ||
fatal("Plugin returned invalid respnse to the" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/respnse/response/
lightningd/opening_control.c
Outdated
@@ -808,7 +836,8 @@ static void opening_got_offer(struct subd *openingd, | |||
if (peer_active_channel(uc->peer)) { | |||
subd_send_msg(openingd, | |||
take(towire_opening_got_offer_reply(NULL, | |||
"Already have active channel"))); | |||
"Already have active channel", | |||
tal_arr(tmpctx, u8, 0)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NULL works here.
Your Changelog entry is likely not working as expected: the script (currently) doesn't know how to handle multiple lines:
The entry would end at |
doc/PLUGINS.md
Outdated
} | ||
``` | ||
|
||
Note that `close_to` must be a valid address for the current chain; an invalid address will cause the node to crash. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we call it "exit with an error" instead of "crash" it is after all a safety abort :-)
Very nice change, yet another step towards full external on-chain wallet support 👍 |
The 'traditional' way to signal that "i'm continuing onto the next line" is to use a This seems like a nice to have though; I updated this to be a single line. |
Rounds out the application of `upfront_shutdown_script`, allowing an accepting node to specify a close_to address. Prior to this, only the opening node could specify one. Changelog-Added: Plugins: Allow the 'accepter' to specify an upfront_shutdown_script for a channel via a `close_to` field in the openchannel hook result
5d534f7
to
d22b1fd
Compare
Yech, stick with a single line for now. Release Captain has to neaten them anyway... |
Ack d22b1fd |
I wanted to add this to dual_funding, but decided that it's better to not cram too much more into that than need be, so instead did this off of master. This is more of a 'nice to have' now, but will be much more important come dual funded channels.
Rounds out the application of
upfront_shutdown_script
, allowingan accepting node to specify a close_to address.
Prior to this, only the opening node could specify one.
Changelog-Added: Plugins: Allow the 'accepter' to specify an upfront_shutdown_script for
a channel via a
close_to
field in the result.