2022-03-02 13:29:59 +00:00
|
|
|
from queue import Queue
|
2022-03-11 17:15:18 +00:00
|
|
|
from time import sleep
|
2022-03-02 13:29:59 +00:00
|
|
|
|
2022-03-11 17:15:18 +00:00
|
|
|
from typing import TYPE_CHECKING, Tuple
|
2022-03-02 13:29:59 +00:00
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
2022-03-11 17:15:18 +00:00
|
|
|
from ordered_set import OrderedSet
|
2022-03-02 13:29:59 +00:00
|
|
|
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(
|
2022-03-11 17:15:18 +00:00
|
|
|
block_queues: Tuple[Queue['Block']],
|
|
|
|
peer_set: OrderedSet['Peer'],
|
2022-03-05 00:05:12 +00:00
|
|
|
d_phase: 'DandelionPhase'):
|
2022-03-11 17:15:18 +00:00
|
|
|
|
|
|
|
# Spawn a thread with block set to add to db after time for black hole attack
|
|
|
|
|
|
|
|
if not len(peer_set):
|
|
|
|
sleep(1)
|
|
|
|
return
|
|
|
|
|
2022-03-02 13:29:59 +00:00
|
|
|
|