Skip to content

Commit

Permalink
Ensure blocks are written before queried
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicletz committed Sep 23, 2024
1 parent 3775902 commit fbf3754
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/model/chainsql.ex
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ defmodule Model.ChainSql do
end

def state(block_hash) do
Writer.wait_for_flush(block_hash, "state")

case fetch!("SELECT state FROM blocks WHERE hash = ?1", block_hash) do
%Chain.State{} = state ->
# IO.inspect(state, label: "preuncompact")
Expand Down

0 comments on commit fbf3754

Please sign in to comment.