From 4c317ba6415d2e3b967299eae0a5ba607041ce55 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 17 Jul 2018 11:18:14 -0400 Subject: [PATCH] Fix missed cache storage in ContractCodeSize --- state/database.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/state/database.go b/state/database.go index a96b4ad4..031f9814 100644 --- a/state/database.go +++ b/state/database.go @@ -178,7 +178,8 @@ func (db *Database) ContractCodeSize(addrHash, codeHash ethcommon.Hash) (int, er return cached.(int), nil } - return len(db.codeDB.Get(codeHash[:])), nil + code, err := db.ContractCode(addrHash, codeHash) + return len(code), err } // Commit commits the underlying Cosmos SDK multi-store returning the commit