@@ -61,6 +61,8 @@ public class DynamicPropertiesStore extends TronStoreWithRevoking<BytesCapsule>
61
61
private static final byte [] NON_EXISTENT_ACCOUNT_TRANSFER_MIN = "NON_EXISTENT_ACCOUNT_TRANSFER_MIN"
62
62
.getBytes ();
63
63
64
+ private static final byte [] OPERATING_TIME_INTERVAL = "OPERATING_TIME_INTERVAL" .getBytes ();
65
+
64
66
@ Autowired
65
67
private DynamicPropertiesStore (@ Qualifier ("properties" ) String dbName ) {
66
68
super (dbName );
@@ -172,6 +174,14 @@ private DynamicPropertiesStore(@Qualifier("properties") String dbName) {
172
174
this .saveNonExistentAccountTransferLimit (1_000_000L );
173
175
}
174
176
177
+
178
+ try {
179
+ this .getOperatingTimeInterval ();
180
+ } catch (IllegalArgumentException e ) {
181
+ this .saveOperatingTimeInterval (10_000L );
182
+ }
183
+
184
+
175
185
try {
176
186
this .getBlockFilledSlotsNumber ();
177
187
} catch (IllegalArgumentException e ) {
@@ -402,6 +412,22 @@ public long getNonExistentAccountTransferMin() {
402
412
() -> new IllegalArgumentException ("not found NON_EXISTENT_ACCOUNT_TRANSFER_MIN" ));
403
413
}
404
414
415
+
416
+ public void saveOperatingTimeInterval (long time ) {
417
+ logger .debug ("NON_EXISTENT_ACCOUNT_TRANSFER_MIN:" + time );
418
+ this .put (OPERATING_TIME_INTERVAL ,
419
+ new BytesCapsule (ByteArray .fromLong (time )));
420
+ }
421
+
422
+ public long getOperatingTimeInterval () {
423
+ return Optional .ofNullable (this .dbSource .getData (OPERATING_TIME_INTERVAL ))
424
+ .map (ByteArray ::toLong )
425
+ .orElseThrow (
426
+ () -> new IllegalArgumentException ("not found OPERATING_TIME_INTERVAL" ));
427
+ }
428
+
429
+
430
+
405
431
public void saveBlockFilledSlots (int [] blockFilledSlots ) {
406
432
logger .debug ("blockFilledSlots:" + intArrayToString (blockFilledSlots ));
407
433
this .put (BLOCK_FILLED_SLOTS ,
0 commit comments