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

parse and generate bolt 11 invoices w/ payment addrs #3788

Merged
merged 4 commits into from Dec 5, 2019

Conversation

cfromknecht
Copy link
Contributor

Split off from #3679

This PR:

  • adds decoding of invoice payment addresses in the s field
  • adds ability to set payment address on invoice via functional option
  • generates a random payment address for all newly created invoices
  • exposes payment addresses via decodepayreq

This will enable #3415 to properly test receiving crowd funded mpp payments via the SendToRoute rpcs.

@cfromknecht cfromknecht requested review from joostjager and removed request for Roasbeef December 4, 2019 19:06
@cfromknecht cfromknecht changed the title Payment addr parse and generate bolt 11 invoices w/ payment addrs Dec 4, 2019
@cfromknecht cfromknecht added this to the 0.9.0 milestone Dec 5, 2019
@cfromknecht cfromknecht added v0.9.0 payments Related to invoices/payments spec labels Dec 5, 2019
lnrpc/rpc.proto Show resolved Hide resolved
lnrpc/invoicesrpc/addinvoice.go Show resolved Hide resolved
zpay32/invoice_internal_test.go Show resolved Hide resolved
zpay32/invoice_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@halseth halseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

zpay32/invoice_test.go Outdated Show resolved Hide resolved
This commit also consolidates the existing code duplication in parsing
payment hashes and description hashes into a single, combined method for
parsing 32-byte values. A similar change is made for encoding 32-byte
values.

zpay32/invoice: consolidate 32-byte encoding logic
This commit modifies Lighting.AddInvoice and InvoicesRPC.AddHoldInvoice
to include the node's supported feature bits on the invoice. For now
this only includes the optional TLV Onion Payload bit.
Copy link
Collaborator

@joostjager joostjager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, assuming CI becomes green

@joostjager joostjager added this to Needs Review in v0.9.0-beta Dec 5, 2019
@cfromknecht cfromknecht merged commit 969fe44 into lightningnetwork:master Dec 5, 2019
v0.9.0-beta automation moved this from Needs Review to Done Dec 5, 2019
@cfromknecht cfromknecht deleted the payment-addr branch December 10, 2019 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
amp payments Related to invoices/payments spec
Projects
No open projects
v0.9.0-beta
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants