consensus: fix a bug with index out of range

This commit is contained in:
Evgenii Stratonikov 2019-11-29 15:40:21 +03:00
parent 189a708988
commit 60f1648778
2 changed files with 64 additions and 2 deletions

View file

@ -304,8 +304,8 @@ func (s *service) getVerifiedTx(count int) []block.Transaction {
txx := pool.GetVerifiedTransactions()
res := make([]block.Transaction, len(txx)+1)
for i := 1; i < len(res); i++ {
res[i] = txx[i]
for i := range txx {
res[i+1] = txx[i]
}
for {