mirror of
https://github.com/wownero/cyberwow.git
synced 2026-10-18 16:01:38 +02:00
sort rpcs by time
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user