mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-12 05:50:06 +00:00
fix wrong order of constructor (#2657)
This commit is contained in:
parent
98dea892c2
commit
71ec0938b5
@ -356,23 +356,6 @@ func New(stack *node.Node, config *ethconfig.Config, logger log.Logger) (*Ethere
|
|||||||
}
|
}
|
||||||
config.BodyDownloadTimeoutSeconds = 30
|
config.BodyDownloadTimeoutSeconds = 30
|
||||||
|
|
||||||
emptyBadHash := config.BadBlockHash == common.Hash{}
|
|
||||||
if !emptyBadHash {
|
|
||||||
var badBlockHeader *types.Header
|
|
||||||
if err = chainKv.View(context.Background(), func(tx kv.Tx) error {
|
|
||||||
header, hErr := rawdb.ReadHeaderByHash(tx, config.BadBlockHash)
|
|
||||||
badBlockHeader = header
|
|
||||||
return hErr
|
|
||||||
}); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if badBlockHeader != nil {
|
|
||||||
unwindPoint := badBlockHeader.Number.Uint64() - 1
|
|
||||||
backend.stagedSync.UnwindTo(unwindPoint, config.BadBlockHash)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var txPoolRPC txpool_proto.TxpoolServer
|
var txPoolRPC txpool_proto.TxpoolServer
|
||||||
var miningRPC txpool_proto.MiningServer
|
var miningRPC txpool_proto.MiningServer
|
||||||
if config.TxPool.V2 {
|
if config.TxPool.V2 {
|
||||||
@ -529,6 +512,23 @@ func New(stack *node.Node, config *ethconfig.Config, logger log.Logger) (*Ethere
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emptyBadHash := config.BadBlockHash == common.Hash{}
|
||||||
|
if !emptyBadHash {
|
||||||
|
var badBlockHeader *types.Header
|
||||||
|
if err = chainKv.View(context.Background(), func(tx kv.Tx) error {
|
||||||
|
header, hErr := rawdb.ReadHeaderByHash(tx, config.BadBlockHash)
|
||||||
|
badBlockHeader = header
|
||||||
|
return hErr
|
||||||
|
}); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if badBlockHeader != nil {
|
||||||
|
unwindPoint := badBlockHeader.Number.Uint64() - 1
|
||||||
|
backend.stagedSync.UnwindTo(unwindPoint, config.BadBlockHash)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().AllowUnprotectedTxs, eth, nil}
|
//eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().AllowUnprotectedTxs, eth, nil}
|
||||||
gpoParams := config.GPO
|
gpoParams := config.GPO
|
||||||
if gpoParams.Default == nil {
|
if gpoParams.Default == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user