From 51346ccac7a955d1ea48f061ad2e12a42d3c8c37 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Thu, 9 Apr 2026 17:23:44 +0200 Subject: [PATCH] fix(sdk): call on_address_found for seeded balances in incremental-only sync In incremental-only mode, sync_address_balances seeds result.found from the provider's current_balances() but never calls on_address_found for those entries. This means the provider's internal state (e.g., found_balances in WalletAddressProvider) is never populated, making previously discovered addresses invisible to apply_results_to_wallet(). The fix adds on_address_found calls for each seeded entry, matching the behavior of the full tree scan path which already calls this callback. Co-Authored-By: Claude Opus 4.6 --- packages/rs-sdk/src/platform/address_sync/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/rs-sdk/src/platform/address_sync/mod.rs b/packages/rs-sdk/src/platform/address_sync/mod.rs index 08ad31c2997..434a35b3ab5 100644 --- a/packages/rs-sdk/src/platform/address_sync/mod.rs +++ b/packages/rs-sdk/src/platform/address_sync/mod.rs @@ -341,7 +341,13 @@ pub async fn sync_address_balances( start_height ); for (index, key, funds) in provider.current_balances() { - result.found.insert((index, key), funds); + result.found.insert((index, key.clone()), funds); + // Notify the provider so it can update its internal state + // (e.g., populate found_balances, extend gap limit). Without this, + // addresses discovered during a previous full scan are invisible to + // the consumer in incremental-only mode because on_address_found + // is the only path that populates the provider's found set. + provider.on_address_found(index, &key, funds); } start_height } else {