Skip to content

Commit

Permalink
Remove unused params.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickeskov committed May 31, 2024
1 parent b685c04 commit d285087
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 0 additions & 4 deletions pkg/state/appender.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,6 @@ func (a *txAppender) appendBlock(params *appendBlockParams) error {
lastSnapshotStateHash: params.lastSnapshotStateHash,
fixSnapshotsToInitialHash: params.fixSnapshotsToInitialHash,
currentBlockHeight: currentBlockHeight,
readOnly: false,
}
initialSnapshot, stateHash, err := a.createInitialDiffAndStateHash(createInitHashParams, hasher)
if err != nil {
Expand Down Expand Up @@ -873,7 +872,6 @@ type initialDiffAndStateHashParams struct {
lastSnapshotStateHash crypto.Digest
fixSnapshotsToInitialHash []proto.AtomicSnapshot
currentBlockHeight proto.Height
readOnly bool
}

// createInitialDiffAndStateHash creates the initial diff and state hash for the block.
Expand Down Expand Up @@ -1218,7 +1216,6 @@ func (a *txAppender) createNextSnapshotHash(
blockHeight proto.Height,
lastSnapshotStateHash crypto.Digest,
fixSnapshotsToInitialHash []proto.AtomicSnapshot,
readOnly bool,
) (crypto.Digest, error) {
hasher, err := newTxSnapshotHasherDefault()
if err != nil {
Expand All @@ -1233,7 +1230,6 @@ func (a *txAppender) createNextSnapshotHash(
lastSnapshotStateHash: lastSnapshotStateHash,
fixSnapshotsToInitialHash: fixSnapshotsToInitialHash,
currentBlockHeight: blockHeight,
readOnly: readOnly,
}
_, initSh, err := a.createInitialDiffAndStateHash(params, hasher)
if err != nil {
Expand Down
6 changes: 2 additions & 4 deletions pkg/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -2012,8 +2012,6 @@ func (s *stateManager) ValidateNextTx(
}

func (s *stateManager) CreateNextSnapshotHash(block *proto.Block) (crypto.Digest, error) {
const readOnly = true

blockchainHeight, err := s.Height()
if err != nil {
return crypto.Digest{}, err
Expand All @@ -2025,7 +2023,7 @@ func (s *stateManager) CreateNextSnapshotHash(block *proto.Block) (crypto.Digest
blockHeight := blockchainHeight + 1
// Generate blockchain fix snapshots for the given block in read only mode because all
// changes has been already applied in the context of the last applied block.
fixSnapshots, gbfErr := s.generateBlockchainFix(blockHeight, block.BlockID(), readOnly)
fixSnapshots, gbfErr := s.generateBlockchainFix(blockHeight, block.BlockID(), true)
if gbfErr != nil {
return crypto.Digest{}, errors.Wrapf(gbfErr, "failed to generate blockchain fix snapshots at block %s",
block.BlockID().String(),
Expand All @@ -2038,7 +2036,7 @@ func (s *stateManager) CreateNextSnapshotHash(block *proto.Block) (crypto.Digest
blockHeight,
)
}
return s.appender.createNextSnapshotHash(block, blockHeight, lastSnapshotStateHash, fixSnapshots, readOnly)
return s.appender.createNextSnapshotHash(block, blockHeight, lastSnapshotStateHash, fixSnapshots)
}

func (s *stateManager) IsActiveLightNodeNewBlocksFields(blockHeight proto.Height) (bool, error) {
Expand Down

0 comments on commit d285087

Please sign in to comment.