From 6ae4e4b55d06d50a2ee2661163ec8092d2e6fdf1 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 21 Oct 2025 10:40:30 +0800 Subject: fix: deadlock --- src/ui.rs | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/ui.rs') diff --git a/src/ui.rs b/src/ui.rs index c820422..b2c57c0 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -1,23 +1,16 @@ -use std::sync::{Arc, Weak}; +use std::sync::Arc; -use bitcoin::{ - blocks::{Block, BlockChain}, - client::Client, - network::{Network, NetworkConfig, Request}, - transaction::Transaction, -}; +use bitcoin::{blocks::BlockChain, client::Client, network::Request, transaction::Transaction}; use tokio::sync::Mutex; -pub struct Ui<'a> { - network_config: &'a mut NetworkConfig, +pub struct Ui { blockchain: Arc>, - me: &'a Client, + me: Client, } -impl<'a> Ui<'a> { - pub fn new(network_config: &'a mut NetworkConfig, blockchain: Arc>, me: &'a Client) -> Self { +impl Ui { + pub fn new(blockchain: Arc>, me: Client) -> Self { Self { - network_config, blockchain, me, } @@ -30,7 +23,7 @@ impl<'a> Ui<'a> { .collect(); if cmd[0] == "trans" { let trans = Transaction::new( - *self.me, + self.me, Client::new( cmd[1] .parse() -- cgit v1.2.3