mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-09 12:31:21 +00:00
31 lines
555 B
Go
31 lines
555 B
Go
|
package process
|
||
|
|
||
|
import (
|
||
|
"github.com/ledgerwatch/turbo-geth/common"
|
||
|
"github.com/ledgerwatch/turbo-geth/consensus"
|
||
|
"github.com/ledgerwatch/turbo-geth/params"
|
||
|
)
|
||
|
|
||
|
type RemoteEngine struct {
|
||
|
consensus.Engine
|
||
|
|
||
|
consensus.EngineAPI
|
||
|
exit chan struct{}
|
||
|
}
|
||
|
|
||
|
func NewRemoteEngine(e consensus.Engine, config *params.ChainConfig) *RemoteEngine {
|
||
|
exit := make(chan struct{})
|
||
|
|
||
|
return &RemoteEngine{
|
||
|
e,
|
||
|
NewConsensusProcess(e, config, exit),
|
||
|
exit,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (r *RemoteEngine) Close() error {
|
||
|
err := r.Engine.Close()
|
||
|
common.SafeClose(r.exit)
|
||
|
return err
|
||
|
}
|