fix(mempool): fix skipped txs' ptr when generate block.

This commit is contained in:
Lizen0512 2021-01-12 14:40:48 +08:00
parent 16cf3eb102
commit d377460c06
1 changed files with 3 additions and 2 deletions

View File

@ -1,11 +1,12 @@
package mempool
import (
"sync"
"github.com/google/btree"
"github.com/meshplus/bitxhub-model/pb"
raftproto "github.com/meshplus/bitxhub/pkg/order/etcdraft/proto"
"github.com/sirupsen/logrus"
"sync"
)
type mempoolImpl struct {
@ -146,7 +147,7 @@ func (mpi *mempoolImpl) generateBlock() (*raftproto.RequestBatch, error) {
if _, ok := skippedTxs[skippedTxn]; !ok {
break
}
mpi.txStore.batchedTxs[ptr] = true
mpi.txStore.batchedTxs[skippedTxn] = true
result = append(result, skippedTxn)
if uint64(len(result)) == batchSize {
return false