From: Riccardo Casatta Date: Tue, 17 Nov 2020 12:46:10 +0000 (+0100) Subject: Use our Instant struct to be compatible with wasm X-Git-Tag: v0.2.0~65^2~10 X-Git-Url: http://internal-gitweb-vhost/%22https:/parse/scripts/database/-script/enum.FromScriptError.html?a=commitdiff_plain;h=2f39a19b0182b669fb76553d75a32510f02421f6;p=bdk Use our Instant struct to be compatible with wasm --- diff --git a/src/blockchain/utils.rs b/src/blockchain/utils.rs index c18b5fa4..bcfa19ba 100644 --- a/src/blockchain/utils.rs +++ b/src/blockchain/utils.rs @@ -26,6 +26,8 @@ use std::collections::{HashMap, HashSet}; #[allow(unused_imports)] use log::{debug, error, info, trace}; +use rand::seq::SliceRandom; +use rand::thread_rng; use bitcoin::{BlockHeader, OutPoint, Script, Transaction, Txid}; @@ -33,10 +35,8 @@ use super::*; use crate::database::{BatchDatabase, BatchOperations, DatabaseUtils}; use crate::error::Error; use crate::types::{ScriptType, TransactionDetails, UTXO}; +use crate::wallet::time::Instant; use crate::wallet::utils::ChunksIterator; -use rand::seq::SliceRandom; -use rand::thread_rng; -use std::time::Instant; #[derive(Debug)] pub struct ELSGetHistoryRes { @@ -71,7 +71,7 @@ pub trait ElectrumLikeSync { _progress_update: P, ) -> Result<(), Error> { // TODO: progress - let start = Instant::now(); + let start = Instant::new(); debug!("start setup"); let stop_gap = stop_gap.unwrap_or(20);