-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(coinjoin): account for 0 diff transactions when emitting events #269
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThe changes in the Wallet.java file modify the transaction processing logic, specifically adjusting how the wallet notifies listeners about coin transactions. The modifications expand the conditions for triggering notifications, allowing listeners to be informed about transactions even when the balance remains unchanged or experiences minimal changes. This update provides more comprehensive transaction event reporting within the wallet's event notification mechanism. Changes
Poem
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
core/src/main/java/org/bitcoinj/wallet/Wallet.java (1)
2423-2427
: Consider documenting the event emission behaviorThe event emission logic handles an important edge case for CoinJoin transactions. Consider adding a comment explaining why zero-diff transactions need to emit coinsReceived events, as this behavior may not be immediately obvious to future maintainers.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
core/src/main/java/org/bitcoinj/wallet/Wallet.java
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: JAVA 11 OS macOS-latest Gradle
- GitHub Check: Analyze (java)
- GitHub Check: JAVA 11 OS ubuntu-latest Gradle
🔇 Additional comments (2)
core/src/main/java/org/bitcoinj/wallet/Wallet.java (2)
2423-2425
: LGTM! Improved handling of zero-diff transactionsThe change to include
diff >= 0
instead of justdiff > 0
correctly implements support for CoinJoin transactions that may have zero balance difference.
2425-2427
: LGTM! Maintains correct behavior for sent coinsThe else block correctly handles the case when coins are sent (diff < 0) by queueing the appropriate coinsSent event.
Issue being fixed or feature implemented
CoinJoin transactions have a zero amount, preventing sent/received events from being emitted.
What was done?
diff >= 0
to emit thecoinsReceived
event.How Has This Been Tested?
QA
Breaking Changes
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit