Skip to content

feat: ability to disable automatic broadcasting of refund transactions#151

Merged
bennyhodl merged 1 commit intomasterfrom
manually-broadcast-refund
Mar 3, 2026
Merged

feat: ability to disable automatic broadcasting of refund transactions#151
bennyhodl merged 1 commit intomasterfrom
manually-broadcast-refund

Conversation

@bennyhodl
Copy link
Copy Markdown
Owner

Adds the ability to disable automatic broadcasting of refund transactions with AUTOMATIC_REFUND=false defaults to true.

If true, callers must call refund_dlc() in ddk

Copy link
Copy Markdown
Contributor

@matthewjablack matthewjablack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit. Other than that LGTM 🎉


// TODO: Make this public to refund
#[tracing::instrument(skip_all, level = "debug")]
async fn check_refund(&self, contract: &SignedContract) -> Result<(), Error> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove the TODO since it's already public

.lock_time
.to_consensus_u32() as u64
<= self.time.unix_time_now()
&& *AUTOMATIC_REFUND
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess && *AUTOMATIC_REFUND means that ddk won't detect a counterparty broadcasting refund tx either, but I think that's fine for now

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point added a check for confirmations before checking the broadcast

@bennyhodl bennyhodl force-pushed the manually-broadcast-refund branch from f223daa to c026a02 Compare March 3, 2026 19:37
@bennyhodl bennyhodl merged commit 1854862 into master Mar 3, 2026
118 of 177 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants