commit 18f1e5813bf93da6bfb84dd97fee9b1526c1ea0b
parent ce62d2f311299928c2bd6217ab638a3c84570c76
Author: Antoine A <>
Date: Thu, 10 Sep 2026 16:00:12 +0200
btc: fixes
Diffstat:
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/depolymerizer-bitcoin/src/api.rs b/depolymerizer-bitcoin/src/api.rs
@@ -135,7 +135,7 @@ impl ServerState {
pool: pool.clone(),
payto,
currency,
- status: AtomicBool::new(true),
+ status: AtomicBool::new(false),
in_channel: in_channel.clone(),
taler_in_channel: taler_in_channel.clone(),
taler_out_channel: taler_out_channel.clone(),
diff --git a/depolymerizer-bitcoin/src/cli.rs b/depolymerizer-bitcoin/src/cli.rs
@@ -113,10 +113,10 @@ pub async fn run(cmd: Command, cfg: &Config) -> anyhow::Result<()> {
.wire_gateway(api.clone(), cfg.auth.method())
.prepared_transfer(api.clone())
}
- if let Some(cfg) = cfg.observability {
+ if let Some(cfg) = cfg.revenue {
router = router.revenue(api.clone(), cfg.auth.method());
}
- if let Some(cfg) = cfg.revenue {
+ if let Some(cfg) = cfg.observability {
router = router.observability(api.clone(), cfg.auth.method());
}
diff --git a/depolymerizer-bitcoin/src/taler_utils.rs b/depolymerizer-bitcoin/src/taler_utils.rs
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2022-2025 Taler Systems SA
+ Copyright (C) 2022-2026 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software
@@ -27,6 +27,10 @@ pub fn btc_to_taler(amount: &SignedAmount, currency: &Currency) -> Amount {
/// Transform a taler amount into a btc amount
pub fn taler_to_btc(amount: &Amount) -> BtcAmount {
- let sat = amount.val * FRAC_BASE as u64 + amount.frac as u64;
+ let sat = amount
+ .val
+ .checked_mul(FRAC_BASE as u64)
+ .expect("taler to btc conversion overflow")
+ + amount.frac as u64;
BtcAmount::from_sat(sat)
}