def remove_old_nodes(nodes, delta):
    '\n    remove nodes older than a certain limit\n    '
    limit = (NOW_TIMESTAMP - delta)
    old_keys = []
    for (key, node) in nodes.items():
        if (node.lastseen < limit):
            old_keys.append(key)
    count = 0
    for key in old_keys:
        del nodes[key]
        count += 1
    print('Removed {} old nodes'.format(count))
remove nodes older than a certain limit
def remove_old_nodes(nodes, delta):
    '\n    \n    '
    limit = (NOW_TIMESTAMP - delta)
    old_keys = []
    for (key, node) in nodes.items():
        if (node.lastseen < limit):
            old_keys.append(key)
    count = 0
    for key in old_keys:
        del nodes[key]
        count += 1
    print('Removed {} old nodes'.format(count))