Skip to content

Commit

Permalink
Return most recent state, even if it does block
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Oct 10, 2017
1 parent 5238448 commit 98e6157
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,16 @@ func (s *Store) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery)

height := reqQuery.Height
if height == 0 {
if tree.Tree.VersionExists(s.height - 1) {
height = s.height - 1
} else {
height = s.height
}
// TODO: once the rpc actually passes in non-zero
// heights we can use to query right after a tx
// we must retrun most recent, even if apphash
// is not yet in the blockchain

// if tree.Tree.VersionExists(s.height - 1) {
// height = s.height - 1
// } else {
height = s.height
// }
}
resQuery.Height = height

Expand Down

0 comments on commit 98e6157

Please sign in to comment.