Add hodl invoice support#150
Conversation
|
👋 Thanks for assigning @joostjager as a reviewer! |
| message Bolt11ClaimForHashRequest { | ||
|
|
||
| // The hex-encoded 32-byte payment hash. | ||
| string payment_hash = 1; |
There was a problem hiding this comment.
Redundant if we also provide preimage?
There was a problem hiding this comment.
Yeah I'm just copying the ldk-node api one to one. Maybe here it makes sense not to
There was a problem hiding this comment.
I am not sure if it makes sense in ldk-node. I can see some kind of defensive API argument, but I suppose the call will fail anyway if preimage and hash don't match.
There was a problem hiding this comment.
Made them optional for the rpc. Added tests to make sure we handle all the cases correctly too
Create the basic_consume consumer once during RabbitMqEventConsumer::new() and store it persistently, rather than recreating it on each consume_events() call. Before, the queue was dropped and we'd need to create a new consumer everytime we want to verify which events had came in.
4a7e929 to
d3dcb00
Compare
Adds three new API endpoints for hodl invoices, which allow the receiver to inspect incoming payments before deciding whether to claim or reject them. Also add a `PaymentClaimable` event that is published when a hodl invoice payment arrives and is waiting to be manually claimed or failed. This is was needed when getting ldk-server to work with loop.
d3dcb00 to
e055d37
Compare
|
It's easier to review when the rebase is a separate push |
First commit fixes a bug with the rabbitmq event consumers in the e2e tests so we can query the events multiple times in a test.
Second commit adds three new API endpoints for hodl invoices, which allow the receiver to inspect incoming payments before deciding whether to claim or reject them. Also add a
PaymentClaimableevent that is published when a hodl invoice payment arrives and is waiting to be manually claimed or failed.This is was needed when getting ldk-server to work with loop.