Commit 0667b077 authored by liuyuhang's avatar liuyuhang

del len judge

parent 19c38a37
......@@ -11,6 +11,7 @@ import (
"github.com/33cn/chain33/common/version"
"github.com/33cn/chain33/types"
dbm "github.com/33cn/chain33/common/db"
)
// Upgrade 升级localDB和storeDB
......@@ -82,10 +83,7 @@ func (chain *BlockChain) ReExecBlock(startHeight, curHeight int64) {
if err != nil {
panic(fmt.Sprintf("execBlockEx connectBlock readd Txs fail height=%d err=%s, this not allow fail", i, err.Error()))
}
err = newbatch.Write()
if err != nil {
panic(err)
}
dbm.MustWrite(newbatch)
}
prevStateHash = block.StateHash
......
......@@ -267,10 +267,6 @@ func (mBatch *goLevelDBBatch) Delete(key []byte) {
}
func (mBatch *goLevelDBBatch) Write() error {
if mBatch.batch.Len() == 0 {
llog.Info("Write", "len", mBatch.batch.Len())
return nil
}
err := mBatch.db.db.Write(mBatch.batch, mBatch.wop)
if err != nil {
llog.Error("Write", "error", err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment