From c25d000e445dae160c385032e7b9884a4616fde2 Mon Sep 17 00:00:00 2001 From: Lucas Soriano Date: Thu, 9 Dec 2021 14:07:26 +1100 Subject: [PATCH] Revert "Re-use order fee rate for close transaction" --- Cargo.lock | 2 +- daemon/src/collab_settlement_taker.rs | 2 +- daemon/src/maker_cfd.rs | 2 +- daemon/src/model/cfd.rs | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 66645b4..2ba49fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1426,7 +1426,7 @@ dependencies = [ [[package]] name = "maia" version = "0.1.0" -source = "git+https://github.com/comit-network/maia#a6846a244131108d93c62167c401e85d87d874bf" +source = "git+https://github.com/comit-network/maia#baaad94a10291d4e55c3d2cd30f3736035ee10ea" dependencies = [ "anyhow", "bdk", diff --git a/daemon/src/collab_settlement_taker.rs b/daemon/src/collab_settlement_taker.rs index 0d3d832..b39836b 100644 --- a/daemon/src/collab_settlement_taker.rs +++ b/daemon/src/collab_settlement_taker.rs @@ -72,7 +72,7 @@ impl Actor { let dlc = self.cfd.dlc().context("No DLC in CFD")?; - let (tx, sig) = dlc.close_transaction(&self.proposal, self.cfd.order.fee_rate)?; + let (tx, sig) = dlc.close_transaction(&self.proposal)?; // Need to use `do_send_async` here because this handler is called in // context of a message arriving over the wire, and would result in a diff --git a/daemon/src/maker_cfd.rs b/daemon/src/maker_cfd.rs index dfe7841..2807288 100644 --- a/daemon/src/maker_cfd.rs +++ b/daemon/src/maker_cfd.rs @@ -865,7 +865,7 @@ where let mut cfd = load_cfd_by_order_id(order_id, &mut conn).await?; let dlc = cfd.open_dlc().context("CFD was in wrong state")?; - let (tx, sig_maker) = dlc.close_transaction(proposal, cfd.order.fee_rate)?; + let (tx, sig_maker) = dlc.close_transaction(proposal)?; let own_script_pubkey = dlc.script_pubkey_for(cfd.role()); cfd.handle_proposal_signed(CollaborativeSettlement::new( diff --git a/daemon/src/model/cfd.rs b/daemon/src/model/cfd.rs index 669d32d..74a4088 100644 --- a/daemon/src/model/cfd.rs +++ b/daemon/src/model/cfd.rs @@ -1445,7 +1445,6 @@ impl Dlc { pub fn close_transaction( &self, proposal: &crate::model::cfd::SettlementProposal, - fee_rate: u32, ) -> Result<(Transaction, Signature)> { let (lock_tx, lock_desc) = &self.lock; let (lock_outpoint, lock_amount) = { @@ -1462,7 +1461,6 @@ impl Dlc { lock_amount, (&self.maker_address, proposal.maker), (&self.taker_address, proposal.taker), - fee_rate, ) .context("Unable to collaborative close transaction")?;