Skip to content

Commit

Permalink
Use Release to store, Acquire to read for atomic: `is_verifyi…
Browse files Browse the repository at this point in the history
…ng_unverified_blocks_on_startup`

Signed-off-by: Eval EXEC <[email protected]>
  • Loading branch information
eval-exec committed Feb 20, 2024
1 parent f39d7b8 commit aa29c93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chain/src/chain_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl ChainController {

pub fn is_verifying_unverified_blocks_on_startup(&self) -> bool {
self.is_verifying_unverified_blocks_on_startup
.load(std::sync::atomic::Ordering::Relaxed)
.load(std::sync::atomic::Ordering::Acquire)
}

pub fn asynchronous_process_remote_block(&self, remote_block: RemoteBlock) {
Expand Down
2 changes: 1 addition & 1 deletion chain/src/init_load_unverified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl InitLoadUnverified {
self.find_and_verify_unverified_blocks();

self.is_verifying_unverified_blocks_on_startup
.store(false, std::sync::atomic::Ordering::Relaxed);
.store(false, std::sync::atomic::Ordering::Release);
}

fn find_and_verify_unverified_blocks(&self) {
Expand Down

0 comments on commit aa29c93

Please sign in to comment.