Return most recent state, even if it does block

This commit is contained in:
Ethan Frey 2017-10-10 16:16:25 +02:00
parent 5238448a46
commit 98e615709a

View File

@ -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