fix: wallet restore height — look back ~2 days instead of current height

When generate_from_keys creates a new wallet file (first open on a
wallet-rpc instance, or after cache loss), restore_height was set to
the current daemon height. This means the wallet only scans from NOW,
missing any payments sent before the wallet was opened.

A 1440-block lookback (~2 days at ~2 min/block) ensures recent
payments are found after container restarts or wallet cache loss.
This commit is contained in:
jwinterm
2026-03-31 09:43:38 -04:00
parent a15569c535
commit 25ce077484
+4 -1
View File
@@ -393,7 +393,10 @@ class MoneroWalletService:
)
except (RPCError, RequestException):
try:
restore_height = self._daemon_height() or 0
# Look back ~2 days (1440 blocks at ~2 min/block) so new wallet
# files can find payments that arrived before the wallet was opened.
daemon_height = self._daemon_height() or 0
restore_height = max(0, daemon_height - 1440)
gen_start = time.monotonic()
# generate_from_keys opens the wallet when successful.
backend.client.raw_request(