sort rpcs by time

pull/2/head
fuwa 4 years ago
parent a855c44c8e
commit 5cc7d152c1

@ -119,7 +119,16 @@ Future<List<dynamic>> getConnectionsSimple() async {
const minActiveTime = 8;
final _activeConnections = _connections.where((x) => x['live_time'] > minActiveTime);
return _activeConnections.map
final _sortedConn = _activeConnections.cast<Map<String, dynamic>>().toList()..sort
(
(x, y) {
final int a = x['live_time'];
final int b = y['live_time'];
return a.compareTo(b);
}
);
return _sortedConn.map
(
(x) {
const _remove =

@ -82,7 +82,15 @@ Future<List<dynamic>> getTransactionPoolSimple() async {
return [];
}
else {
return Stream.fromIterable(result).asyncMap
final _sortedPool = result.cast<Map<String, dynamic>>()..sort
(
(x, y) {
final int a = x['receive_time'];
final int b = y['receive_time'];
return b.compareTo(a);
}
);
return Stream.fromIterable(_sortedPool).asyncMap
(
(x) async {
const _remove =