reap max bytes from the mempool & check transaction size

See ADR 020: Limiting txs size inside a block docs/architecture/adr-020-block-size.md

Refs #2035
This commit is contained in:
Anton Kaliaev
2018-08-08 16:03:58 +04:00
parent 7b2f7090fd
commit d73c5cbdb1
33 changed files with 545 additions and 401 deletions

View File

@ -194,7 +194,8 @@ func newMockEvidencePool(val []byte) *mockEvidencePool {
}
}
func (m *mockEvidencePool) PendingEvidence() []types.Evidence {
// NOTE: maxBytes is ignored
func (m *mockEvidencePool) PendingEvidence(maxBytes int) []types.Evidence {
if m.height > 0 {
return m.ev
}
@ -207,7 +208,7 @@ func (m *mockEvidencePool) Update(block *types.Block, state sm.State) {
panic("block has no evidence")
}
}
m.height += 1
m.height++
}
//------------------------------------