]> Untitled Git - bdk/commitdiff
[sync] check last derivation in cache to avoid recomputation
authorRiccardo Casatta <riccardo@casatta.it>
Mon, 16 Nov 2020 11:06:48 +0000 (12:06 +0100)
committerRiccardo Casatta <riccardo@casatta.it>
Mon, 16 Nov 2020 11:06:48 +0000 (12:06 +0100)
src/wallet/mod.rs

index 79ce77894b68529b01541f992ca75c037fb9b48e..94c5a122ca9ba916ba327c5740b1cd32f30dc638 100644 (file)
@@ -1268,7 +1268,7 @@ where
         if self
             .database
             .borrow()
-            .get_script_pubkey_from_path(ScriptType::External, max_address)?
+            .get_script_pubkey_from_path(ScriptType::External, max_address.saturating_sub(1))?
             .is_none()
         {
             run_setup = true;