Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ where
/// * block_platform_state - A mutable reference to the current platform state in the block
/// execution context to be updated.
/// * core_block_height - The current block height in the Dash Core.
/// * is_init_chain - A boolean indicating if the chain is being initialized.
/// * start_from_scratch - A boolean indicating if we should start from scratch (eg. the chain is being initialized).
/// * block_info - A reference to the block information.
/// * transaction - The current groveDB transaction.
///
Expand All @@ -39,7 +39,7 @@ where
platform_state: Option<&PlatformState>,
block_platform_state: &mut PlatformState,
core_block_height: u32,
is_init_chain: bool,
start_from_scratch: bool,
block_info: &BlockInfo,
transaction: &Transaction,
platform_version: &PlatformVersion,
Expand All @@ -54,7 +54,7 @@ where
platform_state,
block_platform_state,
core_block_height,
is_init_chain,
start_from_scratch,
block_info,
transaction,
platform_version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ where
/// * block_platform_state - A mutable reference to the current platform state in the block
/// execution context to be updated.
/// * core_block_height - The current block height in the Dash Core.
/// * is_init_chain - A boolean indicating if the chain is being initialized.
/// * start_from_scratch - A boolean indicating if the chain is being initialized.
/// * block_info - A reference to the block information.
/// * transaction - The current groveDB transaction.
///
Expand All @@ -38,13 +38,14 @@ where
platform_state: Option<&PlatformState>,
block_platform_state: &mut PlatformState,
core_block_height: u32,
is_init_chain: bool,
start_from_scratch: bool,
block_info: &BlockInfo,
transaction: &Transaction,
platform_version: &PlatformVersion,
) -> Result<(), Error> {
// the core height of the block platform state is the last committed
if !is_init_chain && block_platform_state.last_committed_core_height() == core_block_height
if !start_from_scratch
&& block_platform_state.last_committed_core_height() == core_block_height
{
// if we get the same height that we know we do not need to update core info
return Ok(());
Expand All @@ -53,7 +54,7 @@ where
platform_state,
block_platform_state,
core_block_height,
is_init_chain,
start_from_scratch,
block_info,
transaction,
platform_version,
Expand All @@ -63,7 +64,7 @@ where
platform_state,
block_platform_state,
core_block_height,
false,
start_from_scratch,
platform_version,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ where
platform_state: Option<&PlatformState>,
block_platform_state: &mut PlatformState,
core_block_height: u32,
is_init_chain: bool,
start_from_scratch: bool,
block_info: &BlockInfo,
transaction: &Transaction,
platform_version: &PlatformVersion,
Expand All @@ -55,7 +55,7 @@ where
platform_state,
block_platform_state,
core_block_height,
is_init_chain,
start_from_scratch,
block_info,
transaction,
platform_version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ where
platform_state: Option<&PlatformState>,
block_platform_state: &mut PlatformState,
core_block_height: u32,
is_init_chain: bool,
start_from_scratch: bool,
block_info: &BlockInfo,
transaction: &Transaction,
platform_version: &PlatformVersion,
) -> Result<(), Error> {
if let Some(last_committed_block_info) =
block_platform_state.last_committed_block_info().as_ref()
{
if core_block_height == last_committed_block_info.basic_info().core_height {
if !start_from_scratch
&& core_block_height == last_committed_block_info.basic_info().core_height
{
tracing::debug!(
method = "update_masternode_list_v0",
"no update mnl at height {}",
Expand All @@ -66,7 +68,7 @@ where
} = self.update_state_masternode_list_v0(
block_platform_state,
core_block_height,
is_init_chain,
start_from_scratch,
)?;

self.update_masternode_identities(
Expand Down
Loading