-
Notifications
You must be signed in to change notification settings - Fork 45
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
greenlight: wait for channel reestablished #1093
Conversation
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.
Looking good
small nit, can you capitalise the error strings?
6ae8a78
to
8711874
Compare
Capitalized error strings and use |
@@ -960,7 +1021,7 @@ impl NodeAPI for Greenlight { | |||
"send_pay route to pay: {:?}, received_amount = {}", | |||
route, to_pay_msat | |||
); | |||
|
|||
self.wait_channel_reestablished(&max.path).await?; |
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.
As far as I know greenlight has a mechanism to wait for channel re-establishment before attempting to pay, what is the benefit of adding such mechanism on the client too?
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.
Or perhaps this mechanism doesn't exist in send_pay
and that's why it is added here?
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.
Or perhaps this mechanism doesn't exist in
send_pay
and that's why it is added here?
exactly: Blockstream/greenlight#522
@JssDWt I talked to Christian today and:
The one thing he noted is that peer_connected is not enough for channel re-establishment but we need to check the channel state. I believe this is the check in greenlight: https://github.com/Blockstream/greenlight/blob/main/libs/gl-plugin/src/awaitables.rs#L177 |
I included that check in this PR: https://github.com/breez/breez-sdk-greenlight/pull/1093/files#diff-7466a53546c6cded460ef5502a9168b13cc930d94fdf7d0ea8166bb10c75fe7eR741 |
Oh perfect. How did I miss that? |
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.
LGTM
8711874
to
a0c7ffe
Compare
The calls to `send_pay` are not covered by greenlight's awaitable channel futures. Therefore wait for channels to be reestablished before doing any calls to `send_pay`.
a0c7ffe
to
c8c0ae1
Compare
The calls to
send_pay
are not covered by greenlight's awaitable channel futures. Therefore wait for channels to be reestablished before doing any calls tosend_pay
.Alternative to Blockstream/greenlight#522