MCPcopy
hub / github.com/raiden-network/raiden / inplace_delete_message_queue

Function inplace_delete_message_queue

raiden/transfer/node.py:432–449  ·  view source on GitHub ↗

Filter messages from queue, if the queue becomes empty, cleanup the queue itself.

(
    chain_state: ChainState,
    state_change: Union[ReceiveDelivered, ReceiveProcessed, ReceiveWithdrawConfirmation],
    queueid: QueueIdentifier,
)

Source from the content-addressed store, hash-verified

430
431
432def inplace_delete_message_queue(
433 chain_state: ChainState,
434 state_change: Union[ReceiveDelivered, ReceiveProcessed, ReceiveWithdrawConfirmation],
435 queueid: QueueIdentifier,
436) -> None:
437 """Filter messages from queue, if the queue becomes empty, cleanup the queue itself."""
438 queue = chain_state.queueids_to_queues.get(queueid)
439 if not queue:
440 if queueid in chain_state.queueids_to_queues:
441 chain_state.queueids_to_queues.pop(queueid)
442 return
443
444 inplace_delete_message(message_queue=queue, state_change=state_change)
445
446 if len(queue) == 0:
447 del chain_state.queueids_to_queues[queueid]
448 else:
449 chain_state.queueids_to_queues[queueid] = queue
450
451
452def inplace_delete_message(

Calls 2

inplace_delete_messageFunction · 0.85
getMethod · 0.45

Tested by 1