Skip to content

Commit 8dba8e6

Browse files
committed
tapfreighter: unlock asset coins before err on tx broadcast fail
Ensure locked asset coins are released before returning an error when attempting to publish the anchor transaction. Without this change, if the chain bridge logic determines the anchor transaction should not be broadcast, the coins remain locked, leaving the send attempt stuck in limbo.
1 parent db62706 commit 8dba8e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tapfreighter/chain_porter.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,10 @@ func (p *ChainPorter) stateStep(currentPkg sendPackage) (*sendPackage, error) {
13911391
"transaction %v: %w", txHash, err)
13921392

13931393
case err != nil:
1394+
// Unlock the inputs we locked for this transfer before
1395+
// returning the error.
1396+
p.unlockInputs(ctx, &currentPkg)
1397+
13941398
return nil, fmt.Errorf("unable to broadcast "+
13951399
"transaction %v: %w", txHash, err)
13961400
}

0 commit comments

Comments
 (0)