mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-30 04:37:12 +00:00
Make Counter app return nil hash initially
This commit is contained in:
+7
-3
@@ -68,10 +68,14 @@ func (appC *CounterAppContext) AppendTx(tx []byte) ([]types.Event, types.RetCode
|
||||
}
|
||||
|
||||
func (appC *CounterAppContext) GetHash() ([]byte, types.RetCode) {
|
||||
hash := make([]byte, 32)
|
||||
binary.PutVarint(hash, int64(appC.txCount))
|
||||
appC.hashCount += 1
|
||||
return hash, 0
|
||||
if appC.txCount == 0 {
|
||||
return nil, 0
|
||||
} else {
|
||||
hash := make([]byte, 32)
|
||||
binary.PutVarint(hash, int64(appC.txCount))
|
||||
return hash, 0
|
||||
}
|
||||
}
|
||||
|
||||
func (appC *CounterAppContext) Commit() types.RetCode {
|
||||
|
||||
Reference in New Issue
Block a user