def is_manager_saturated(connection_manager, registry_address, token_address): raiden = connection_manager.raiden open_channels = views.get_channelstate_filter( views.state_from_raiden(raiden), registry_address, token_address, lambda channel_state: (is_channel_open_and_funded(channel_state) and (channel_state.our_state.address == raiden.address or channel_state. partner_state.address == raiden.address)), ) return len(open_channels) >= connection_manager.initial_channel_target
def is_manager_saturated(connection_manager, registry_address, token_address): raiden = connection_manager.raiden open_channels = views.get_channelstate_filter( views.state_from_raiden(raiden), registry_address, token_address, lambda channel_state: ( is_channel_open_and_funded(channel_state) and ( channel_state.our_state.address == raiden.address or channel_state.partner_state.address == raiden.address ) ), ) return len(open_channels) >= connection_manager.initial_channel_target