fix(coordinator): track pending transactions without change outputs u…#471
Open
RIYAKUMARI001 wants to merge 1 commit intocaravan-bitcoin:mainfrom
Open
fix(coordinator): track pending transactions without change outputs u…#471RIYAKUMARI001 wants to merge 1 commit intocaravan-bitcoin:mainfrom
RIYAKUMARI001 wants to merge 1 commit intocaravan-bitcoin:mainfrom
Conversation
…sing history scanning
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bugfix
Issue Number:
Fixes #407
Snapshots:
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.