]> Untitled Git - bdk/commitdiff
Remove sync verification
authorrajarshimaitra <rajarshi149@gmail.com>
Thu, 16 Dec 2021 15:21:18 +0000 (20:51 +0530)
committerrajarshimaitra <rajarshi149@gmail.com>
Wed, 9 Feb 2022 06:59:46 +0000 (12:29 +0530)
The default sync verification is removed from wallet module.
By default sync time verification only makes sense for `electrum` and
`esplora` backend as they are usually untrusted 3rd party services.

script verification for transaction is costly, so removing default
script verification optimizes performance.

src/wallet/mod.rs

index bf7993d40a5e5f0ac26edaa75c39ae4da68a094d..8c3c968b724506eadbada83ce1e2da3ae794e9b9 100644 (file)
@@ -1537,23 +1537,6 @@ where
                 .sync(self.database.borrow_mut().deref_mut(), progress_update,))?;
         }
 
-        #[cfg(feature = "verify")]
-        {
-            debug!("Verifying transactions...");
-            for mut tx in self.database.borrow().iter_txs(true)? {
-                if !tx.verified {
-                    verify::verify_tx(
-                        tx.transaction.as_ref().ok_or(Error::TransactionNotFound)?,
-                        self.database.borrow().deref(),
-                        &self.client,
-                    )?;
-
-                    tx.verified = true;
-                    self.database.borrow_mut().set_tx(&tx)?;
-                }
-            }
-        }
-
         let sync_time = SyncTime {
             block_time: BlockTime {
                 height: maybe_await!(self.client.get_height())?,