fix: instantsend processing in background thread#293
fix: instantsend processing in background thread#293HashEngineering wants to merge 2 commits intomasterfrom
Conversation
📝 WalkthroughWalkthroughThis change introduces a non-threaded execution mode for InstantSendManager by adding a Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
core/src/main/java/org/bitcoinj/quorums/InstantSendManager.java (1)
434-445:⚠️ Potential issue | 🟠 MajorLogic error:
&&short-circuits despite comment saying "Don't short circuit".On line 441, the comment explicitly states "Don't short circuit. Try to process deterministic and not deterministic islocks", but using
&&will short-circuit if the first call returnsfalse, preventing the second call from executing.🐛 Proposed fix to prevent short-circuit evaluation
} else { // Don't short circuit. Try to process deterministic and not deterministic islocks - return processPendingInstantSendLocks(false) && processPendingInstantSendLocks(true); + boolean nonDeterministic = processPendingInstantSendLocks(false); + boolean deterministic = processPendingInstantSendLocks(true); + return nonDeterministic || deterministic; }Alternatively, use bitwise OR
|which doesn't short-circuit:return processPendingInstantSendLocks(false) | processPendingInstantSendLocks(true);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@core/src/main/java/org/bitcoinj/quorums/InstantSendManager.java` around lines 434 - 445, The method InstantSendManager.processPendingInstantSendLocks() currently uses logical AND which short-circuits and can prevent the second call to processPendingInstantSendLocks(true) from running despite the comment; change the control flow so both calls always execute (e.g., call processPendingInstantSendLocks(false) and processPendingInstantSendLocks(true) unconditionally and combine their results non-short-circuitingly) so deterministic and non-deterministic islocks are both processed; update the return to reflect the combined boolean result while keeping the existing isInitialized() and DIP0024Active check logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.run/Tests in 'dashj-master-three.core.test'.run.xml:
- Line 13: The Gradle task path is using the project's display name
':dashj-core:test' which Gradle won't resolve; update the option value to use
the actual project path ':core:test' (as defined by project(':core').name =
'dashj-core' in settings.gradle) so the task reference points to the correct
subproject task; locate the option element with value=":dashj-core:test" and
replace it with the project path ':core:test'.
- Line 21: The test run configuration has RunAsTest set to false which disables
IDE test runner integration for the "Tests in..." configuration; change the
RunAsTest value to true so IntelliJ recognizes test results, shows the test
tree, and reports pass/fail status (update the RunAsTest element in the "Tests
in..." run configuration XML accordingly).
---
Outside diff comments:
In `@core/src/main/java/org/bitcoinj/quorums/InstantSendManager.java`:
- Around line 434-445: The method
InstantSendManager.processPendingInstantSendLocks() currently uses logical AND
which short-circuits and can prevent the second call to
processPendingInstantSendLocks(true) from running despite the comment; change
the control flow so both calls always execute (e.g., call
processPendingInstantSendLocks(false) and processPendingInstantSendLocks(true)
unconditionally and combine their results non-short-circuitingly) so
deterministic and non-deterministic islocks are both processed; update the
return to reflect the combined boolean result while keeping the existing
isInitialized() and DIP0024Active check logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 547524d8-813d-437c-aad8-89c70afa76ff
📒 Files selected for processing (4)
.run/Tests in 'dashj-master-three.core.test'.run.xmlcore/src/main/java/org/bitcoinj/manager/DashSystem.javacore/src/main/java/org/bitcoinj/quorums/InstantSendManager.javacore/src/main/java/org/bitcoinj/quorums/LLMQBackgroundThread.java
Issue being fixed or feature implemented
What was done?
How Has This Been Tested?
Breaking Changes
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
Refactor
Chores