]> git.bitcoin.ninja Git - rust-lightning/commit
Convert the invoice creation API to millisats and req it for parse
authorMatt Corallo <git@bluematt.me>
Sun, 22 Aug 2021 19:42:29 +0000 (19:42 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 31 Aug 2021 21:29:51 +0000 (21:29 +0000)
commit0be428eeda30e449b251e74bc330342abe3ef0c5
tree7b460a6b160d325ad09eb8d9a5a4f07fb8de0344
parent181cb1103d0a1f21aa1f2e44e2f36a6c68663b2f
Convert the invoice creation API to millisats and req it for parse

The BOLT 11 invalid invoice test vectors suggest failing to parse
invoices which have an amount which is not a whole number of
millisatoshis. lightning-invoice, however, happily parses such
invoices. While we could continue to parse them, failing them makes
for one less check on the user code side, so we might as well.

In order to keep the invoice creation less likely to fail, we also
switch the Builder amount-setting function to use millisatoshis.
lightning-invoice/src/lib.rs
lightning-invoice/src/utils.rs
lightning-invoice/tests/ser_de.rs