mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
make epoch length a constant
This commit is contained in:
parent
67908450bf
commit
27bd304139
1 changed files with 3 additions and 1 deletions
|
|
@ -32,6 +32,8 @@ import (
|
|||
"github.com/ethereum/go-ethereum/rpc"
|
||||
)
|
||||
|
||||
const devEpochLength = 32
|
||||
|
||||
// withdrawalQueue implements a FIFO queue which holds withdrawals that are
|
||||
// pending inclusion.
|
||||
type withdrawalQueue struct {
|
||||
|
|
@ -158,7 +160,7 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal) error {
|
|||
payload := envelope.ExecutionPayload
|
||||
|
||||
var finalizedHash common.Hash
|
||||
if payload.Number%32 == 0 {
|
||||
if payload.Number%devEpochLength == 0 {
|
||||
finalizedHash = payload.BlockHash
|
||||
} else {
|
||||
finalizedHash = c.eth.BlockChain().GetBlockByNumber((payload.Number - 1) / 32 * 32).Hash()
|
||||
|
|
|
|||
Loading…
Reference in a new issue