async def wait_for_received_pending_htlcs_to_get_removed(self):
    assert (self.stopping_soon is True)
    async with TaskGroup() as group:
        for peer in self.peers.values():
            (await group.spawn(peer.wait_one_htlc_switch_iteration()))
    while True:
        if all(((not peer.received_htlcs_pending_removal) for peer in self.peers.values())):
            break
        async with TaskGroup(wait=any) as group:
            for peer in self.peers.values():
                (await group.spawn(peer.received_htlc_removed_event.wait()))
async def wait_for_received_pending_htlcs_to_get_removed(self):
    assert (self.stopping_soon is True)
    async with TaskGroup() as group:
        for peer in self.peers.values():
            (await group.spawn(peer.wait_one_htlc_switch_iteration()))
    while True:
        if all(((not peer.received_htlcs_pending_removal) for peer in self.peers.values())):
            break
        async with TaskGroup(wait=any) as group:
            for peer in self.peers.values():
                (await group.spawn(peer.received_htlc_removed_event.wait()))