Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2 from garyyu/0-conf
Browse files Browse the repository at this point in the history
Use 0-confirmation for sending
  • Loading branch information
garyyu authored Oct 16, 2019
2 parents 446517d + 24ad5ce commit 376edce
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ use grin_wallet_util::grin_core::global::ChainTypes;
use grin_wallet_util::grin_keychain::ExtKeychain;
use grin_wallet_util::grin_util::{Mutex, ZeroingString};

/// Default minimum confirmation
/// Default balance minimum confirmation
pub const MINIMUM_CONFIRMATIONS: u64 = 10;

/// Default sending coins selection minimum confirmation
pub const SENDING_MINIMUM_CONFIRMATIONS: u64 = 0;

fn cstr_to_str(s: *const c_char) -> String {
unsafe { CStr::from_ptr(s).to_string_lossy().into_owned() }
}
Expand Down Expand Up @@ -463,7 +466,7 @@ fn init_send_tx(
let tx_args = InitTxArgs {
src_acct_name: None,
amount,
minimum_confirmations: MINIMUM_CONFIRMATIONS,
minimum_confirmations: SENDING_MINIMUM_CONFIRMATIONS,
max_outputs: 500,
num_change_outputs: 1,
selection_strategy: selection_strategy.to_string(),
Expand Down Expand Up @@ -727,7 +730,7 @@ fn send_tx_by_http(
let args = InitTxArgs {
src_acct_name: None,
amount,
minimum_confirmations: MINIMUM_CONFIRMATIONS,
minimum_confirmations: SENDING_MINIMUM_CONFIRMATIONS,
max_outputs: 500,
num_change_outputs: 1,
selection_strategy: selection_strategy.to_string(),
Expand Down Expand Up @@ -772,7 +775,7 @@ fn send_tx_by_relay(
let args = InitTxArgs {
src_acct_name: None,
amount,
minimum_confirmations: MINIMUM_CONFIRMATIONS,
minimum_confirmations: SENDING_MINIMUM_CONFIRMATIONS,
max_outputs: 500,
num_change_outputs: 1,
selection_strategy: selection_strategy.to_string(),
Expand Down

0 comments on commit 376edce

Please sign in to comment.