Skip to content

Commit

Permalink
address #2250 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
mratsim committed Jan 21, 2021
1 parent c798406 commit 1271081
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions beacon_chain/spec/signatures_batch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,26 @@ func addSignatureSet[T](
## Add a new signature set triplet (pubkey, message, signature)
## to a collection of signature sets for batch verification.
## Can return false if `signature` wasn't deserialized to a valid BLS signature.
try:
let signing_root = compute_signing_root(
sszObj,
get_domain(
state.fork, domain,
epoch,
state.genesis_validators_root
)
).data

sigs.add((
pubkey,
signing_root,
signature.blsValue
))

return true
except FieldError: # bad discriminant when accessing signature.blsValue
if signature.kind != Real:
return false

let signing_root = compute_signing_root(
sszObj,
get_domain(
state.fork, domain,
epoch,
state.genesis_validators_root
)
).data

sigs.add((
pubkey,
signing_root,
signature.blsValue
))

return true

proc aggregateAttesters(
attestation: IndexedAttestation,
state: BeaconState
Expand Down

0 comments on commit 1271081

Please sign in to comment.