forked from MarkEdmondson1234/googleID
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use hash::Hashable; | ||
|
||
/* Modules */ | ||
mod decoder; | ||
mod hash; | ||
mod merge_unsigned; | ||
mod transaction; | ||
mod util; | ||
|
||
/** | ||
* Entry point | ||
*/ | ||
fn main() | ||
{ | ||
println ("Welcome to coinjoin-merge-unsigned. Enter each unsigned raw transaction"); | ||
println ("on a separate line, followed by a blank line or EOF to finish."); | ||
|
||
let mut transactions: ~[transaction::Transaction] = ~[]; | ||
|
||
let mut next_ln = util::read_hex(); | ||
while next_ln.len() > 0 { | ||
match transaction::from_hex (next_ln) { | ||
Some(t) => { transactions.push (t); } | ||
None => { println ("err: Failed to decode transaction."); } | ||
} | ||
next_ln = util::read_hex(); | ||
} | ||
|
||
match merge_unsigned::merge_unsigned_transactions (transactions) { | ||
None => { println ("err: Failed to merge transactions."); } | ||
Some(t) => { | ||
println (format! ("mpo: {:f}", (t.most_popular_output() as f64) / 100000000f64 )); | ||
println (format! ("mpc: {:u}", t.most_popular_output_count())); | ||
println (format! ("hex: {:s}", t.to_str())); | ||
} | ||
} | ||
} | ||
|
||
© 2020 GitHub, Inc. | ||
|
||
|