Skip to content

Commit

Permalink
use blockrange from config for endpoint eth_getUserOperationByHash
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Oct 14, 2024
1 parent 0d9d008 commit f4cecc2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/rpc/rpcHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ export class RpcHandler implements IRpcEndpoint {
executor: Executor
monitor: Monitor
nonceQueuer: NonceQueuer
rpcMaxBlockRange: number | undefined
logger: Logger
metrics: Metrics
executorManager: ExecutorManager
Expand Down Expand Up @@ -617,9 +616,9 @@ export class RpcHandler implements IRpcEndpoint {

let fromBlock: bigint | undefined
let toBlock: "latest" | undefined
if (this.rpcMaxBlockRange !== undefined) {
if (this.config.maxBlockRange !== undefined) {
const latestBlock = await this.config.publicClient.getBlockNumber()
fromBlock = latestBlock - BigInt(this.rpcMaxBlockRange)
fromBlock = latestBlock - BigInt(this.config.maxBlockRange)
if (fromBlock < 0n) {
fromBlock = 0n
}
Expand Down

0 comments on commit f4cecc2

Please sign in to comment.