Skip to content

Commit edee32e

Browse files
authored
pkg/log: set FromBlock on subscribe (#298)
1 parent ba2f4b5 commit edee32e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/log/eth_subscriber.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/ethereum/go-ethereum"
1111
"github.com/ethereum/go-ethereum/common"
1212
"github.com/ethereum/go-ethereum/core/types"
13+
"github.com/ethereum/go-ethereum/rpc"
1314

1415
"github.com/smartcontractkit/chainlink-common/pkg/logger"
1516
"github.com/smartcontractkit/chainlink-common/pkg/services"
@@ -204,6 +205,7 @@ func (sub *ethSubscriber) createSubscription(addresses []common.Address, topics
204205

205206
utils.RetryWithBackoff(ctx, func() (retry bool) {
206207
filterQuery := ethereum.FilterQuery{
208+
FromBlock: big.NewInt(rpc.LatestBlockNumber.Int64()),
207209
Addresses: addresses,
208210
Topics: [][]common.Hash{topics},
209211
}

0 commit comments

Comments
 (0)