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") {
|
if let Some(d) = send_args.value_of("dest") {
|
||||||
dest = d;
|
dest = d;
|
||||||
}
|
}
|
||||||
|
let max_outputs = 500;
|
||||||
let result=wallet::issue_send_tx(
|
let result=wallet::issue_send_tx(
|
||||||
&wallet_config,
|
&wallet_config,
|
||||||
&keychain,
|
&keychain,
|
||||||
amount,
|
amount,
|
||||||
minimum_confirmations,
|
minimum_confirmations,
|
||||||
dest.to_string(),
|
dest.to_string(),
|
||||||
|
max_outputs,
|
||||||
(selection_strategy == "all"),
|
(selection_strategy == "all"),
|
||||||
);
|
);
|
||||||
match result {
|
match result {
|
||||||
|
@ -449,8 +451,14 @@ fn wallet_command(wallet_args: &ArgMatches) {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.parse()
|
.parse()
|
||||||
.expect("Could not parse minimum_confirmations as a whole number.");
|
.expect("Could not parse minimum_confirmations as a whole number.");
|
||||||
wallet::issue_burn_tx(&wallet_config, &keychain, amount, minimum_confirmations)
|
let max_outputs = 500;
|
||||||
.unwrap();
|
wallet::issue_burn_tx(
|
||||||
|
&wallet_config,
|
||||||
|
&keychain,
|
||||||
|
amount,
|
||||||
|
minimum_confirmations,
|
||||||
|
max_outputs,
|
||||||
|
).unwrap();
|
||||||
}
|
}
|
||||||
("info", Some(_)) => {
|
("info", Some(_)) => {
|
||||||
wallet::show_info(&wallet_config, &keychain);
|
wallet::show_info(&wallet_config, &keychain);
|
||||||
|
|
|
@ -36,6 +36,7 @@ pub fn issue_send_tx(
|
||||||
amount: u64,
|
amount: u64,
|
||||||
minimum_confirmations: u64,
|
minimum_confirmations: u64,
|
||||||
dest: String,
|
dest: String,
|
||||||
|
max_outputs: usize,
|
||||||
selection_strategy: bool,
|
selection_strategy: bool,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
checker::refresh_outputs(config, keychain)?;
|
checker::refresh_outputs(config, keychain)?;
|
||||||
|
@ -53,6 +54,7 @@ pub fn issue_send_tx(
|
||||||
current_height,
|
current_height,
|
||||||
minimum_confirmations,
|
minimum_confirmations,
|
||||||
lock_height,
|
lock_height,
|
||||||
|
max_outputs,
|
||||||
selection_strategy,
|
selection_strategy,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
@ -81,6 +83,7 @@ fn build_send_tx(
|
||||||
current_height: u64,
|
current_height: u64,
|
||||||
minimum_confirmations: u64,
|
minimum_confirmations: u64,
|
||||||
lock_height: u64,
|
lock_height: u64,
|
||||||
|
max_outputs: usize,
|
||||||
default_strategy: bool,
|
default_strategy: bool,
|
||||||
) -> Result<(Transaction, BlindingFactor), Error> {
|
) -> Result<(Transaction, BlindingFactor), Error> {
|
||||||
let key_id = keychain.clone().root_key_id();
|
let key_id = keychain.clone().root_key_id();
|
||||||
|
@ -92,6 +95,7 @@ fn build_send_tx(
|
||||||
amount,
|
amount,
|
||||||
current_height,
|
current_height,
|
||||||
minimum_confirmations,
|
minimum_confirmations,
|
||||||
|
max_outputs,
|
||||||
default_strategy,
|
default_strategy,
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
@ -121,6 +125,7 @@ pub fn issue_burn_tx(
|
||||||
keychain: &Keychain,
|
keychain: &Keychain,
|
||||||
amount: u64,
|
amount: u64,
|
||||||
minimum_confirmations: u64,
|
minimum_confirmations: u64,
|
||||||
|
max_outputs: usize,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let keychain = &Keychain::burn_enabled(keychain, &Identifier::zero());
|
let keychain = &Keychain::burn_enabled(keychain, &Identifier::zero());
|
||||||
|
|
||||||
|
@ -133,7 +138,14 @@ pub fn issue_burn_tx(
|
||||||
|
|
||||||
// select some spendable coins from the wallet
|
// select some spendable coins from the wallet
|
||||||
let coins = WalletData::read_wallet(&config.data_file_dir, |wallet_data| {
|
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());
|
debug!(LOGGER, "selected some coins - {}", coins.len());
|
||||||
|
|
|
@ -512,9 +512,9 @@ impl WalletData {
|
||||||
amount: u64,
|
amount: u64,
|
||||||
current_height: u64,
|
current_height: u64,
|
||||||
minimum_confirmations: u64,
|
minimum_confirmations: u64,
|
||||||
|
max_outputs: usize,
|
||||||
default_strategy: bool,
|
default_strategy: bool,
|
||||||
) -> Vec<OutputData> {
|
) -> Vec<OutputData> {
|
||||||
let max_outputs = 500;
|
|
||||||
|
|
||||||
// first find all eligible outputs based on number of confirmations
|
// first find all eligible outputs based on number of confirmations
|
||||||
let mut eligible = self.outputs
|
let mut eligible = self.outputs
|
||||||
|
|
Loading…
Reference in a new issue