async def tx_request_and_timeout(full_node: FullNode, transaction_id, task_id):
    counter = 0
    try:
        while True:
            if (counter == 5):
                break
            if (transaction_id not in full_node.full_node_store.peers_with_tx):
                break
            peers_with_tx: Set = full_node.full_node_store.peers_with_tx[transaction_id]
            if (len(peers_with_tx) == 0):
                break
            peer_id = peers_with_tx.pop()
            assert (full_node.server is not None)
            if (peer_id not in full_node.server.all_connections):
                continue
            peer = full_node.server.all_connections[peer_id]
            request_tx = full_node_protocol.RequestTransaction(transaction.transaction_id)
            msg = make_msg(ProtocolMessageTypes.request_transaction, request_tx)
            (await peer.send_message(msg))
            (await asyncio.sleep(5))
            counter += 1
            if full_node.mempool_manager.seen(transaction_id):
                break
    except asyncio.CancelledError:
        pass
    finally:
        if (transaction_id in full_node.full_node_store.peers_with_tx):
            full_node.full_node_store.peers_with_tx.pop(transaction_id)
        if (transaction_id in full_node.full_node_store.pending_tx_request):
            full_node.full_node_store.pending_tx_request.pop(transaction_id)
        if (task_id in full_node.full_node_store.tx_fetch_tasks):
            full_node.full_node_store.tx_fetch_tasks.pop(task_id)
async def tx_request_and_timeout(full_node: FullNode, transaction_id, task_id):
    counter = 0
    try:
        while True:
            if (counter == 5):
                break
            if (transaction_id not in full_node.full_node_store.peers_with_tx):
                break
            peers_with_tx: Set = full_node.full_node_store.peers_with_tx[transaction_id]
            if (len(peers_with_tx) == 0):
                break
            peer_id = peers_with_tx.pop()
            assert (full_node.server is not None)
            if (peer_id not in full_node.server.all_connections):
                continue
            peer = full_node.server.all_connections[peer_id]
            request_tx = full_node_protocol.RequestTransaction(transaction.transaction_id)
            msg = make_msg(ProtocolMessageTypes.request_transaction, request_tx)
            (await peer.send_message(msg))
            (await asyncio.sleep(5))
            counter += 1
            if full_node.mempool_manager.seen(transaction_id):
                break
    except asyncio.CancelledError:
        pass
    finally:
        if (transaction_id in full_node.full_node_store.peers_with_tx):
            full_node.full_node_store.peers_with_tx.pop(transaction_id)
        if (transaction_id in full_node.full_node_store.pending_tx_request):
            full_node.full_node_store.pending_tx_request.pop(transaction_id)
        if (task_id in full_node.full_node_store.tx_fetch_tasks):
            full_node.full_node_store.tx_fetch_tasks.pop(task_id)