mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 11:31:08 +03:00
Use a sync channel for peer sending. Fixes #904
This commit is contained in:
parent
b4308e9075
commit
c3cec63a95
1 changed files with 2 additions and 2 deletions
|
@ -142,7 +142,7 @@ pub struct Tracker {
|
||||||
/// Bytes we've received.
|
/// Bytes we've received.
|
||||||
pub received_bytes: Arc<Mutex<u64>>,
|
pub received_bytes: Arc<Mutex<u64>>,
|
||||||
/// Channel to allow sending data through the connection
|
/// Channel to allow sending data through the connection
|
||||||
pub send_channel: mpsc::Sender<Vec<u8>>,
|
pub send_channel: mpsc::SyncSender<Vec<u8>>,
|
||||||
/// Channel to close the connection
|
/// Channel to close the connection
|
||||||
pub close_channel: mpsc::Sender<()>,
|
pub close_channel: mpsc::Sender<()>,
|
||||||
/// Channel to check for errors on the connection
|
/// Channel to check for errors on the connection
|
||||||
|
@ -167,7 +167,7 @@ pub fn listen<H>(stream: TcpStream, handler: H) -> Tracker
|
||||||
where
|
where
|
||||||
H: MessageHandler,
|
H: MessageHandler,
|
||||||
{
|
{
|
||||||
let (send_tx, send_rx) = mpsc::channel();
|
let (send_tx, send_rx) = mpsc::sync_channel(10);
|
||||||
let (close_tx, close_rx) = mpsc::channel();
|
let (close_tx, close_rx) = mpsc::channel();
|
||||||
let (error_tx, error_rx) = mpsc::channel();
|
let (error_tx, error_rx) = mpsc::channel();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue