Browse Source
Re-use order fee rate for close transaction
resilient-broadcast
luckysori
3 years ago
No known key found for this signature in database
GPG Key ID: 89CE0DB40A19D524
4 changed files with
5 additions and
3 deletions
-
Cargo.lock
-
daemon/src/collab_settlement_taker.rs
-
daemon/src/maker_cfd.rs
-
daemon/src/model/cfd.rs
|
|
@ -1426,7 +1426,7 @@ dependencies = [ |
|
|
|
[[package]] |
|
|
|
name = "maia" |
|
|
|
version = "0.1.0" |
|
|
|
source = "git+https://github.com/comit-network/maia#baaad94a10291d4e55c3d2cd30f3736035ee10ea" |
|
|
|
source = "git+https://github.com/comit-network/maia#a6846a244131108d93c62167c401e85d87d874bf" |
|
|
|
dependencies = [ |
|
|
|
"anyhow", |
|
|
|
"bdk", |
|
|
|
|
|
@ -72,7 +72,7 @@ impl Actor { |
|
|
|
|
|
|
|
let dlc = self.cfd.dlc().context("No DLC in CFD")?; |
|
|
|
|
|
|
|
let (tx, sig) = dlc.close_transaction(&self.proposal)?; |
|
|
|
let (tx, sig) = dlc.close_transaction(&self.proposal, self.cfd.order.fee_rate)?; |
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
@ -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)?; |
|
|
|
let (tx, sig_maker) = dlc.close_transaction(proposal, cfd.order.fee_rate)?; |
|
|
|
|
|
|
|
let own_script_pubkey = dlc.script_pubkey_for(cfd.role()); |
|
|
|
cfd.handle_proposal_signed(CollaborativeSettlement::new( |
|
|
|
|
|
@ -1445,6 +1445,7 @@ 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) = { |
|
|
@ -1461,6 +1462,7 @@ impl Dlc { |
|
|
|
lock_amount, |
|
|
|
(&self.maker_address, proposal.maker), |
|
|
|
(&self.taker_address, proposal.taker), |
|
|
|
fee_rate, |
|
|
|
) |
|
|
|
.context("Unable to collaborative close transaction")?; |
|
|
|
|
|
|
|