Reap takes maxTxs

This commit is contained in:
Jae Kwon
2016-03-06 15:08:32 -08:00
parent 03115cbf93
commit 2c1504f93c
4 changed files with 13 additions and 19 deletions

View File

@ -877,19 +877,8 @@ func (cs *ConsensusState) createProposalBlock() (block *types.Block, blockParts
return
}
maxBlockSize := config.GetInt("block_size")
// Mempool validated transactions
// if block_size < 0, no txs will be included
var txs []types.Tx
if maxBlockSize >= 0 {
txs = cs.mempool.Reap()
}
// Cap the number of txs in a block
if maxBlockSize > 0 && maxBlockSize < len(txs) {
txs = txs[:maxBlockSize]
}
txs := cs.mempool.Reap(config.GetInt("block_size"))
block = &types.Block{
Header: &types.Header{