Skip to content

Commit

Permalink
granular locks
Browse files Browse the repository at this point in the history
  • Loading branch information
phearnot committed Feb 29, 2024
1 parent 85cc35d commit ec13161
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ class BlockchainUpdaterImpl(
challengedHitSource: Option[ByteStr] = None,
verify: Boolean = true,
txSignParCheck: Boolean = true
): Either[ValidationError, BlockApplyResult] =
writeLock {
): Either[ValidationError, BlockApplyResult] = {
val height = rocksdb.height
val notImplementedFeatures: Set[Short] = rocksdb.activatedFeaturesAt(height).diff(BlockchainFeatures.implemented)

Expand Down Expand Up @@ -335,7 +334,7 @@ class BlockchainUpdaterImpl(
verify,
txSignParCheck = txSignParCheck
)
} yield {
} yield writeLock {
val tempBlockchain = SnapshotBlockchain(
referencedBlockchain,
differResult.snapshot,
Expand Down Expand Up @@ -505,7 +504,7 @@ class BlockchainUpdaterImpl(
microBlock: MicroBlock,
snapshot: Option[MicroBlockSnapshot],
verify: Boolean = true
): Either[ValidationError, BlockId] = writeLock {
): Either[ValidationError, BlockId] = {
ngState match {
case None =>
Left(MicroBlockAppendError("No base block exists", microBlock))
Expand Down

0 comments on commit ec13161

Please sign in to comment.