File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/main/java/org/tron/core/db Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 3
3
import com .google .protobuf .ByteString ;
4
4
import java .util .Objects ;
5
5
import lombok .extern .slf4j .Slf4j ;
6
+ import org .apache .commons .lang3 .BooleanUtils ;
6
7
import org .springframework .beans .factory .annotation .Autowired ;
7
8
import org .springframework .beans .factory .annotation .Value ;
8
9
import org .springframework .stereotype .Component ;
9
10
import org .tron .common .utils .ByteArray ;
10
11
import org .tron .core .capsule .TransactionInfoCapsule ;
11
12
import org .tron .core .capsule .TransactionRetCapsule ;
13
+ import org .tron .core .config .args .Args ;
12
14
import org .tron .core .exception .BadItemException ;
13
15
import org .tron .protos .Protocol .TransactionInfo ;
14
16
@@ -24,6 +26,13 @@ public TransactionRetStore(@Value("transactionRetStore") String dbName) {
24
26
super (dbName );
25
27
}
26
28
29
+ @ Override
30
+ public void put (byte [] key , TransactionRetCapsule item ) {
31
+ if (BooleanUtils .toBoolean (Args .getInstance ().getStorage ().getTransactionHistoreSwitch ())) {
32
+ super .put (key , item );
33
+ }
34
+ }
35
+
27
36
public TransactionInfoCapsule getTransactionInfo (byte [] key ) throws BadItemException {
28
37
long blockNumber = transactionStore .getBlockNumber (key );
29
38
if (blockNumber == -1 ) {
You can’t perform that action at this time.
0 commit comments