Skip to content

Commit 724fb06

Browse files
committed
Fix off-by-one in handshake, add debug logging
1 parent 98e6157 commit 724fb06

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/app.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ func (app *Basecoin) GetState() sm.SimpleDB {
5959
// Info - ABCI
6060
func (app *Basecoin) Info(req abci.RequestInfo) abci.ResponseInfo {
6161
resp := app.state.Info()
62+
app.logger.Debug("Info",
63+
"height", resp.LastBlockHeight,
64+
"hash", fmt.Sprintf("%X", resp.LastBlockAppHash))
6265
app.height = resp.LastBlockHeight
6366
return abci.ResponseInfo{
6467
Data: fmt.Sprintf("Basecoin v%v", version.Version),
@@ -70,7 +73,6 @@ func (app *Basecoin) Info(req abci.RequestInfo) abci.ResponseInfo {
7073
// InitState - used to setup state (was SetOption)
7174
// to be used by InitChain later
7275
func (app *Basecoin) InitState(key string, value string) string {
73-
7476
module, key := splitKey(key)
7577
state := app.state.Append()
7678

app/store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func (s *Store) Info() abci.ResponseInfo {
9999
"hash", fmt.Sprintf("%X", s.Hash()))
100100
return abci.ResponseInfo{
101101
Data: cmn.Fmt("size:%v", s.State.Size()),
102-
LastBlockHeight: s.height - 1,
102+
LastBlockHeight: s.height,
103103
LastBlockAppHash: s.Hash(),
104104
}
105105
}

0 commit comments

Comments
 (0)