mirror of
https://github.com/Such-Software/xmrcheckout.git
synced 2026-10-19 06:08:36 +02:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user