consensus: fix a bug with index out of range
This commit is contained in:
parent
189a708988
commit
60f1648778
2 changed files with 64 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue