tests: sync balances before multi-destination sends
What changed, and why it matters
This commit only changes a test file. It makes a wallet test wait for mining to stop and sync balances before checking send results. There is no change to production wallet code, no user-facing behavior change, and no security fix.
No security action needed. Treat as routine test reliability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds three lines to TestMoneroWalletCommon.java inside testSendToMultiple(): it stops daemon mining if active and calls wallet.sync() before capturing balances used in multi-destination send assertions. This is a test-hardening change to avoid flaky balance assertions caused by unmined blocks. No library code is modified.
Changed components
src/test/java/TestMoneroWalletCommon.javaInspect captured patch +4 / −0
### src/test/java/TestMoneroWalletCommon.java
@@ -3565,6 +3565,10 @@ public void testSubtractFeeFromSplit() {
private void testSendToMultiple(int numAccounts, int numSubaddressesPerAccount, boolean canSplit, BigInteger sendAmountPerSubaddress) { testSendToMultiple(numAccounts, numSubaddressesPerAccount, canSplit, sendAmountPerSubaddress, false); }
private void testSendToMultiple(int numAccounts, int numSubaddressesPerAccount, boolean canSplit, BigInteger sendAmountPerSubaddress, boolean subtractFeeFromDestinations) {
TestUtils.WALLET_TX_TRACKER.waitForTxsToClearPool(wallet);
+
+ // include the last mined blocks before measuring balance changes
+ if (daemon.getMiningStatus().isActive()) daemon.stopMining();
+ wallet.sync();
// compute the minimum account unlocked balance needed in order to fulfill the config
BigInteger minAccountAmount = null;Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.