- let check_tip_hash = maybe_await!(self.client.get_tip_hash())?;
- if check_tip_hash != tip_hash {
- tip_hash = check_tip_hash;
- continue;
+ match maybe_await!(self.client.get_tip_hash()) {
+ Ok(check_tip_hash) => {
+ if check_tip_hash != tip_hash {
+ tip_hash = check_tip_hash;
+
+ log_debug!(self.logger,
+ "Encountered inconsistency during transaction sync, restarting.");
+ sync_state.pending_sync = true;
+ continue;
+ }
+ num_confirmed += confirmed_txs.len();
+ sync_state.sync_confirmed_transactions(
+ &confirmables,
+ confirmed_txs
+ );
+ }
+ Err(err) => {
+ // (Semi-)permanent failure, retry later.
+ log_error!(self.logger,
+ "Failed during transaction sync, aborting. Synced so far: {} confirmed, {} unconfirmed.",
+ num_confirmed,
+ num_unconfirmed
+ );
+ sync_state.pending_sync = true;
+ return Err(TxSyncError::from(err));
+ }