2022-03-02 13:29:59 +00:00
|
|
|
from queue import Queue
|
|
|
|
|
|
|
|
|
|
|
|
from typing import TYPE_CHECKING, Set
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
|
from onionrblocks import Block
|
|
|
|
from ..peer import Peer
|
2022-03-05 00:05:12 +00:00
|
|
|
from ..dandelion.phase import DandelionPhase
|
2022-03-02 13:29:59 +00:00
|
|
|
|
|
|
|
def stem_out(
|
|
|
|
block_queue: Queue['Block'],
|
|
|
|
peer_set: Set['Block'],
|
2022-03-05 00:05:12 +00:00
|
|
|
d_phase: 'DandelionPhase'):
|
|
|
|
block = block_queue.get(block=True, timeout=5)
|
2022-03-02 13:29:59 +00:00
|
|
|
raw_block = block.raw
|
|
|
|
block_size = len(block.raw)
|
|
|
|
block_id = block.id
|
|
|
|
del block
|
|
|
|
|