From 675b7ed4f8c196c052898450609ad68b85d27248 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 30 Nov 2023 08:50:20 +0200 Subject: [PATCH] cormorant: default to existing descriptor timestamp when extending range --- .../sparrow/net/cormorant/bitcoind/BitcoindClient.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/BitcoindClient.java b/src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/BitcoindClient.java index cb52de04..6e85caa2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/BitcoindClient.java +++ b/src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/BitcoindClient.java @@ -330,8 +330,7 @@ public class BitcoindClient { ScanDate scanDate = entry.getValue(); ScanDate importedScanDate = importedDescriptors.get(entry.getKey()); if(scanDate.range != null && importedScanDate != null && importedScanDate.range != null && scanDate.range > importedScanDate.range) { - Date rescanSince = scanDate.rescanSince != null && (importedScanDate.rescanSince == null || scanDate.rescanSince.before(importedScanDate.rescanSince)) ? scanDate.rescanSince : importedScanDate.rescanSince; - importingDescriptors.put(entry.getKey(), new ScanDate(rescanSince, scanDate.range, false)); + importingDescriptors.put(entry.getKey(), new ScanDate(importedScanDate.rescanSince == null || scanDate.forceRescan ? scanDate.rescanSince : importedScanDate.rescanSince, scanDate.range, false)); } else if(scanDate.forceRescan) { if(scanDate.rescanSince != null && (importedScanDate == null || importedScanDate.rescanSince == null || scanDate.rescanSince.before(importedScanDate.rescanSince))) { importingDescriptors.put(entry.getKey(), new ScanDate(scanDate.rescanSince, importedScanDate != null ? importedScanDate.range : scanDate.range, false));