Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Revert "orchard (#88)"
Browse files Browse the repository at this point in the history
This reverts commit 1d033cd.
  • Loading branch information
adityapk00 committed May 30, 2022
1 parent 1d033cd commit 657024b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 33 deletions.
16 changes: 7 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ group = "0.8"

rust-embed = { version = "5.1.0", features = ["debug-embed"] }

zcash_primitives = { git = "https://github.com/adityapk00/librustzcash", rev = "f234f0b496e574b4d2bf15d2a6cc6f1d39debd95", features = ["transparent-inputs"] }
zcash_client_backend = { git = "https://github.com/adityapk00/librustzcash", rev = "f234f0b496e574b4d2bf15d2a6cc6f1d39debd95"}
zcash_proofs = { git = "https://github.com/adityapk00/librustzcash", rev = "f234f0b496e574b4d2bf15d2a6cc6f1d39debd95", features = ["multicore"]}
zcash_primitives = { git = "https://github.com/adityapk00/librustzcash", rev = "adeb3ec4ad15480482bc2962bc9fe453814db9ee", features = ["transparent-inputs"] }
zcash_client_backend = { git = "https://github.com/adityapk00/librustzcash", rev = "adeb3ec4ad15480482bc2962bc9fe453814db9ee"}
zcash_proofs = { git = "https://github.com/adityapk00/librustzcash", rev = "adeb3ec4ad15480482bc2962bc9fe453814db9ee", features = ["multicore"]}

[dev-dependencies]
portpicker = "0.1.1"
portpicker = "0.1.0"
tempdir = "0.3.7"

[build-dependencies]
Expand Down
40 changes: 20 additions & 20 deletions lib/src/lightwallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,25 +1228,25 @@ impl LightWallet {
}

// Set up a channel to recieve updates on the progress of building the transaction.
// let (tx, rx) = channel::<u32>();
// let progress = self.send_progress.clone();
let (tx, rx) = channel::<u32>();
let progress = self.send_progress.clone();

// Use a separate thread to handle sending from std::mpsc to tokio::sync::mpsc
// let (tx2, mut rx2) = tokio::sync::mpsc::unbounded_channel();
// std::thread::spawn(move || {
// while let Ok(r) = rx.recv() {
// tx2.send(r).unwrap();
// }
// });

// let progress_handle = tokio::spawn(async move {
// while let Some(r) = rx2.recv().await {
// println!("Progress: {}", r);
// progress.write().await.progress = r;
// }

// progress.write().await.is_send_in_progress = false;
// });
let (tx2, mut rx2) = tokio::sync::mpsc::unbounded_channel();
std::thread::spawn(move || {
while let Ok(r) = rx.recv() {
tx2.send(r).unwrap();
}
});

let progress_handle = tokio::spawn(async move {
while let Some(r) = rx2.recv().await {
println!("Progress: {}", r);
progress.write().await.progress = r;
}

progress.write().await.is_send_in_progress = false;
});

{
let mut p = self.send_progress.write().await;
Expand All @@ -1256,10 +1256,10 @@ impl LightWallet {
}

println!("{}: Building transaction", now() - start_time);
let (tx, _) = match builder.build(
let (tx, _) = match builder.build_with_progress_notifier(
BranchId::try_from(consensus_branch_id).unwrap(),
&prover,
//Some(tx),
Some(tx),
) {
Ok(res) => res,
Err(e) => {
Expand All @@ -1271,7 +1271,7 @@ impl LightWallet {
};

// Wait for all the progress to be updated
// progress_handle.await.unwrap();
progress_handle.await.unwrap();

println!("{}: Transaction created", now() - start_time);
println!("Transaction ID: {}", tx.txid());
Expand Down

0 comments on commit 657024b

Please sign in to comment.