mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: light cleaning (#10385)
This commit is contained in:
@ -169,12 +169,11 @@ impl CanonicalInMemoryState {
|
||||
) -> Self {
|
||||
let in_memory_state = InMemoryState::new(blocks, numbers, pending);
|
||||
let head_state = in_memory_state.head_state();
|
||||
let header = match head_state {
|
||||
Some(state) => state.block().block().header.clone(),
|
||||
None => SealedHeader::default(),
|
||||
};
|
||||
let header =
|
||||
head_state.map(|state| state.block().block().header.clone()).unwrap_or_default();
|
||||
|
||||
let chain_info_tracker = ChainInfoTracker::new(header, finalized);
|
||||
let (canon_state_notification_sender, _canon_state_notification_receiver) =
|
||||
let (canon_state_notification_sender, _) =
|
||||
broadcast::channel(CANON_STATE_NOTIFICATION_CHANNEL_SIZE);
|
||||
|
||||
let inner = CanonicalInMemoryStateInner {
|
||||
@ -196,7 +195,7 @@ impl CanonicalInMemoryState {
|
||||
pub fn with_head(head: SealedHeader, finalized: Option<SealedHeader>) -> Self {
|
||||
let chain_info_tracker = ChainInfoTracker::new(head, finalized);
|
||||
let in_memory_state = InMemoryState::default();
|
||||
let (canon_state_notification_sender, _canon_state_notification_receiver) =
|
||||
let (canon_state_notification_sender, _) =
|
||||
broadcast::channel(CANON_STATE_NOTIFICATION_CHANNEL_SIZE);
|
||||
let inner = CanonicalInMemoryStateInner {
|
||||
chain_info_tracker,
|
||||
|
||||
@ -37,7 +37,7 @@ use tracing::trace;
|
||||
/// This type serves as the main entry point for interacting with the blockchain and provides data
|
||||
/// from database storage and from the blockchain tree (pending state etc.) It is a simple wrapper
|
||||
/// type that holds an instance of the database and the blockchain tree.
|
||||
#[allow(missing_debug_implementations)]
|
||||
#[derive(Debug)]
|
||||
pub struct BlockchainProvider2<DB> {
|
||||
/// Provider type used to access the database.
|
||||
database: ProviderFactory<DB>,
|
||||
|
||||
Reference in New Issue
Block a user