Skip to content

Commit

Permalink
Fix synchronizer lock when creating mutable storage
Browse files Browse the repository at this point in the history
  • Loading branch information
lebdron committed Sep 24, 2017
1 parent 80fea56 commit b4b4921
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions irohad/ametsuchi/impl/storage_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ namespace iroha {

nonstd::optional<hash256_t> top_hash;

blocks_->getTopBlocks(1).as_blocking().subscribe(
[&top_hash](auto block) { top_hash = block.hash; });
blocks_->getTopBlocks(1)
.subscribe_on(rxcpp::observe_on_new_thread())
.as_blocking()
.subscribe([&top_hash](auto block) { top_hash = block.hash; });

return std::make_unique<MutableStorageImpl>(
top_hash.value_or(hash256_t{}),
Expand Down

0 comments on commit b4b4921

Please sign in to comment.