Commit e5a109f0 authored by vipwzw's avatar vipwzw

auto ci

parent afa2401a
......@@ -12,11 +12,12 @@
package main
import (
"net/http"
"runtime/debug"
_ "github.com/33cn/chain33/system"
"github.com/33cn/chain33/util/cli"
_ "github.com/33cn/plugin/plugin"
"net/http"
"runtime/debug"
)
func main() {
......
......@@ -5,15 +5,16 @@
package kvmvccmavl
import (
"bytes"
"fmt"
"strconv"
"sync/atomic"
"github.com/33cn/chain33/common"
dbm "github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/types"
"github.com/golang/protobuf/proto"
"sync/atomic"
"fmt"
"strconv"
"bytes"
)
const (
......@@ -280,7 +281,6 @@ func calcHash(datas proto.Message) []byte {
return common.Sha256(b)
}
//裁剪-------------------------------------------
// EnablePrune 使能裁剪
func EnablePrune(enable bool) {
......@@ -324,8 +324,8 @@ func pruningFirst(db dbm.DB, curHeight int64) {
continue
}
if curHeight < int64(height) + LevelPruningHeight &&
curHeight >= int64(height) + int64(pruneHeight) {
if curHeight < int64(height)+LevelPruningHeight &&
curHeight >= int64(height)+int64(pruneHeight) {
mp[string(key)] = append(mp[string(key)], height)
count++
}
......@@ -345,7 +345,7 @@ func deleteOldKV(mp map[string][]int64, curHeight int64, batch dbm.Batch) {
for key, vals := range mp {
if len(vals) > 1 && vals[1] != vals[0] { //防止相同高度时候出现的误删除
for _, val := range vals[1:] { //从第二个开始判断
if curHeight >= val + int64(pruneHeight) {
if curHeight >= val+int64(pruneHeight) {
batch.Delete(genKeyVersion([]byte(key), val)) // 删除老版本key
if batch.ValueSize() > batchDataSize {
batch.Write()
......@@ -368,7 +368,7 @@ func genKeyVersion(key []byte, height int64) []byte {
}
func getKeyVersion(vsnKey []byte) ([]byte, int64, error) {
if len(vsnKey) <= len(mvccData) + 1 + 20 {
if len(vsnKey) <= len(mvccData)+1+20 {
return nil, 0, types.ErrSize
}
sLen := vsnKey[len(vsnKey)-20:]
......
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