From b470a9d4fca5a17f8d9993b499f61c755b6e275c Mon Sep 17 00:00:00 2001 From: Daniel Karzel Date: Mon, 11 Oct 2021 10:16:17 +1100 Subject: [PATCH] Save Bitcoin amount `as_sat` in db The DLC does not concern the UI, hence the amounts should be handles in satoshi. Note: This commit enforces db reset of CFDs that are stored in `as_btc`. --- daemon/src/model/cfd.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/src/model/cfd.rs b/daemon/src/model/cfd.rs index b20eded..30953f5 100644 --- a/daemon/src/model/cfd.rs +++ b/daemon/src/model/cfd.rs @@ -1367,9 +1367,9 @@ pub struct Dlc { pub cets: HashMap>, pub refund: (Transaction, Signature), - #[serde(with = "::bdk::bitcoin::util::amount::serde::as_btc")] + #[serde(with = "::bdk::bitcoin::util::amount::serde::as_sat")] pub maker_lock_amount: Amount, - #[serde(with = "::bdk::bitcoin::util::amount::serde::as_btc")] + #[serde(with = "::bdk::bitcoin::util::amount::serde::as_sat")] pub taker_lock_amount: Amount, pub revoked_commit: Vec,