Skip to content

Commit 5919efa

Browse files
committed
eth/api,api_backend: Changed 'Finalized' block number to be valid in RPC API.
1 parent 1649a46 commit 5919efa

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

eth/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ func (api *PublicDebugAPI) DumpBlock(blockNr rpc.BlockNumber) (state.Dump, error
353353
if blockNr == rpc.LatestBlockNumber {
354354
block = api.eth.blockchain.CurrentBlock()
355355
} else if blockNr == rpc.FinalizedBlockNumber {
356-
block = api.eth.blockchain.CurrentFinalizedBlock()
356+
block = api.eth.blockchain.CurrentBlock()
357357
} else {
358358
block = api.eth.blockchain.GetBlockByNumber(uint64(blockNr))
359359
}
@@ -443,7 +443,7 @@ func (api *PublicDebugAPI) AccountRange(blockNrOrHash rpc.BlockNumberOrHash, sta
443443
if number == rpc.LatestBlockNumber {
444444
block = api.eth.blockchain.CurrentBlock()
445445
} else if number == rpc.FinalizedBlockNumber {
446-
block = api.eth.blockchain.CurrentFinalizedBlock()
446+
block = api.eth.blockchain.CurrentBlock()
447447
} else {
448448
block = api.eth.blockchain.GetBlockByNumber(uint64(number))
449449
}

eth/api_backend.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (b *EthAPIBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumb
7676
return b.eth.blockchain.CurrentBlock().Header(), nil
7777
}
7878
if number == rpc.FinalizedBlockNumber {
79-
return b.eth.blockchain.CurrentFinalizedBlock().Header(), nil
79+
return b.eth.blockchain.CurrentBlock().Header(), nil
8080
}
8181
return b.eth.blockchain.GetHeaderByNumber(uint64(number)), nil
8282
}
@@ -113,7 +113,7 @@ func (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumbe
113113
return b.eth.blockchain.CurrentBlock(), nil
114114
}
115115
if number == rpc.FinalizedBlockNumber {
116-
return b.eth.blockchain.CurrentFinalizedBlock(), nil
116+
return b.eth.blockchain.CurrentBlock(), nil
117117
}
118118
return b.eth.blockchain.GetBlockByNumber(uint64(number)), nil
119119
}

0 commit comments

Comments
 (0)