mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 11:31:08 +03:00
pass in max_transactions to wallet send/burn from grin.rs (#272)
This commit is contained in:
parent
9f7e047aeb
commit
f663340628
3 changed files with 24 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -512,9 +512,9 @@ impl WalletData {
|
|||
amount: u64,
|
||||
current_height: u64,
|
||||
minimum_confirmations: u64,
|
||||
max_outputs: usize,
|
||||
default_strategy: bool,
|
||||
) -> Vec<OutputData> {
|
||||
let max_outputs = 500;
|
||||
|
||||
// first find all eligible outputs based on number of confirmations
|
||||
let mut eligible = self.outputs
|
||||
|
|
Loading…
Reference in a new issue