mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
les: address comments
This commit is contained in:
parent
4ae18842d9
commit
3b7f338887
4 changed files with 6 additions and 6 deletions
|
|
@ -42,8 +42,8 @@ type CheckpointOracle struct {
|
|||
getLocal func(uint64) params.TrustedCheckpoint // Function used to retrieve local checkpoint
|
||||
}
|
||||
|
||||
// NewCheckpointOracle returns a checkpoint oracle handler.
|
||||
func NewCheckpointOracle(config *params.CheckpointOracleConfig, getLocal func(uint64) params.TrustedCheckpoint) *CheckpointOracle {
|
||||
// New creates a checkpoint oracle handler with given configs and callback.
|
||||
func New(config *params.CheckpointOracleConfig, getLocal func(uint64) params.TrustedCheckpoint) *CheckpointOracle {
|
||||
if config == nil {
|
||||
log.Info("Checkpoint registrar is not enabled")
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ func New(ctx *node.ServiceContext, config *eth.Config) (*LightEthereum, error) {
|
|||
if oracle == nil {
|
||||
oracle = params.CheckpointOracles[genesisHash]
|
||||
}
|
||||
leth.oracle = checkpointoracle.NewCheckpointOracle(oracle, leth.localCheckpoint)
|
||||
leth.oracle = checkpointoracle.New(oracle, leth.localCheckpoint)
|
||||
|
||||
// Note: AddChildIndexer starts the update process for the child
|
||||
leth.bloomIndexer.AddChildIndexer(leth.bloomTrieIndexer)
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ func NewLesServer(e *eth.Ethereum, config *eth.Config) (*LesServer, error) {
|
|||
if oracle == nil {
|
||||
oracle = params.CheckpointOracles[e.BlockChain().Genesis().Hash()]
|
||||
}
|
||||
srv.oracle = checkpointoracle.NewCheckpointOracle(oracle, srv.localCheckpoint)
|
||||
srv.oracle = checkpointoracle.New(oracle, srv.localCheckpoint)
|
||||
|
||||
// Initialize server capacity management fields.
|
||||
srv.defParams = flowcontrol.ServerParams{
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ func newTestClientHandler(backend *backends.SimulatedBackend, odr *LesOdr, index
|
|||
BloomRoot: light.GetBloomTrieRoot(db, index, sectionHead),
|
||||
}
|
||||
}
|
||||
oracle = checkpointoracle.NewCheckpointOracle(checkpointConfig, getLocal)
|
||||
oracle = checkpointoracle.New(checkpointConfig, getLocal)
|
||||
}
|
||||
client := &LightEthereum{
|
||||
lesCommons: lesCommons{
|
||||
|
|
@ -258,7 +258,7 @@ func newTestServerHandler(blocks int, indexers []*core.ChainIndexer, db ethdb.Da
|
|||
BloomRoot: light.GetBloomTrieRoot(db, index, sectionHead),
|
||||
}
|
||||
}
|
||||
oracle = checkpointoracle.NewCheckpointOracle(checkpointConfig, getLocal)
|
||||
oracle = checkpointoracle.New(checkpointConfig, getLocal)
|
||||
}
|
||||
server := &LesServer{
|
||||
lesCommons: lesCommons{
|
||||
|
|
|
|||
Loading…
Reference in a new issue