mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
Import target block body during warp sync (#12300)
* Receive and import target block body * Request target block * minor: wording * Check for block body in the test * Import target block justifications * Fix: do not fail block validation if no justifications received * Fix: import target blocks without justifications Co-authored-by: arkpar <arkady.paronyan@gmail.com>
This commit is contained in:
@@ -69,7 +69,7 @@ use sc_network_sync::{
|
||||
use sc_service::client::Client;
|
||||
use sp_blockchain::{
|
||||
well_known_cache_keys::{self, Id as CacheKeyId},
|
||||
HeaderBackend, Info as BlockchainInfo, Result as ClientResult,
|
||||
Backend as BlockchainBackend, HeaderBackend, Info as BlockchainInfo, Result as ClientResult,
|
||||
};
|
||||
use sp_consensus::{
|
||||
block_validation::{BlockAnnounceValidator, DefaultBlockAnnounceValidator},
|
||||
@@ -540,6 +540,13 @@ where
|
||||
.map(|backend| backend.blockchain().header(BlockId::hash(*hash)).unwrap().is_some())
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
pub fn has_body(&self, hash: &H256) -> bool {
|
||||
self.backend
|
||||
.as_ref()
|
||||
.map(|backend| backend.blockchain().body(BlockId::hash(*hash)).unwrap().is_some())
|
||||
.unwrap_or(false)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait BlockImportAdapterFull:
|
||||
|
||||
Reference in New Issue
Block a user