summaryrefslogtreecommitdiff
path: root/src/ui.rs
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-10-21 10:40:30 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-10-21 10:40:30 +0800
commit6ae4e4b55d06d50a2ee2661163ec8092d2e6fdf1 (patch)
tree4f7d8c1e3cc49c226a33bb118f9debbe7ab522b8 /src/ui.rs
parentf754675aac96ac04599ec79d609e2c5b08be4561 (diff)
fix: deadlock
Diffstat (limited to 'src/ui.rs')
-rw-r--r--src/ui.rs21
1 files changed, 7 insertions, 14 deletions
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<Mutex<BlockChain>>,
- me: &'a Client,
+ me: Client,
}
-impl<'a> Ui<'a> {
- pub fn new(network_config: &'a mut NetworkConfig, blockchain: Arc<Mutex<BlockChain>>, me: &'a Client) -> Self {
+impl Ui {
+ pub fn new(blockchain: Arc<Mutex<BlockChain>>, 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()