Skip to content

Commit 7108556

Browse files
committed
Re-enable 0-conf DLC channels
1 parent 9042f4a commit 7108556

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dlc-manager/src/manager.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use bitcoin::consensus::Decodable;
4848
use bitcoin::hashes::Hash;
4949

5050
/// The number of confirmations required before moving a [`Contract`] to the confirmed state.
51-
pub const NB_CONFIRMATIONS: u32 = 1;
51+
pub const NB_CONFIRMATIONS: u32 = 0;
5252
/// The delay to set the refund value to.
5353
pub const REFUND_DELAY: u32 = 86400 * 7;
5454
/// The nSequence value used for CETs in DLC channels
@@ -577,6 +577,7 @@ where
577577
let confirmations = self.blockchain.get_transaction_confirmations(
578578
&contract.accepted_contract.dlc_transactions.fund.txid(),
579579
)?;
580+
#[allow(clippy::absurd_extreme_comparisons)]
580581
if confirmations >= NB_CONFIRMATIONS {
581582
self.store
582583
.update_contract(&Contract::Confirmed(contract.clone()))?;
@@ -707,6 +708,7 @@ where
707708
let confirmations = self
708709
.blockchain
709710
.get_transaction_confirmations(&broadcasted_txid)?;
711+
#[allow(clippy::absurd_extreme_comparisons)]
710712
if confirmations >= NB_CONFIRMATIONS {
711713
let closed_contract = ClosedContract {
712714
attestations: contract.attestations.clone(),
@@ -744,6 +746,7 @@ where
744746
.blockchain
745747
.get_transaction_confirmations(&signed_cet.txid())?;
746748

749+
#[allow(clippy::absurd_extreme_comparisons)]
747750
if confirmations < 1 {
748751
// TODO(tibo): if this fails because another tx is already in
749752
// mempool or blockchain, we might have been cheated. There is
@@ -1361,6 +1364,7 @@ where
13611364

13621365
// TODO(lucas): No need to send it again if it is in mempool, unless we want to bump the
13631366
// fee.
1367+
#[allow(clippy::absurd_extreme_comparisons)]
13641368
if confirmations < 1 {
13651369
self.blockchain.send_transaction(claim_tx)?;
13661370
} else if confirmations >= NB_CONFIRMATIONS {

0 commit comments

Comments
 (0)