Browse Source

check it has been committed before verifying

pull/4743/head
Callum 5 years ago
parent
commit
1e6de1ec94
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      state/validation.go

+ 5
- 3
state/validation.go View File

@ -132,12 +132,14 @@ func validateBlock(evidencePool EvidencePool, stateDB dbm.DB, state State, block
// Validate all evidence.
for _, ev := range block.Evidence.Evidence {
if evidencePool != nil {
if evidencePool.IsCommitted(ev) {
return types.NewErrEvidenceInvalid(ev, errors.New("evidence was already committed"))
}
}
if err := VerifyEvidence(stateDB, state, ev, &block.Header); err != nil {
return types.NewErrEvidenceInvalid(ev, err)
}
if evidencePool != nil && evidencePool.IsCommitted(ev) {
return types.NewErrEvidenceInvalid(ev, errors.New("evidence was already committed"))
}
}
// NOTE: We can't actually verify it's the right proposer because we dont


Loading…
Cancel
Save