diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8fac904..fc437c8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -13,6 +13,7 @@ env: BITCOIND_PASS: dlcdevkit ESPLORA_HOST: http://localhost:30000 RPC_WALLET: ddk + NB_CONFIRMATIONS: 6 jobs: clippy: diff --git a/ddk/src/chain/esplora.rs b/ddk/src/chain/esplora.rs index 38dd935..ae6e408 100644 --- a/ddk/src/chain/esplora.rs +++ b/ddk/src/chain/esplora.rs @@ -163,10 +163,12 @@ impl ddk_manager::Blockchain for EsploraClient { .get_height() .await .map_err(esplora_err_to_manager_err)?; - if txn.confirmed { match txn.block_height { - Some(height) => Ok(tip_height - height), + Some(height) => Ok(tip_height + .checked_sub(height) + .map(|diff| diff + 1) + .unwrap_or(0)), None => Ok(0), } } else {