Updated for the new db (#996)

* Updated for the new db

* Bumped version

* Sort out features

* Update to substrate master
This commit is contained in:
Arkadiy Paronyan
2020-04-15 15:08:51 +02:00
committed by GitHub
parent c6134cf91a
commit 280bf3928a
5 changed files with 290 additions and 254 deletions
+3 -3
View File
@@ -25,6 +25,7 @@ use log::trace;
use sc_network::config::{build_multiaddr, FinalityProofProvider, Role};
use sp_blockchain::{
Result as ClientResult, well_known_cache_keys::{self, Id as CacheKeyId}, Info as BlockchainInfo,
HeaderBackend,
};
use sc_client_api::{
BlockchainEvents, BlockImportNotification,
@@ -310,8 +311,7 @@ impl<D> Peer<D> {
/// by using .info(), you should probably use it instead of this.
pub fn blockchain_canon_equals(&self, other: &Self) -> bool {
if let (Some(mine), Some(others)) = (self.backend.clone(), other.backend.clone()) {
mine.as_in_memory().blockchain()
.canon_equals_to(others.as_in_memory().blockchain())
mine.blockchain().info().best_hash == others.blockchain().info().best_hash
} else {
false
}
@@ -320,7 +320,7 @@ impl<D> Peer<D> {
/// Count the total number of imported blocks.
pub fn blocks_count(&self) -> u64 {
self.backend.as_ref().map(
|backend| backend.blocks_count()
|backend| backend.blockchain().info().best_number as u64
).unwrap_or(0)
}