What changed, and why it matters
A developer removed leftover debug code that artificially inflated the number of new transactions detected by one. With the extra '+1' in place, the wallet would think there was one more new transaction than actually existed, which could trigger a notification or UI update for a non-existent transaction. The fix simply deletes that '+1' so the count is accurate.
No immediate security action required. Verify that transaction notifications now match actual new transactions and that no similar debug artifacts remain elsewhere in periodic task logic.
Security signals we found
off-by-one in transaction notification count
debug artifact left in production code path
comment explicitly flagged the line for removal
Evidence from the diff
In lib/periodic_tasks.dart the runTxNotifier() function computes countOfNewTxs as currentTxCount - persistedTxCount + 1. The +1 was marked as debug code (‘REMOVE THIS’) and has now been removed. The change is a one-line correction of an off-by-one introduced during development. It affects transaction-notification logic but does not appear to alter balances, keys, or transaction validity.
Changed components
lib/periodic_tasks.dartrunTxNotifier() transaction notifierInspect captured patch +1 / −1
diff --git a/lib/periodic_tasks.dart b/lib/periodic_tasks.dart
index f876ac0..2a3d22c 100644
--- a/lib/periodic_tasks.dart
+++ b/lib/periodic_tasks.dart
@@ -52,7 +52,7 @@ Future<bool> runTxNotifier() async {
final persistedTxCount = await wallet.getPersistedTxHistoryCount();
final currentTxCount = wallet.txHistory.length;
- final countOfNewTxs = currentTxCount - persistedTxCount + 1; // REMOVE THIS
+ final countOfNewTxs = currentTxCount - persistedTxCount;
if (countOfNewTxs > 0 && currentTxCount != 0) {
log(LogLevel.info, '[TX Notifier] Found new transactions');
Why this scored 22/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.