Onionr/src/gossip/client/dandelionstem.py

24 lines
536 B
Python
Raw Normal View History

2022-03-02 13:29:59 +00:00
from queue import Queue
from time import sleep
2022-03-02 13:29:59 +00:00
from typing import TYPE_CHECKING, Tuple
2022-03-02 13:29:59 +00:00
if TYPE_CHECKING:
from ordered_set import OrderedSet
2022-03-02 13:29:59 +00:00
from onionrblocks import Block
from ..peer import Peer
from ..dandelion.phase import DandelionPhase
2022-03-02 13:29:59 +00:00
def stem_out(
block_queues: Tuple[Queue['Block']],
peer_set: OrderedSet['Peer'],
d_phase: 'DandelionPhase'):
# 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