]> git.bitcoin.ninja Git - rust-lightning/commit
Drop the subsecond part of timestamps when constructing invoices 2022-10-invoice-builder-round
authorMatt Corallo <git@bluematt.me>
Fri, 7 Oct 2022 01:38:56 +0000 (01:38 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 7 Oct 2022 02:05:46 +0000 (02:05 +0000)
commit008da7726337b61677e18e497d02e3188209e3b7
tree656c7b3de74feaf694e67793ce3e6348d4b2407e
parent7544030bb63fee6484fc178bb2ac8f382fe3b5b1
Drop the subsecond part of timestamps when constructing invoices

We had a user who was confused why an invoice failed to round-trip
(i.e. was not `PartialEq` with itself after write/read) when a
subsecond creation time was used (e.g. via the `from_system_time`
constructor).

This commit should address this confusion by dropping subsecond
parts in easily-accessible constructors when creating BOLT 11
invoices.

Fixes #1759.
lightning-invoice/src/lib.rs