diff --git a/cyberwow/lib/controller/rpc.dart b/cyberwow/lib/controller/rpc.dart index c160c1d..05fb9bb 100644 --- a/cyberwow/lib/controller/rpc.dart +++ b/cyberwow/lib/controller/rpc.dart @@ -154,7 +154,7 @@ Future getConnectionsString() async => rpcString('get_connections', fiel Future rpcOther(String method) async { - final url = 'http://${host}:${config.port}/json_rpc'; + final url = 'http://${host}:${config.port}/${method}'; var response; try { @@ -189,17 +189,26 @@ Future rpcOtherString(String method, {String field}) async { // Future getTransactionPoolString() async => rpcOtherString('get_transaction_pool'); Future getTransactionPool() async => rpcOther('get_transaction_pool'); -Future> getTransactionPoolSimple() async { +Future> getTransactionPoolSimple() async { final response = await getTransactionPool(); - log.finer('getTransactionPoolSimple response: $response'); + // log.finer('getTransactionPoolSimple response: $response'); - if (response == null) return {}; + if (response == null) return []; // print('Response status: ${response.statusCode}'); if (response.statusCode != 200) { - return {}; + return []; } else { final responseBody = json.decode(response.body); - return responseBody; + var result = responseBody['transactions']; + result.forEach + ( + (tx) { + tx.remove('tx_blob'); + tx.remove('tx_json'); + tx.remove('last_failed_id_hash'); + } + ); + return result; } }