Skip to content

Commit 8bac293

Browse files
fix: allow DLC input signing for closed/preclosed contracts
get_signature_for_dlc_input only accepted Contract::Confirmed, causing splice operations to fail when the referenced contract was incorrectly moved to Closed (e.g. mempool-only splice tx treated as confirmed with NB_CONFIRMATIONS=0). The ClosedContract struct contains the full SignedContract data needed for signing, so the match is extended to handle all states that carry signing data.
1 parent 0d8aa46 commit 8bac293

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ddk-manager/src/dlc_input.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ where
4545
))?;
4646

4747
let key_id = match contract {
48-
Contract::Confirmed(c) => Ok(c.accepted_contract.offered_contract.keys_id),
48+
Contract::Confirmed(c) | Contract::Signed(c) | Contract::Refunded(c) => {
49+
Ok(c.accepted_contract.offered_contract.keys_id)
50+
}
51+
Contract::PreClosed(p) => Ok(p.signed_contract.accepted_contract.offered_contract.keys_id),
52+
Contract::Closed(c) => Ok(c.signed_contract.accepted_contract.offered_contract.keys_id),
4953
_ => Err(Error::InvalidState(
5054
"Contract must be confirmed to sign DLC input.".to_string(),
5155
)),

0 commit comments

Comments
 (0)