Skip to content

Commit c921d23

Browse files
authored
fix getSystemConfigByKey tx_gas_price bug (#885)
1 parent 56504d8 commit c921d23

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/main/java/org/fisco/bcos/sdk/v3/client/ClientImpl.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -983,16 +983,13 @@ public void getPbftViewAsync(String node, RespCallback<PbftView> callback) {
983983

984984
@Override
985985
public SystemConfig getSystemConfigByKey(String key) {
986+
SystemConfig config = this.getSystemConfigByKey(nodeToSendRequest, key);
986987
if (key.equals(SystemConfigService.TX_GAS_PRICE)) {
987-
String gasPrice =
988-
this.getSystemConfigByKey(nodeToSendRequest, key).getSystemConfig().getValue();
989-
BigInteger gasPriceValue =
990-
BigInteger.valueOf(Integer.parseInt(Hex.trimPrefix(gasPrice), 10));
991-
this.getSystemConfigByKey(nodeToSendRequest, key)
992-
.getSystemConfig()
993-
.setValue(gasPriceValue.toString());
988+
String gasPrice = config.getSystemConfig().getValue();
989+
BigInteger gasPriceValue = new BigInteger(Hex.trimPrefix(gasPrice), 16);
990+
config.getSystemConfig().setValue(gasPriceValue.toString());
994991
}
995-
return this.getSystemConfigByKey(nodeToSendRequest, key);
992+
return config;
996993
}
997994

998995
@Override

0 commit comments

Comments
 (0)