aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakob Lind <karl.jakob.lind@gmail.com>2014-08-01 11:29:55 +0200
committerJakob Lind <karl.jakob.lind@gmail.com>2014-08-01 11:29:55 +0200
commit29c675acc05fa2b2624f84e1b41950fa20b4b518 (patch)
treea710ed7811871b77ca33580ea7563a824b353cac /src
parent#36 simplewallet refresh include optional height param (diff)
downloadmonero-29c675acc05fa2b2624f84e1b41950fa20b4b518.tar.xz
#36 make it compile and work properly
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet2.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index f3e3a665d..86f2dc0d5 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -248,19 +248,17 @@ void wallet2::get_short_chain_history(std::list<crypto::hash>& ids)
ids.push_back(m_blockchain[0]);
}
//----------------------------------------------------------------------------------------------------
-void wallet2::pull_blocks(size_t& blocks_added)
+void wallet2::pull_blocks(uint64_t start_height, size_t& blocks_added)
{
blocks_added = 0;
cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::request req = AUTO_VAL_INIT(req);
cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::response res = AUTO_VAL_INIT(res);
get_short_chain_history(req.block_ids);
+ req.start_height = start_height;
bool r = net_utils::invoke_http_bin_remote_command2(m_daemon_address + "/getblocks.bin", req, res, m_http_client, WALLET_RCP_CONNECTION_TIMEOUT);
THROW_WALLET_EXCEPTION_IF(!r, error::no_connection_to_daemon, "getblocks.bin");
THROW_WALLET_EXCEPTION_IF(res.status == CORE_RPC_STATUS_BUSY, error::daemon_busy, "getblocks.bin");
THROW_WALLET_EXCEPTION_IF(res.status != CORE_RPC_STATUS_OK, error::get_blocks_error, res.status);
- THROW_WALLET_EXCEPTION_IF(m_blockchain.size() <= res.start_height, error::wallet_internal_error,
- "wrong daemon response: m_start_height=" + std::to_string(res.start_height) +
- " not less than local blockchain size=" + std::to_string(m_blockchain.size()));
size_t current_index = res.start_height;
BOOST_FOREACH(auto& bl_entry, res.blocks)