Skip to content

fix(coordinator): track pending transactions without change outputs u…#471

Open
RIYAKUMARI001 wants to merge 1 commit intocaravan-bitcoin:mainfrom
RIYAKUMARI001:fix-pending-tx-tracking
Open

fix(coordinator): track pending transactions without change outputs u…#471
RIYAKUMARI001 wants to merge 1 commit intocaravan-bitcoin:mainfrom
RIYAKUMARI001:fix-pending-tx-tracking

Conversation

@RIYAKUMARI001
Copy link
Contributor

@RIYAKUMARI001 RIYAKUMARI001 commented Feb 8, 2026

What kind of change does this PR introduce?

Bugfix

Issue Number:

Fixes #407

Snapshots:

Screenshot 2026-02-08 222413 Screenshot 2026-02-08 222358 Screenshot 2026-02-08 222342 Screenshot 2026-02-08 224604 Screenshot 2026-02-08 222328

Summary
This PR resolves a critical bug where transactions without change outputs (e.g., "MAX" sends, consolidations, or 1:1 transactions) would disappear from the Caravan "Pending" transactions view immediately after broadcast.

The Fix:

Previously, the pending transaction logic relied primarily on detecting new "unconfirmed" outputs in the wallet's change/deposit nodes. For transactions that spent the entire balance to a single external or internal address without a change output, this detection would fail.
This PR refactors the transaction hooks to use historical address scanning for pending transactions.
Updated
selectProcessedTransactions
to support a explicit "pending" filter.
Implemented usePublicClientPendingTransactions and usePrivateClientPendingTransactions that fetch the mempool history of all relevant wallet addresses.
This ensures that any transaction involving the wallet's addresses is tracked in the Pending tab, regardless of whether a change output exists.
Motivation: Users performing consolidation or spending their full balance were left with no visual feedback in Caravan that their transaction was successfully broadcast and pending. This fix provides a reliable and consistent UI state.

Does this PR introduce a breaking change?

No.

Checklist
I have tested my changes thoroughly.
I have added or updated tests to cover my changes (if applicable).
I have verified that test coverage meets or exceeds 95% (if applicable).
I have run the test suite locally, and although some legacy environment issues exist, my changes do not introduce new regressions.
I have written tests for all new changes/features
I have followed the project's coding style and conventions (formatted with Prettier).
I have created a changeset to document my changes (npm run changeset)
Other information Successfully verified on Bitcoin Testnet using a 2-of-2 multisig wallet integrated with Sparrow. A "MAX" send (consolidation) was performed, and the transaction was correctly tracked in Caravan's "Pending" tab until it reached its first confirmation.

Have you read the contributing guide?
Yes

For information on creating and using changesets, please refer to our documentation on changesets.

@changeset-bot
Copy link

changeset-bot bot commented Feb 8, 2026

⚠️ No Changeset found

Latest commit: 66c41ac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
caravan-coordinator Ready Ready Preview, Comment Feb 8, 2026 5:23pm

Request Review

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.

Broken PendingTx Logic: getPendingTransactionIds fails to track transactions without change outputs (1:1, 2:2, etc.)

1 participant