aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-12-16 23:27:00 +0200
committerRiccardo Spagni <ric@spagni.net>2017-12-16 23:27:00 +0200
commit8da24c2a57fdb9a04137537f3e339e1876407d8d (patch)
treefb45239aebb9b13d52d3e13862f1c9dc636217a2 /src/cryptonote_core/blockchain.cpp
parentMerge pull request #2874 (diff)
parentrpc: add offline state in info rpc (diff)
downloadmonero-8da24c2a57fdb9a04137537f3e339e1876407d8d.tar.xz
Merge pull request #2878
abebe392 rpc: add offline state in info rpc (moneromooo-monero) 7696e849 core: make --offline also disable DNS lookups (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r--src/cryptonote_core/blockchain.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index 836856bae..123bd194b 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -305,7 +305,7 @@ uint64_t Blockchain::get_current_blockchain_height() const
//------------------------------------------------------------------
//FIXME: possibly move this into the constructor, to avoid accidentally
// dereferencing a null BlockchainDB pointer
-bool Blockchain::init(BlockchainDB* db, const bool testnet, const cryptonote::test_options *test_options)
+bool Blockchain::init(BlockchainDB* db, const bool testnet, bool offline, const cryptonote::test_options *test_options)
{
LOG_PRINT_L3("Blockchain::" << __func__);
CRITICAL_REGION_LOCAL(m_tx_pool);
@@ -327,6 +327,7 @@ bool Blockchain::init(BlockchainDB* db, const bool testnet, const cryptonote::te
m_db = db;
m_testnet = testnet;
+ m_offline = offline;
if (m_hardfork == nullptr)
{
if (fakechain)
@@ -414,11 +415,11 @@ bool Blockchain::init(BlockchainDB* db, const bool testnet, const cryptonote::te
return true;
}
//------------------------------------------------------------------
-bool Blockchain::init(BlockchainDB* db, HardFork*& hf, const bool testnet)
+bool Blockchain::init(BlockchainDB* db, HardFork*& hf, const bool testnet, bool offline)
{
if (hf != nullptr)
m_hardfork = hf;
- bool res = init(db, testnet, NULL);
+ bool res = init(db, testnet, offline, NULL);
if (hf == nullptr)
hf = m_hardfork;
return res;
@@ -3641,14 +3642,14 @@ bool Blockchain::update_checkpoints(const std::string& file_path, bool check_dns
// if we're checking both dns and json, load checkpoints from dns.
// if we're not hard-enforcing dns checkpoints, handle accordingly
- if (m_enforce_dns_checkpoints && check_dns)
+ if (m_enforce_dns_checkpoints && check_dns && !m_offline)
{
if (!m_checkpoints.load_checkpoints_from_dns())
{
return false;
}
}
- else if (check_dns)
+ else if (check_dns && !m_offline)
{
checkpoints dns_points;
dns_points.load_checkpoints_from_dns();