Skip to content

Commit db330cd

Browse files
committed
solving generate block problem
1 parent bb7036f commit db330cd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/main/java/org/tron/core/db/Manager.java‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,9 +1083,10 @@ public synchronized BlockCapsule generateBlock(
10831083

10841084
Iterator iterator = pendingTransactions.iterator();
10851085
while (iterator.hasNext() || repushTransactions.size() > 0) {
1086-
1086+
boolean fromPending = false;
10871087
TransactionCapsule trx;
10881088
if (iterator.hasNext()) {
1089+
fromPending = true;
10891090
trx = (TransactionCapsule) iterator.next();
10901091
} else {
10911092
trx = repushTransactions.poll();
@@ -1110,7 +1111,9 @@ public synchronized BlockCapsule generateBlock(
11101111
tmpSeesion.merge();
11111112
// push into block
11121113
blockCapsule.addTransaction(trx);
1113-
iterator.remove();
1114+
if (fromPending){
1115+
iterator.remove();
1116+
}
11141117
} catch (ContractExeException e) {
11151118
logger.info("contract not processed during execute");
11161119
logger.debug(e.getMessage(), e);

0 commit comments

Comments
 (0)