mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 11:41:19 +00:00
rpcademon: changed erigon_getLogs() according changes done on erigon_getLatest() (#8417)
This commit is contained in:
parent
2a760e9c02
commit
02032ada42
@ -64,12 +64,13 @@ func (api *ErigonImpl) GetLogs(ctx context.Context, crit filters.FilterCriteria)
|
|||||||
defer tx.Rollback()
|
defer tx.Rollback()
|
||||||
|
|
||||||
if crit.BlockHash != nil {
|
if crit.BlockHash != nil {
|
||||||
number := rawdb.ReadHeaderNumber(tx, *crit.BlockHash)
|
header, err := api._blockReader.HeaderByHash(ctx, tx, *crit.BlockHash)
|
||||||
if number == nil {
|
if header == nil {
|
||||||
return nil, fmt.Errorf("block not found: %x", *crit.BlockHash)
|
return nil, err
|
||||||
}
|
}
|
||||||
begin = *number
|
begin = header.Number.Uint64()
|
||||||
end = *number
|
end = header.Number.Uint64()
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Convert the RPC block numbers into internal representations
|
// Convert the RPC block numbers into internal representations
|
||||||
latest, err := rpchelper.GetLatestBlockNumber(tx)
|
latest, err := rpchelper.GetLatestBlockNumber(tx)
|
||||||
@ -77,7 +78,7 @@ func (api *ErigonImpl) GetLogs(ctx context.Context, crit filters.FilterCriteria)
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
begin = latest
|
begin = 0
|
||||||
if crit.FromBlock != nil {
|
if crit.FromBlock != nil {
|
||||||
if crit.FromBlock.Sign() >= 0 {
|
if crit.FromBlock.Sign() >= 0 {
|
||||||
begin = crit.FromBlock.Uint64()
|
begin = crit.FromBlock.Uint64()
|
||||||
|
Loading…
Reference in New Issue
Block a user