Skip to content

Commit f1d536e

Browse files
committed
feat: round invoice to sats
1 parent 28dadb6 commit f1d536e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cln.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,9 @@ fn cents_to_msats(cents: u64, btc_price_dollars: u64) -> Result<u64, Error> {
532532
// Formula: (cents * 100_000_000_000) / price_data.USD
533533
let msats = (cents as u128 * 100_000_000_000u128) / bitcoin_price_cents as u128;
534534

535+
let rounded_sats = (msats + 999) / 1000;
536+
let rounded_msats = rounded_sats * 1000;
537+
535538
Ok(msats as u64)
536539
}
537540

0 commit comments

Comments
 (0)