File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
framework/src/main/java/org/tron/core/services/http Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 45
45
import org .tron .protos .Protocol .Transaction .Contract .ContractType ;
46
46
import org .tron .protos .contract .SmartContractOuterClass .CreateSmartContract ;
47
47
48
+ import static org .apache .commons .lang3 .StringUtils .isNotBlank ;
49
+ import static org .apache .commons .lang3 .StringUtils .startsWith ;
48
50
49
51
@ Slf4j (topic = "API" )
50
52
public class Util {
@@ -440,15 +442,9 @@ public static byte[] getAddress(HttpServletRequest request) throws Exception {
440
442
byte [] address = null ;
441
443
String addressParam = "address" ;
442
444
String addressStr = request .getParameter (addressParam );
443
- if (addressStr == null ) {
444
- String input = request .getReader ().lines ()
445
- .collect (Collectors .joining (System .lineSeparator ()));
446
- Util .checkBodySize (input );
447
- JSONObject jsonObject = JSONObject .parseObject (input );
448
- addressStr = jsonObject .getString (addressParam );
449
- }
450
- if (addressStr != null ) {
451
- if (addressStr .startsWith (Constant .ADD_PRE_FIX_STRING_MAINNET )) {
445
+ if (isNotBlank (addressStr )) {
446
+ if (startsWith (addressStr ,
447
+ Constant .ADD_PRE_FIX_STRING_MAINNET )) {
452
448
address = Hex .decode (addressStr );
453
449
} else {
454
450
address = Wallet .decodeFromBase58Check (addressStr );
You can’t perform that action at this time.
0 commit comments