refactors

geth Node api change

sd ctor refactor
This commit is contained in:
2020-11-16 17:49:59 +08:00
parent ca8b3066d1
commit abff9bf045
3 changed files with 14 additions and 9 deletions
+6 -3
View File
@@ -45,8 +45,11 @@ type lvlDBReader interface {
// IService is the state-diffing service interface
type IService interface {
// APIs(), Protocols(), Start() and Stop()
node.Service
// Start() and Stop()
node.Lifecycle
// For node service registration
APIs() []rpc.API
Protocols() []p2p.Protocol
// Main event loop for processing state diffs
Loop(wg *sync.WaitGroup)
// Method to get state diff object at specific block
@@ -207,7 +210,7 @@ func (sds *Service) processStateTrie(block *types.Block, params sd.Params) (*sd.
}
// Start is used to begin the service
func (sds *Service) Start(*p2p.Server) error {
func (sds *Service) Start() error {
logrus.Info("starting statediff service")
go sds.Loop(new(sync.WaitGroup))
return nil