aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2014-10-04 07:46:49 +0200
committerRiccardo Spagni <ric@spagni.net>2014-10-04 07:47:04 +0200
commitfaca0db9c596413cd2acd124abf08f2ef6c3c612 (patch)
tree8e9011253f0a8ebb280405899637cb2b25fb0b15 /src/cryptonote_core
parentMerge pull request #165 (diff)
parentfixed checkpointing bug (diff)
downloadmonero-faca0db9c596413cd2acd124abf08f2ef6c3c612.tar.xz
Merge pull request #169
1160505 fixed checkpointing bug (Riccardo Spagni) c4d6658 quick hacky fix for broken TXT reads (Riccardo Spagni) 2322a94 cleaned up OpenAlias messages in simplewallet (Riccardo Spagni) 1663089 MoneroPulse log wording tweaks (Riccardo Spagni) 1d515b8 boost 1.56 kindly (and officially) patched in msys2 by Alexey Pavlov (Riccardo Spagni) e3d2400 forgot to add connection context to log line (Riccardo Spagni) 6f7ed13 moved checkpoint log level (Riccardo Spagni) 3e644c2 moved file checkpointing log output to log1 (Riccardo Spagni) 0e1b7c9 moved non-critical p2p errors to l2 (Riccardo Spagni) a3332e7 remove dangling upnp port mappings, updated miniupnpc (Riccardo Spagni) 6b9a7fc fixed unbound static lib on mingw as libunbound.dll.a (Riccardo Spagni) bba217a remove pthreads, successfully tested on gcc 4.9.1 without pthreads (Riccardo Spagni) 18281f4 remove dangling upnp port mappings, updated miniupnpc (Riccardo Spagni) 9130e41 fixed unbound static lib on mingw as libunbound.dll.a (Riccardo Spagni) 8c37823 remove pthreads, successfully tested on gcc 4.9.1 without pthreads (Riccardo Spagni)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/blockchain_storage.cpp6
-rw-r--r--src/cryptonote_core/checkpoints.cpp2
-rw-r--r--src/cryptonote_core/checkpoints_create.cpp15
3 files changed, 12 insertions, 11 deletions
diff --git a/src/cryptonote_core/blockchain_storage.cpp b/src/cryptonote_core/blockchain_storage.cpp
index 6f1b4121c..4cca878db 100644
--- a/src/cryptonote_core/blockchain_storage.cpp
+++ b/src/cryptonote_core/blockchain_storage.cpp
@@ -1794,18 +1794,18 @@ void blockchain_storage::check_against_checkpoints(checkpoints& points, bool enf
continue;
}
- if (!m_checkpoints.check_block(pt.first, get_block_hash(m_blocks[pt.first].bl)))
+ if (!points.check_block(pt.first, get_block_hash(m_blocks[pt.first].bl)))
{
// if asked to enforce checkpoints, roll back to a couple of blocks before the checkpoint
if (enforce)
{
- LOG_ERROR("Checkpoint failed when adding new checkpoints, rolling back!");
+ LOG_ERROR("Local blockchain failed to pass a checkpoint, rolling back!");
std::list<block> empty;
rollback_blockchain_switching(empty, pt.first - 2);
}
else
{
- LOG_ERROR("Checkpoint failed when adding new checkpoints, this could be very bad.");
+ LOG_ERROR("WARNING: local blockchain failed to pass a MoneroPulse checkpoint, and you could be on a fork. You should either sync up from scratch, OR download a fresh blockchain bootstrap, OR enable checkpoint enforcing with the --enforce-dns-checkpointing command-line option");
}
}
}
diff --git a/src/cryptonote_core/checkpoints.cpp b/src/cryptonote_core/checkpoints.cpp
index 25759792b..6a86302b6 100644
--- a/src/cryptonote_core/checkpoints.cpp
+++ b/src/cryptonote_core/checkpoints.cpp
@@ -69,7 +69,7 @@ namespace cryptonote
if(it->second == h)
{
- LOG_PRINT_GREEN("CHECKPOINT PASSED FOR HEIGHT " << height << " " << h, LOG_LEVEL_0);
+ LOG_PRINT_GREEN("CHECKPOINT PASSED FOR HEIGHT " << height << " " << h, LOG_LEVEL_1);
return true;
}else
{
diff --git a/src/cryptonote_core/checkpoints_create.cpp b/src/cryptonote_core/checkpoints_create.cpp
index 808bc46a7..140f8dae3 100644
--- a/src/cryptonote_core/checkpoints_create.cpp
+++ b/src/cryptonote_core/checkpoints_create.cpp
@@ -84,14 +84,14 @@ bool load_checkpoints_from_json(cryptonote::checkpoints& checkpoints, std::strin
boost::system::error_code errcode;
if (! (boost::filesystem::exists(json_hashfile_fullpath, errcode)))
{
- LOG_PRINT_L0("Blockchain checkpoints file not found");
+ LOG_PRINT_L1("Blockchain checkpoints file not found");
return true;
}
- LOG_PRINT_L0("Adding checkpoints from blockchain hashfile");
+ LOG_PRINT_L1("Adding checkpoints from blockchain hashfile");
uint64_t prev_max_height = checkpoints.get_max_height();
- LOG_PRINT_L0("Hard-coded max checkpoint height is " << prev_max_height);
+ LOG_PRINT_L1("Hard-coded max checkpoint height is " << prev_max_height);
t_hash_json hashes;
epee::serialization::load_t_from_json_file(hashes, json_hashfile_fullpath);
for (std::vector<t_hashline>::const_iterator it = hashes.hashlines.begin(); it != hashes.hashlines.end(); )
@@ -99,10 +99,10 @@ bool load_checkpoints_from_json(cryptonote::checkpoints& checkpoints, std::strin
uint64_t height;
height = it->height;
if (height <= prev_max_height) {
- LOG_PRINT_L0("ignoring checkpoint height " << height);
+ LOG_PRINT_L1("ignoring checkpoint height " << height);
} else {
std::string blockhash = it->hash;
- LOG_PRINT_L0("Adding checkpoint height " << height << ", hash=" << blockhash);
+ LOG_PRINT_L1("Adding checkpoint height " << height << ", hash=" << blockhash);
ADD_CHECKPOINT(height, blockhash);
}
++it;
@@ -113,6 +113,7 @@ bool load_checkpoints_from_json(cryptonote::checkpoints& checkpoints, std::strin
bool load_checkpoints_from_dns(cryptonote::checkpoints& checkpoints)
{
+ // All four MoneroPulse domains have DNSSEC on and valid
static const std::vector<std::string> dns_urls = { "checkpoints.moneropulse.se"
, "checkpoints.moneropulse.org"
, "checkpoints.moneropulse.net"
@@ -144,13 +145,13 @@ bool load_checkpoints_from_dns(cryptonote::checkpoints& checkpoints)
if (records.size() == 0)
{
- LOG_PRINT_L1("Fetching checkpoints from DNS TXT records failed, no TXT records available.");
+ LOG_PRINT_L1("Fetching MoneroPulse checkpoints failed, no TXT records available.");
return true;
}
if (avail && !valid)
{
- LOG_PRINT_L0("DNSSEC present and failed validation for query last url, and all other urls either failed validation or returned no records");
+ LOG_PRINT_L0("WARNING: MoneroPulse failed DNSSEC validation and/or returned no records");
return true;
}