fix conflict

This commit is contained in:
Liam Lai 2024-10-15 19:51:57 -07:00
parent b43bb5ed1f
commit 5f1fb22e51
2 changed files with 12 additions and 0 deletions

View file

@ -17,6 +17,7 @@
package XDPoS
import (
"errors"
"fmt"
"math/big"
@ -549,3 +550,13 @@ func (x *XDPoS) CacheSigningTxs(hash common.Hash, txs []*types.Transaction) []*t
func (x *XDPoS) GetCachedSigningTxs(hash common.Hash) (interface{}, bool) {
return x.signingTxsCache.Get(hash)
}
func (x *XDPoS) GetEpochSwitchInfoBetween(chain consensus.ChainReader, begin, end *types.Header) ([]*types.EpochSwitchInfo, error) {
beginBlockVersion := x.config.BlockConsensusVersion(begin.Number, begin.Extra, ExtraFieldCheck)
endBlockVersion := x.config.BlockConsensusVersion(end.Number, end.Extra, ExtraFieldCheck)
if beginBlockVersion == params.ConsensusEngineVersion2 && endBlockVersion == params.ConsensusEngineVersion2 {
return x.EngineV2.GetEpochSwitchInfoBetween(chain, begin, end)
}
// Default "v1"
return nil, errors.New("not supported in the v1 consensus")
}

View file

@ -1,6 +1,7 @@
package engine_v2
import (
"errors"
"fmt"
"math/big"