mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Revert "eth: remove check for tdd reached on pos api block tags (#27799)"
This reverts commit 7a2909ac49.
This commit is contained in:
parent
3531f18b6a
commit
1a3e5cf75d
1 changed files with 20 additions and 8 deletions
|
|
@ -78,18 +78,24 @@ func (b *EthAPIBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumb
|
|||
return b.eth.blockchain.CurrentBlock(), nil
|
||||
}
|
||||
if number == rpc.FinalizedBlockNumber {
|
||||
block := b.eth.blockchain.CurrentFinalBlock()
|
||||
if block == nil {
|
||||
return nil, errors.New("finalized block not found")
|
||||
if !b.eth.Merger().TDDReached() {
|
||||
return nil, errors.New("'finalized' tag not supported on pre-merge network")
|
||||
}
|
||||
return block, nil
|
||||
block := b.eth.blockchain.CurrentFinalBlock()
|
||||
if block != nil {
|
||||
return block, nil
|
||||
}
|
||||
return nil, errors.New("finalized block not found")
|
||||
}
|
||||
if number == rpc.SafeBlockNumber {
|
||||
block := b.eth.blockchain.CurrentSafeBlock()
|
||||
if block == nil {
|
||||
return nil, errors.New("safe block not found")
|
||||
if !b.eth.Merger().TDDReached() {
|
||||
return nil, errors.New("'safe' tag not supported on pre-merge network")
|
||||
}
|
||||
return block, nil
|
||||
block := b.eth.blockchain.CurrentSafeBlock()
|
||||
if block != nil {
|
||||
return block, nil
|
||||
}
|
||||
return nil, errors.New("safe block not found")
|
||||
}
|
||||
return b.eth.blockchain.GetHeaderByNumber(uint64(number)), nil
|
||||
}
|
||||
|
|
@ -130,6 +136,9 @@ func (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumbe
|
|||
return b.eth.blockchain.GetBlock(header.Hash(), header.Number.Uint64()), nil
|
||||
}
|
||||
if number == rpc.FinalizedBlockNumber {
|
||||
if !b.eth.Merger().TDDReached() {
|
||||
return nil, errors.New("'finalized' tag not supported on pre-merge network")
|
||||
}
|
||||
header := b.eth.blockchain.CurrentFinalBlock()
|
||||
if header == nil {
|
||||
return nil, errors.New("finalized block not found")
|
||||
|
|
@ -137,6 +146,9 @@ func (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumbe
|
|||
return b.eth.blockchain.GetBlock(header.Hash(), header.Number.Uint64()), nil
|
||||
}
|
||||
if number == rpc.SafeBlockNumber {
|
||||
if !b.eth.Merger().TDDReached() {
|
||||
return nil, errors.New("'safe' tag not supported on pre-merge network")
|
||||
}
|
||||
header := b.eth.blockchain.CurrentSafeBlock()
|
||||
if header == nil {
|
||||
return nil, errors.New("safe block not found")
|
||||
|
|
|
|||
Loading…
Reference in a new issue