Unlock mutex on return (#6303)

Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
Jim McDonald 2020-06-18 17:04:08 +01:00 committed by GitHub
parent 5201403750
commit 10af753f59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -334,6 +334,7 @@ func (is *infostream) generatePendingValidatorInfo(info *ethpb.ValidatorInfo) (*
var ok bool
deposit, ok = fetchedDeposit.(*eth1Deposit)
if !ok {
is.eth1DepositsMutex.Unlock()
return nil, errors.New("cached eth1 deposit is not type *eth1Deposit")
}
} else {
@ -501,6 +502,7 @@ func (is *infostream) depositQueueTimestamp(eth1BlockNumber *big.Int) (uint64, e
var ok bool
blockTimestamp, ok = cachedTimestamp.(uint64)
if !ok {
is.eth1BlocktimesMutex.Unlock()
return 0, errors.New("cached timestamp is not type uint64")
}
} else {