mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
les: remove useless fields
This commit is contained in:
parent
0c51cefb85
commit
0dffdc91c3
2 changed files with 6 additions and 9 deletions
|
|
@ -20,7 +20,6 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
"sync"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
|
|
@ -38,15 +37,10 @@ var (
|
||||||
|
|
||||||
const maxBalance = math.MaxInt64
|
const maxBalance = math.MaxInt64
|
||||||
|
|
||||||
type clientApiFields struct {
|
|
||||||
balanceUpdatePeriod uint64
|
|
||||||
}
|
|
||||||
|
|
||||||
// PrivateLightServerAPI provides an API to access the LES light server.
|
// PrivateLightServerAPI provides an API to access the LES light server.
|
||||||
type PrivateLightServerAPI struct {
|
type PrivateLightServerAPI struct {
|
||||||
server *LesServer
|
server *LesServer
|
||||||
defaultPosFactors, defaultNegFactors priceFactors
|
defaultPosFactors, defaultNegFactors priceFactors
|
||||||
lock sync.Mutex
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewPrivateLightServerAPI creates a new LES light server API.
|
// NewPrivateLightServerAPI creates a new LES light server API.
|
||||||
|
|
@ -157,7 +151,8 @@ func (api *PrivateLightServerAPI) setParams(params map[string]interface{}, clien
|
||||||
case !defParams && name == "capacity":
|
case !defParams && name == "capacity":
|
||||||
if capacity, ok := value.(float64); ok && uint64(capacity) >= api.server.minCapacity {
|
if capacity, ok := value.(float64); ok && uint64(capacity) >= api.server.minCapacity {
|
||||||
err = api.server.clientPool.setCapacity(client, uint64(capacity))
|
err = api.server.clientPool.setCapacity(client, uint64(capacity))
|
||||||
updateFactors = true
|
// Don't have to call factor update explicitly. It's already done
|
||||||
|
// in setCapacity function.
|
||||||
} else {
|
} else {
|
||||||
err = errValue()
|
err = errValue()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,6 @@ type clientInfo struct {
|
||||||
balanceTracker balanceTracker
|
balanceTracker balanceTracker
|
||||||
posFactors, negFactors priceFactors
|
posFactors, negFactors priceFactors
|
||||||
balanceMetaInfo string
|
balanceMetaInfo string
|
||||||
clientApiFields
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// connSetIndex callback updates clientInfo item index in connectedQueue
|
// connSetIndex callback updates clientInfo item index in connectedQueue
|
||||||
|
|
@ -645,7 +644,10 @@ func (e *negBalance) DecodeRLP(s *rlp.Stream) error {
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// nodeDBVersion is the version identifier of the node data in db
|
// nodeDBVersion is the version identifier of the node data in db
|
||||||
nodeDBVersion = 0
|
//
|
||||||
|
// Changelog:
|
||||||
|
// * Replace `lastTotal` with `meta` in positive balance: version 0=>1
|
||||||
|
nodeDBVersion = 1
|
||||||
|
|
||||||
// dbCleanupCycle is the cycle of db for useless data cleanup
|
// dbCleanupCycle is the cycle of db for useless data cleanup
|
||||||
dbCleanupCycle = time.Hour
|
dbCleanupCycle = time.Hour
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue