Fix a possibly-unused warning, and rationalize types

This commit is contained in:
moneromooo-monero 2015-10-27 09:05:07 +00:00
parent 12508cb35c
commit 9c6c1be7ad
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
3 changed files with 12 additions and 12 deletions

View File

@ -1113,12 +1113,12 @@ bool simple_wallet::refresh(const std::vector<std::string>& args)
message_writer() << tr("Starting refresh..."); message_writer() << tr("Starting refresh...");
size_t fetched_blocks = 0; uint64_t fetched_blocks = 0;
size_t start_height = 0; uint64_t start_height = 0;
if(!args.empty()){ if(!args.empty()){
try try
{ {
start_height = boost::lexical_cast<int>( args[0] ); start_height = boost::lexical_cast<uint64_t>( args[0] );
} }
catch(const boost::bad_lexical_cast &) catch(const boost::bad_lexical_cast &)
{ {

View File

@ -382,7 +382,7 @@ void wallet2::get_blocks_from_zmq_msg(zmsg_t *msg, std::list<cryptonote::block_c
} }
} }
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
void wallet2::pull_blocks(uint64_t start_height, size_t& blocks_added) void wallet2::pull_blocks(uint64_t start_height, uint64_t& blocks_added)
{ {
connect_to_daemon(); connect_to_daemon();
THROW_WALLET_EXCEPTION_IF(!check_connection(), error::no_connection_to_daemon, "get_blocks"); THROW_WALLET_EXCEPTION_IF(!check_connection(), error::no_connection_to_daemon, "get_blocks");
@ -454,17 +454,17 @@ void wallet2::refresh()
refresh(0, blocks_fetched); refresh(0, blocks_fetched);
} }
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
void wallet2::refresh(uint64_t start_height, size_t & blocks_fetched) void wallet2::refresh(uint64_t start_height, uint64_t & blocks_fetched)
{ {
bool received_money = false; bool received_money = false;
refresh(start_height, blocks_fetched, received_money); refresh(start_height, blocks_fetched, received_money);
} }
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
void wallet2::refresh(uint64_t start_height, size_t & blocks_fetched, bool& received_money) void wallet2::refresh(uint64_t start_height, uint64_t & blocks_fetched, bool& received_money)
{ {
received_money = false; received_money = false;
blocks_fetched = 0; blocks_fetched = 0;
size_t added_blocks = 0; uint64_t added_blocks = 0;
size_t try_count = 0; size_t try_count = 0;
crypto::hash last_tx_hash_id = m_transfers.size() ? get_transaction_hash(m_transfers.back().m_tx) : null_hash; crypto::hash last_tx_hash_id = m_transfers.size() ? get_transaction_hash(m_transfers.back().m_tx) : null_hash;
@ -498,7 +498,7 @@ void wallet2::refresh(uint64_t start_height, size_t & blocks_fetched, bool& rece
LOG_PRINT_L1("Refresh done, blocks received: " << blocks_fetched << ", balance: " << print_money(balance()) << ", unlocked: " << print_money(unlocked_balance())); LOG_PRINT_L1("Refresh done, blocks received: " << blocks_fetched << ", balance: " << print_money(balance()) << ", unlocked: " << print_money(unlocked_balance()));
} }
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
bool wallet2::refresh(size_t & blocks_fetched, bool& received_money, bool& ok) bool wallet2::refresh(uint64_t & blocks_fetched, bool& received_money, bool& ok)
{ {
try try
{ {

View File

@ -227,9 +227,9 @@ namespace tools
*/ */
bool is_deprecated() const; bool is_deprecated() const;
void refresh(); void refresh();
void refresh(uint64_t start_height, size_t & blocks_fetched); void refresh(uint64_t start_height, uint64_t & blocks_fetched);
void refresh(uint64_t start_height, size_t & blocks_fetched, bool& received_money); void refresh(uint64_t start_height, uint64_t & blocks_fetched, bool& received_money);
bool refresh(size_t & blocks_fetched, bool& received_money, bool& ok); bool refresh(uint64_t & blocks_fetched, bool& received_money, bool& ok);
bool testnet() const { return m_testnet; } bool testnet() const { return m_testnet; }
bool restricted() const { return m_restricted; } bool restricted() const { return m_restricted; }
@ -339,7 +339,7 @@ namespace tools
bool is_transfer_unlocked(const transfer_details& td) const; bool is_transfer_unlocked(const transfer_details& td) const;
bool clear(); bool clear();
void get_blocks_from_zmq_msg(zmsg_t *msg, std::list<cryptonote::block_complete_entry> &blocks); void get_blocks_from_zmq_msg(zmsg_t *msg, std::list<cryptonote::block_complete_entry> &blocks);
void pull_blocks(uint64_t start_height, size_t& blocks_added); void pull_blocks(uint64_t start_height, uint64_t& blocks_added);
uint64_t select_transfers(uint64_t needed_money, bool add_dust, uint64_t dust, std::list<transfer_container::iterator>& selected_transfers); uint64_t select_transfers(uint64_t needed_money, bool add_dust, uint64_t dust, std::list<transfer_container::iterator>& selected_transfers);
bool prepare_file_names(const std::string& file_path); bool prepare_file_names(const std::string& file_path);
void process_unconfirmed(const cryptonote::transaction& tx); void process_unconfirmed(const cryptonote::transaction& tx);