Optimize flush logics of a block in lcimport
package main
import (
+ "bytes"
"math/big"
"github.com/icon-project/goloop/common/codec"
@@ -99,8 +100,11 @@ func (b *Block) Flush() error {
return err
}
}
+ if b.rcts == nil || !bytes.Equal(b.rcts.Hash(), b.oldRcts.Hash()) {
return b.oldRcts.Flush()
}
+ return nil
+}
func (b *Block) Reset(database db.Database, bs []byte) error {
var header blockHeader
