Commit 934cd0a7 authored by vipwzw's avatar vipwzw

auto ci

parent fbdd7d9f
......@@ -198,7 +198,7 @@ func (t *Ticket) CheckReceiptExecOk() bool {
// 自定义接口,用于删除不再需要保存的kv
// 比如 ticket 已经 close 之后就废弃了,可以删除
func expiredKVChecker(key ,value []byte) bool {
func expiredKVChecker(key, value []byte) bool {
// 由于 ticketBindKeyPrefix 包含了 ticketKeyPrefix,所以需要多做一次检查
if bytes.HasPrefix(key, ticketBindKeyPrefix) {
return false
......
......@@ -30,7 +30,7 @@ var tlog = log.New("module", "ticket.db")
//var addrSeed = []byte("address seed bytes for public key")
var (
ticketKeyPrefix = []byte("mavl-ticket-")
ticketKeyPrefix = []byte("mavl-ticket-")
ticketBindKeyPrefix = []byte("mavl-ticket-tbind-")
)
......
......@@ -81,9 +81,9 @@ type KVmMavlStore struct {
type subKVMVCCConfig struct {
EnableMVCCIter bool `json:"enableMVCCIter"`
EnableMVCCPrune bool `json:"enableMVCCPrune"`
PruneHeight int32 `json:"pruneHeight"` //每PruneHeight高度做一次状态精简
PruneHeight int32 `json:"pruneHeight"` //每PruneHeight高度做一次状态精简
EnableEmptyBlockHandle bool `json:"enableEmptyBlockHandle"`
ReservedHeight int64 `json:"reservedHeight"` //保留最新的ReservedHeight个区块的状态数据
ReservedHeight int64 `json:"reservedHeight"` //保留最新的ReservedHeight个区块的状态数据
}
type subMavlConfig struct {
......@@ -116,7 +116,7 @@ type subConfig struct {
// 使能空块处理
EnableEmptyBlockHandle bool `json:"enableEmptyBlockHandle"`
//保留的状态数据的高度
ReservedHeight int64 `json:"reservedHeight"`
ReservedHeight int64 `json:"reservedHeight"`
}
// New construct KVMVCCStore module
......
......@@ -32,8 +32,8 @@ var (
var (
//同common/db中的mvcc相关的定义保持一致
mvccPrefix = []byte(".-mvcc-.")
mvccMeta = append(mvccPrefix, []byte("m.")...)
mvccData = append(mvccPrefix, []byte("d.")...)
mvccMeta = append(mvccPrefix, []byte("m.")...)
mvccData = append(mvccPrefix, []byte("d.")...)
//mvccLast = append(mvccPrefix, []byte("l.")...)
mvccMetaVersion = append(mvccMeta, []byte("version.")...)
mvccMetaVersionKeyList = append(mvccMeta, []byte("versionkl.")...)
......@@ -130,7 +130,7 @@ func (mvccs *KVMVCCStore) MemSet(datas *types.StoreSet, hash []byte, sync bool)
mvccs.sync = sync
// 进行裁剪
if mvccs.kvmvccCfg != nil && mvccs.kvmvccCfg.EnableMVCCPrune &&
!isPruning() && datas.Height%int64(mvccs.kvmvccCfg.PruneHeight) == 0 {
!isPruning() && datas.Height%int64(mvccs.kvmvccCfg.PruneHeight) == 0 {
wg.Add(1)
go mvccs.pruningMVCC(datas.Height)
}
......@@ -500,7 +500,7 @@ func pruneDapp(db dbm.DB, name string, safeHeight int64) {
}
var prefix []byte
prefix = append(prefix, mvccData...)
prefix = append(prefix, "mavl-" + name...)
prefix = append(prefix, "mavl-"+name...)
it := db.Iterator(prefix, nil, true)
defer it.Close()
for it.Rewind(); it.Valid(); it.Next() {
......
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