bridge/pkg/ethereum: fix guardian set update processing

We reused an expired context. No direct impact because the routine would crash
and re-fetch the guardian set.
This commit is contained in:
Leo 2021-02-03 00:09:46 +01:00
parent 8478735ea7
commit 8735b587cb
1 changed files with 2 additions and 0 deletions

View File

@ -204,7 +204,9 @@ func (e *EthBridgeWatcher) Run(ctx context.Context) error {
guardianSetChangesConfirmed.Inc()
msm := time.Now()
timeout, cancel = context.WithTimeout(ctx, 15*time.Second)
gs, err := caller.GetGuardianSet(&bind.CallOpts{Context: timeout}, ev.NewGuardianIndex)
cancel()
queryLatency.WithLabelValues("get_guardian_set").Observe(time.Since(msm).Seconds())
if err != nil {
// We failed to process the guardian set update and are now out of sync with the chain.