Skip to content
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 #2576

Closed

Conversation

rustyrussell
Copy link
Contributor

Based on top of #2575 (first 4 commits).

I got a bit distracted, as I realized we never implemented the upfront_shutdown_script option. Then I found a weird connect bug. But finally I implemented the damn hook!

We currently just segfault when the deserialize function to access resulttok.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This seems like overkill, at least for now.  Handling the JSON
inline is clearer, for the existing examples at least.

We also remove the dummy hook, rather than fix it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
I misunderstood the API, this ended up nesting a result inside the JSON-RPC
result.

No concerns about backwards compatibility since this is so new.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
… error.

Without this, the connect command hangs in the next patch.  This logic
is from the old days when gossipd handled connections, and we wanted
to make sure it didn't hang up on this client due to the error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
For me this happened only under valgrind with
test_option_upfront_shutdown_script:

==5063==    by 0x51FC076: raise (raise.c:48)
==5063==    by 0x51DD534: abort (abort.c:79)
==5063==    by 0x1292D2: fatal (log.c:647)
==5063==    by 0x116570: channel_set_state (channel.c:340)
==5063==    by 0x116E04: lockin_complete (channel_control.c:73)
==5063==    by 0x116F15: peer_got_funding_locked (channel_control.c:108)
==5063==    by 0x117354: channel_msg (channel_control.c:208)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Instead of lightningd telling us when it's ready, we ask it.
This also provides an opportunity to have a plugin hook at this point.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
New fields don't have to be spelled out twice.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@m-schmoock
Copy link
Collaborator

@rustyrussell Uh nice, as I see this is the second part of #2483 that I also was working on.

  • a6f04db (rusty/guilt/channel-fund-hook) openingd: add openchannel hook.
  • 75c822e openingd: check with lightningd when we receive an offer.

@m-schmoock
Copy link
Collaborator

are you submitting a dedicated PR?

@rustyrussell rustyrussell deleted the guilt/channel-fund-hook branch May 20, 2019 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants