Skip to content

Commit 1ff04d3

Browse files
committed
tapfreighter: unlock inputs on err if not in broadcast complete state
Update unlock logic to ensure that errors encountered during the anchor tx broadcast process, but before reaching the broadcast complete state, result in coins being unlocked. This prevents assets from remaining locked in case of intermediate failures.
1 parent a562518 commit 1ff04d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tapfreighter/chain_porter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ func (p *ChainPorter) unlockInputs(ctx context.Context, pkg *sendPackage) {
14871487
// sanity-check that we have known input commitments to unlock, since
14881488
// that might not always be the case (for example if another party
14891489
// contributes inputs).
1490-
if pkg.SendState < SendStateStorePreBroadcast &&
1490+
if pkg.SendState < SendStateBroadcastComplete &&
14911491
len(pkg.InputCommitments) > 0 {
14921492

14931493
for prevID := range pkg.InputCommitments {

0 commit comments

Comments
 (0)