Tx (change) output splitter (#1369)

* wip - split change into many outputs for testing

* rustfmt

* add change_outputs param to wallet send
default to 1

* commit

* rustfmt

* cleanup

* fixup servers tests
This commit is contained in:
Antioch Peverell
2018-08-18 22:38:48 +01:00
committed by GitHub
parent c05c5e21ea
commit 25e03aadef
11 changed files with 102 additions and 37 deletions
+7
View File
@@ -170,6 +170,11 @@ pub fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
let dest = send_args
.value_of("dest")
.expect("Destination wallet address required");
let change_outputs = send_args
.value_of("change_outputs")
.unwrap()
.parse()
.expect("Failed to parse number of change outputs.");
let fluff = send_args.is_present("fluff");
let max_outputs = 500;
if dest.starts_with("http") {
@@ -178,6 +183,7 @@ pub fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
minimum_confirmations,
dest,
max_outputs,
change_outputs,
selection_strategy == "all",
);
let slate = match result {
@@ -223,6 +229,7 @@ pub fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
minimum_confirmations,
dest,
max_outputs,
change_outputs,
selection_strategy == "all",
).expect("Send failed");
Ok(())
+6
View File
@@ -201,6 +201,12 @@ fn main() {
.possible_values(&["all", "smallest"])
.default_value("all")
.takes_value(true))
.arg(Arg::with_name("change_outputs")
.help("Number of change outputs to generate (mainly for testing).")
.short("o")
.long("change_outputs")
.default_value("1")
.takes_value(true))
.arg(Arg::with_name("dest")
.help("Send the transaction to the provided server")
.short("d")