getRecentAddresses method

List<NetworkAddress> getRecentAddresses(
  1. int maxAgeSeconds
)

Get addresses from the last N seconds

Implementation

List<NetworkAddress> getRecentAddresses(int maxAgeSeconds) {
  final cutoff = DateTime.now().millisecondsSinceEpoch ~/ 1000 - maxAgeSeconds;
  return addressList.where((addr) => addr.timestamp >= cutoff).toList();
}