diff --git a/pool/src/pool.rs b/pool/src/pool.rs index daaa79981..c320216ce 100644 --- a/pool/src/pool.rs +++ b/pool/src/pool.rs @@ -31,9 +31,6 @@ use util::LOGGER; const MAX_MINEABLE_WEIGHT: usize = consensus::MAX_BLOCK_WEIGHT - consensus::BLOCK_OUTPUT_WEIGHT - consensus::BLOCK_KERNEL_WEIGHT; -// longest chain of dependent transactions that can be included in a block -const MAX_TX_CHAIN: usize = 20; - pub struct Pool { /// Entries in the pool (tx + info + timer) in simple insertion order. pub entries: Vec, diff --git a/servers/src/mining/stratumserver.rs b/servers/src/mining/stratumserver.rs index 524859d7d..6f12a487c 100644 --- a/servers/src/mining/stratumserver.rs +++ b/servers/src/mining/stratumserver.rs @@ -30,7 +30,7 @@ use common::stats::{StratumStats, WorkerStats}; use common::types::{StratumServerConfig, SyncState}; use core::core::verifier_cache::VerifierCache; use core::core::Block; -use core::{global, pow, ser}; +use core::{pow, ser}; use keychain; use mining::mine_block; use pool; diff --git a/src/bin/cmd/wallet.rs b/src/bin/cmd/wallet.rs index 1bc7ca142..b4512df20 100644 --- a/src/bin/cmd/wallet.rs +++ b/src/bin/cmd/wallet.rs @@ -205,7 +205,7 @@ pub fn wallet_command(wallet_args: &ArgMatches, config: GlobalWalletConfig) { let acct_mappings = api.accounts()?; // give logging thread a moment to catch up thread::sleep(Duration::from_millis(200)); - display::accounts(acct_mappings, false); + display::accounts(acct_mappings); Ok(()) }); if res.is_err() { diff --git a/wallet/src/display.rs b/wallet/src/display.rs index d44f3fcd8..333440d9b 100644 --- a/wallet/src/display.rs +++ b/wallet/src/display.rs @@ -214,7 +214,7 @@ pub fn info(account: &str, wallet_info: &WalletInfo, validated: bool) { } } /// Display list of wallet accounts in a pretty way -pub fn accounts(acct_mappings: Vec, show_derivations: bool) { +pub fn accounts(acct_mappings: Vec) { println!("\n____ Wallet Accounts ____\n",); let mut table = table!(); diff --git a/wallet/src/libwallet/internal/selection.rs b/wallet/src/libwallet/internal/selection.rs index 7711f6213..ee06eb6a7 100644 --- a/wallet/src/libwallet/internal/selection.rs +++ b/wallet/src/libwallet/internal/selection.rs @@ -116,7 +116,6 @@ where // write the output representing our change for (change_amount, id) in &change_amounts_derivations { - let change_id = keychain.derive_key(&id).unwrap(); t.num_outputs += 1; t.amount_credited += change_amount; batch.save(OutputData { @@ -311,7 +310,7 @@ where // build transaction skeleton with inputs and change let (mut parts, change_amounts_derivations) = - inputs_and_change(&coins, wallet, amount, fee, change_outputs, parent_key_id)?; + inputs_and_change(&coins, wallet, amount, fee, change_outputs)?; // This is more proof of concept than anything but here we set lock_height // on tx being sent (based on current chain height via api). @@ -327,7 +326,6 @@ pub fn inputs_and_change( amount: u64, fee: u64, num_change_outputs: usize, - parent_key_id: &Identifier, ) -> Result<(Vec>>, Vec<(u64, Identifier)>), Error> where T: WalletBackend, @@ -379,7 +377,6 @@ where part_change }; - let keychain = wallet.keychain().clone(); let change_key = wallet.next_child().unwrap(); change_amounts_derivations.push((change_amount, change_key.clone())); @@ -418,8 +415,7 @@ where .filter(|out| { out.root_key_id == *parent_key_id && out.eligible_to_spend(current_height, minimum_confirmations) - }) - .collect::>(); + }).collect::>(); let max_available = eligible.len(); @@ -482,8 +478,7 @@ fn select_from(amount: u64, select_all: bool, outputs: Vec) -> Optio let res = selected_amount < amount; selected_amount += out.value; res - }) - .cloned() + }).cloned() .collect(), ); } diff --git a/wallet/src/libwallet/internal/tx.rs b/wallet/src/libwallet/internal/tx.rs index f72a0ce93..5bf105e74 100644 --- a/wallet/src/libwallet/internal/tx.rs +++ b/wallet/src/libwallet/internal/tx.rs @@ -228,14 +228,8 @@ where let fee = tx_fee(coins.len(), 2, 1, None); let num_change_outputs = 1; - let (mut parts, _) = selection::inputs_and_change( - &coins, - wallet, - amount, - fee, - num_change_outputs, - parent_key_id, - )?; + let (mut parts, _) = + selection::inputs_and_change(&coins, wallet, amount, fee, num_change_outputs)?; //TODO: If we end up using this, create change output here diff --git a/wallet/src/libwallet/types.rs b/wallet/src/libwallet/types.rs index fafe7178c..567d35ed4 100644 --- a/wallet/src/libwallet/types.rs +++ b/wallet/src/libwallet/types.rs @@ -28,7 +28,7 @@ use uuid::Uuid; use core::core::hash::Hash; use core::ser; -use keychain::{ExtKeychain, Identifier, Keychain}; +use keychain::{Identifier, Keychain}; use libtx::aggsig; use libtx::slate::Slate; @@ -448,7 +448,8 @@ impl BlockIdentifier { /// convert to hex string pub fn from_hex(hex: &str) -> Result { - let hash = Hash::from_hex(hex).context(ErrorKind::GenericError("Invalid hex".to_owned()))?; + let hash = + Hash::from_hex(hex).context(ErrorKind::GenericError("Invalid hex".to_owned()))?; Ok(BlockIdentifier(hash)) } }