aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp5
-rw-r--r--src/test/univalue_tests.cpp2
-rw-r--r--src/univalue/gen.cpp1
-rw-r--r--src/univalue/univalue_escapes.h2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 0be54ebd41..a3e43e0cc5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -434,13 +434,14 @@ void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vector<CBl
// Iterate over those blocks in vToFetch (in forward direction), adding the ones that
// are not yet downloaded and not in flight to vBlocks. In the mean time, update
- // pindexLastCommonBlock as long as all ancestors are already downloaded.
+ // pindexLastCommonBlock as long as all ancestors are already downloaded, or if it's
+ // already part of our chain (and therefore don't need it even if pruned).
BOOST_FOREACH(CBlockIndex* pindex, vToFetch) {
if (!pindex->IsValid(BLOCK_VALID_TREE)) {
// We consider the chain that this peer is on invalid.
return;
}
- if (pindex->nStatus & BLOCK_HAVE_DATA) {
+ if (pindex->nStatus & BLOCK_HAVE_DATA || chainActive.Contains(pindex)) {
if (pindex->nChainTx)
state->pindexLastCommonBlock = pindex;
} else if (mapBlocksInFlight.count(pindex->GetBlockHash()) == 0) {
diff --git a/src/test/univalue_tests.cpp b/src/test/univalue_tests.cpp
index 2c1d303f66..16bc8d30f6 100644
--- a/src/test/univalue_tests.cpp
+++ b/src/test/univalue_tests.cpp
@@ -286,7 +286,7 @@ BOOST_AUTO_TEST_CASE(univalue_object)
}
static const char *json1 =
-"[1.10000000,{\"key1\":\"str\\u0000\",\"key2\":800,\"key3\":{\"name\":\"martian\"}}]";
+"[1.10000000,{\"key1\":\"str\\u0000\",\"key2\":800,\"key3\":{\"name\":\"martian http://test.com\"}}]";
BOOST_AUTO_TEST_CASE(univalue_readwrite)
{
diff --git a/src/univalue/gen.cpp b/src/univalue/gen.cpp
index abebe88634..5e5a4d4aed 100644
--- a/src/univalue/gen.cpp
+++ b/src/univalue/gen.cpp
@@ -22,7 +22,6 @@ static void initJsonEscape()
{
escapes[(int)'"'] = "\\\"";
escapes[(int)'\\'] = "\\\\";
- escapes[(int)'/'] = "\\/";
escapes[(int)'\b'] = "\\b";
escapes[(int)'\f'] = "\\f";
escapes[(int)'\n'] = "\\n";
diff --git a/src/univalue/univalue_escapes.h b/src/univalue/univalue_escapes.h
index 0514118285..4133b24ca1 100644
--- a/src/univalue/univalue_escapes.h
+++ b/src/univalue/univalue_escapes.h
@@ -49,7 +49,7 @@ static const char *escapes[256] = {
NULL,
NULL,
NULL,
- "\\/",
+ NULL,
NULL,
NULL,
NULL,