mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-10-17 15:21:39 +02:00
Stop proxy in controller tests to allow dir cleanup on Windows (#363)
* Stop wallet proxy in controller tests to allow directory cleanup in Windows * Update test client * Update to latest grin master * is_unspent -> get_unspent
This commit is contained in:
@@ -43,7 +43,7 @@ fn get_output_local(chain: &chain::Chain, commit: &pedersen::Commitment) -> Opti
|
||||
];
|
||||
|
||||
for x in outputs.iter() {
|
||||
if chain.is_unspent(&x).is_ok() {
|
||||
if chain.get_unspent(&x).unwrap().is_some() {
|
||||
let block_height = chain.get_header_for_output(&x).unwrap().height;
|
||||
let output_pos = chain.get_output_pos(&x.commit).unwrap_or(0);
|
||||
return Some(api::Output::new(&commit, block_height, output_pos));
|
||||
|
||||
@@ -139,8 +139,16 @@ where
|
||||
self.running.store(true, Ordering::Relaxed);
|
||||
loop {
|
||||
thread::sleep(Duration::from_millis(10));
|
||||
if !self.running.load(Ordering::Relaxed) {
|
||||
info!("Proxy stopped");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// read queue
|
||||
let m = self.rx.recv().unwrap();
|
||||
let m = match self.rx.recv_timeout(Duration::from_millis(10)) {
|
||||
Ok(m) => m,
|
||||
Err(_) => continue,
|
||||
};
|
||||
trace!("Wallet Client Proxy Received: {:?}", m);
|
||||
let resp = match m.method.as_ref() {
|
||||
"get_chain_tip" => self.get_chain_tip(m)?,
|
||||
@@ -154,9 +162,6 @@ where
|
||||
};
|
||||
|
||||
self.respond(resp);
|
||||
if !self.running.load(Ordering::Relaxed) {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user