|
33 | 33 | import org.joda.time.DateTime; |
34 | 34 | import org.spongycastle.util.encoders.Hex; |
35 | 35 | import org.springframework.beans.factory.annotation.Autowired; |
36 | | -import org.springframework.beans.factory.annotation.Qualifier; |
37 | 36 | import org.springframework.stereotype.Component; |
38 | 37 | import org.tron.common.overlay.discover.node.Node; |
39 | 38 | import org.tron.common.runtime.Runtime; |
|
57 | 56 | import org.tron.core.config.Parameter.ChainConstant; |
58 | 57 | import org.tron.core.config.args.Args; |
59 | 58 | import org.tron.core.config.args.GenesisBlock; |
60 | | -import org.tron.core.db.AbstractRevokingStore.Dialog; |
61 | 59 | import org.tron.core.db.KhaosDatabase.KhaosBlock; |
62 | 60 | import org.tron.core.db2.core.ISession; |
63 | 61 | import org.tron.core.exception.AccountResourceInsufficientException; |
@@ -132,11 +130,12 @@ public class Manager { |
132 | 130 |
|
133 | 131 |
|
134 | 132 | private BlockCapsule genesisBlock; |
| 133 | + @Getter |
135 | 134 | @Autowired |
136 | 135 | private RevokingDatabase revokingStore; |
137 | 136 |
|
138 | 137 | @Getter |
139 | | - private SessionOptional dialog = SessionOptional.instance(); |
| 138 | + private SessionOptional session = SessionOptional.instance(); |
140 | 139 |
|
141 | 140 | @Getter |
142 | 141 | @Setter |
@@ -520,8 +519,8 @@ public boolean pushTransactions(final TransactionCapsule trx) |
520 | 519 |
|
521 | 520 | //validateFreq(trx); |
522 | 521 | synchronized (this) { |
523 | | - if (!dialog.valid()) { |
524 | | - dialog.setValue(revokingStore.buildSession()); |
| 522 | + if (!session.valid()) { |
| 523 | + session.setValue(revokingStore.buildSession()); |
525 | 524 | } |
526 | 525 |
|
527 | 526 | try (ISession tmpSession = revokingStore.buildSession()) { |
@@ -578,7 +577,7 @@ private void doValidateFreq(long balance, int transNumber, long latestOperationT |
578 | 577 | * when switch fork need erase blocks on fork branch. |
579 | 578 | */ |
580 | 579 | public void eraseBlock() { |
581 | | - dialog.reset(); |
| 580 | + session.reset(); |
582 | 581 | try { |
583 | 582 | BlockCapsule oldHeadBlock = getBlockById( |
584 | 583 | getDynamicPropertiesStore().getLatestBlockHeaderHash()); |
@@ -992,8 +991,8 @@ public synchronized BlockCapsule generateBlock( |
992 | 991 |
|
993 | 992 | final BlockCapsule blockCapsule = |
994 | 993 | new BlockCapsule(number + 1, preHash, when, witnessCapsule.getAddress()); |
995 | | - dialog.reset(); |
996 | | - dialog.setValue(revokingStore.buildSession()); |
| 994 | + session.reset(); |
| 995 | + session.setValue(revokingStore.buildSession()); |
997 | 996 | Iterator iterator = pendingTransactions.iterator(); |
998 | 997 | while (iterator.hasNext()) { |
999 | 998 | TransactionCapsule trx = (TransactionCapsule) iterator.next(); |
@@ -1043,7 +1042,7 @@ public synchronized BlockCapsule generateBlock( |
1043 | 1042 | } |
1044 | 1043 | } |
1045 | 1044 |
|
1046 | | - dialog.reset(); |
| 1045 | + session.reset(); |
1047 | 1046 |
|
1048 | 1047 | if (postponedTrxCount > 0) { |
1049 | 1048 | logger.info("{} transactions over the block size limit", postponedTrxCount); |
@@ -1191,7 +1190,6 @@ public void updateLatestSolidifiedBlock() { |
1191 | 1190 | return; |
1192 | 1191 | } |
1193 | 1192 | getDynamicPropertiesStore().saveLatestSolidifiedBlockNum(latestSolidifiedBlockNum); |
1194 | | - revokingStore.solidify(); |
1195 | 1193 | logger.info("update solid block, num = {}", latestSolidifiedBlockNum); |
1196 | 1194 | } |
1197 | 1195 |
|
|
0 commit comments