-
Notifications
You must be signed in to change notification settings - Fork 902
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
Offers Part 2: db and invoice infrastructure. #4256
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Travis CI bot is failing on every PR! |
rustyrussell
force-pushed
the
offers-part2
branch
from
December 7, 2020 03:57
4a78c42
to
6293414
Compare
rustyrussell
changed the title
Offers Part2: db and invoice infrastructure.
Offers Part 2: db and invoice infrastructure.
Dec 9, 2020
rustyrussell
force-pushed
the
offers-part2
branch
from
December 9, 2020 10:17
6293414
to
d971fb8
Compare
Rebase on master |
We often have the currency as a tal string. Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
This allows us to mark an offer used when an invoice derived from it is paid, and importantly, avoid any other invoices for the offer being paid. Signed-off-by: Rusty Russell <[email protected]>
This is for offers which have `send_invoice`: we need to associate the payment with the original offer, in (the usual) case where it is a single use offer. We mark it used when it's paid, to avoid a race. Signed-off-by: Rusty Russell <[email protected]>
The real work is done in a plugin, but provide enough API that we can manipulate the db.
This means we can hand around unsigned bolt11s. Signed-off-by: Rusty Russell <[email protected]>
This takes an unsigned bolt11 (or bolt12 if EXPERIMENTAL_FEATURES) string and signs it and puts it in the database. The invoice command could now be moved out to a plugin, in fact. Changelog-Added: JSON-RPC: `createinvoice` new low-level invoice creation API. Signed-off-by: Rusty Russell <[email protected]>
The database still calls them `bolt11`, but we treat them depending on prefix. Signed-off-by: Rusty Russell <[email protected]>
And handle bolt12 strings if EXPERIMENTAL_FEATURES. Signed-off-by: Rusty Russell <[email protected]>
Note that we remove the redundant "is this the correct chain?" check, since bolt11_decode and bolt12_decode do that internally anyway (this was changed in 924cc04). Signed-off-by: Rusty Russell <[email protected]>
This didn't compile, but since nothing depends yet on common/blindedpath.o we don't build it yet. Signed-off-by: Rusty Russell <[email protected]>
rustyrussell
force-pushed
the
offers-part2
branch
from
December 14, 2020 01:26
374697d
to
064004c
Compare
Rebase on master x2 |
cdecker
reviewed
Dec 14, 2020
1. Hoist 7200 constant into the bolt12 heade2. 2. Make preimage the last createinvoice arg, so we could make it optional. 3. Check the validity of the preimage in createinvoice. 4. Always output used flag in listoffers. 5. Rename wallet offer iterators to offer_id iterators. 6. Fix paramter typos. 7. Rename `local_offer_id` parameter to `localofferid`. 8. Add reference constraints on local_offer_id db fields. 9. Remove cut/paste comment. 10. Clarify source of fatal() messages in wallet. Signed-off-by: Rusty Russell <[email protected]>
ACK 01c92fe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Built on #4255: first 10 commits)That's merged!This is the db changes for offers, and linking them to payments or invoices, especially so we can enforce atomicity (for single-use offers).