mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
Avoid repeated hashing (#3981)
This commit is contained in:
parent
48f69c0762
commit
3b8701296b
@ -24,7 +24,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
depositEventSignature = []byte("DepositEvent(bytes,bytes,bytes,bytes,bytes)")
|
||||
depositEventSignature = hashutil.HashKeccak256([]byte("DepositEvent(bytes,bytes,bytes,bytes,bytes)"))
|
||||
)
|
||||
|
||||
// Eth2GenesisPowchainInfo retrieves the genesis time and eth1 block number of the beacon chain
|
||||
@ -78,7 +78,7 @@ func (s *Service) ProcessLog(ctx context.Context, depositLog gethTypes.Log) erro
|
||||
s.processingLock.RLock()
|
||||
defer s.processingLock.RUnlock()
|
||||
// Process logs according to their event signature.
|
||||
if depositLog.Topics[0] == hashutil.HashKeccak256(depositEventSignature) {
|
||||
if depositLog.Topics[0] == depositEventSignature {
|
||||
if err := s.ProcessDepositLog(ctx, depositLog); err != nil {
|
||||
return errors.Wrap(err, "Could not process deposit log")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user