halt processing if one of the operation functions fails (failed deposits due to BLS signature issues return as not-failed, so it remains consistant with that

This commit is contained in:
Dustin Brody 2020-05-23 19:43:05 +02:00 committed by tersec
parent 67ba11cc1a
commit 74e35c464f
1 changed files with 4 additions and 2 deletions

View File

@ -326,11 +326,13 @@ proc process_operations(state: var BeaconState, body: BeaconBlockBody,
template for_ops_cached(operations: auto, fn: auto) =
for operation in operations:
discard fn(state, operation, flags, stateCache)
if not fn(state, operation, flags, stateCache):
return false
template for_ops(operations: auto, fn: auto) =
for operation in operations:
discard fn(state, operation, flags)
if not fn(state, operation, flags):
return false
for_ops_cached(body.proposer_slashings, process_proposer_slashing)
for_ops_cached(body.attester_slashings, process_attester_slashing)