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:
@@ -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(())
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user