Merge pull request #2983 from nikkolasg/feat/cachedrand

Use cache of verified drand values
This commit is contained in:
Łukasz Magiera
2020-08-11 18:34:14 +02:00
committed by GitHub
+4
View File
@@ -171,6 +171,10 @@ func (db *DrandBeacon) VerifyEntry(curr types.BeaconEntry, prev types.BeaconEntr
// TODO handle genesis better
return nil
}
if be := db.getCachedValue(curr.Round); be != nil {
// return no error if the value is in the cache already
return nil
}
b := &dchain.Beacon{
PreviousSig: prev.Data,
Round: curr.Round,