diff --git a/src/bin/grin.rs b/src/bin/grin.rs index 8379fd65a..18c336e3c 100644 --- a/src/bin/grin.rs +++ b/src/bin/grin.rs @@ -424,12 +424,14 @@ fn wallet_command(wallet_args: &ArgMatches) { if let Some(d) = send_args.value_of("dest") { dest = d; } + let max_outputs = 500; let result=wallet::issue_send_tx( &wallet_config, &keychain, amount, minimum_confirmations, dest.to_string(), + max_outputs, (selection_strategy == "all"), ); match result { @@ -449,8 +451,14 @@ fn wallet_command(wallet_args: &ArgMatches) { .unwrap() .parse() .expect("Could not parse minimum_confirmations as a whole number."); - wallet::issue_burn_tx(&wallet_config, &keychain, amount, minimum_confirmations) - .unwrap(); + let max_outputs = 500; + wallet::issue_burn_tx( + &wallet_config, + &keychain, + amount, + minimum_confirmations, + max_outputs, + ).unwrap(); } ("info", Some(_)) => { wallet::show_info(&wallet_config, &keychain); diff --git a/wallet/src/sender.rs b/wallet/src/sender.rs index 7f249a33b..005a8ab85 100644 --- a/wallet/src/sender.rs +++ b/wallet/src/sender.rs @@ -36,6 +36,7 @@ pub fn issue_send_tx( amount: u64, minimum_confirmations: u64, dest: String, + max_outputs: usize, selection_strategy: bool, ) -> Result<(), Error> { checker::refresh_outputs(config, keychain)?; @@ -53,6 +54,7 @@ pub fn issue_send_tx( current_height, minimum_confirmations, lock_height, + max_outputs, selection_strategy, )?; @@ -81,6 +83,7 @@ fn build_send_tx( current_height: u64, minimum_confirmations: u64, lock_height: u64, + max_outputs: usize, default_strategy: bool, ) -> Result<(Transaction, BlindingFactor), Error> { let key_id = keychain.clone().root_key_id(); @@ -92,6 +95,7 @@ fn build_send_tx( amount, current_height, minimum_confirmations, + max_outputs, default_strategy, ) })?; @@ -121,6 +125,7 @@ pub fn issue_burn_tx( keychain: &Keychain, amount: u64, minimum_confirmations: u64, + max_outputs: usize, ) -> Result<(), Error> { let keychain = &Keychain::burn_enabled(keychain, &Identifier::zero()); @@ -133,7 +138,14 @@ pub fn issue_burn_tx( // select some spendable coins from the wallet let coins = WalletData::read_wallet(&config.data_file_dir, |wallet_data| { - wallet_data.select(key_id.clone(), amount, current_height, minimum_confirmations, false) + wallet_data.select( + key_id.clone(), + amount, + current_height, + minimum_confirmations, + max_outputs, + false, + ) })?; debug!(LOGGER, "selected some coins - {}", coins.len()); diff --git a/wallet/src/types.rs b/wallet/src/types.rs index f0a79c2a0..740af35a9 100644 --- a/wallet/src/types.rs +++ b/wallet/src/types.rs @@ -512,9 +512,9 @@ impl WalletData { amount: u64, current_height: u64, minimum_confirmations: u64, + max_outputs: usize, default_strategy: bool, ) -> Vec { - let max_outputs = 500; // first find all eligible outputs based on number of confirmations let mut eligible = self.outputs