mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +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()
|
||||
|
||||
if crit.BlockHash != nil {
|
||||
number := rawdb.ReadHeaderNumber(tx, *crit.BlockHash)
|
||||
if number == nil {
|
||||
return nil, fmt.Errorf("block not found: %x", *crit.BlockHash)
|
||||
header, err := api._blockReader.HeaderByHash(ctx, tx, *crit.BlockHash)
|
||||
if header == nil {
|
||||
return nil, err
|
||||
}
|
||||
begin = *number
|
||||
end = *number
|
||||
begin = header.Number.Uint64()
|
||||
end = header.Number.Uint64()
|
||||
|
||||
} else {
|
||||
// Convert the RPC block numbers into internal representations
|
||||
latest, err := rpchelper.GetLatestBlockNumber(tx)
|
||||
@ -77,7 +78,7 @@ func (api *ErigonImpl) GetLogs(ctx context.Context, crit filters.FilterCriteria)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
begin = latest
|
||||
begin = 0
|
||||
if crit.FromBlock != nil {
|
||||
if crit.FromBlock.Sign() >= 0 {
|
||||
begin = crit.FromBlock.Uint64()
|
||||
|
Loading…
Reference in New Issue
Block a user