aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp6
-rw-r--r--src/main.cpp11
-rw-r--r--src/net.cpp2
-rw-r--r--src/protocol.h8
-rw-r--r--src/txmempool.cpp4
-rw-r--r--src/util.cpp2
-rw-r--r--src/util.h3
-rw-r--r--src/version.h2
-rw-r--r--src/wallet/crypter.cpp2
-rw-r--r--src/wallet/wallet.cpp2
10 files changed, 34 insertions, 8 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 21a566848..b8ef781a8 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -321,6 +321,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-proxyrandomize", strprintf(_("Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)"), 1));
strUsage += HelpMessageOpt("-seednode=<ip>", _("Connect to a node to retrieve peer addresses, and disconnect"));
strUsage += HelpMessageOpt("-timeout=<n>", strprintf(_("Specify connection timeout in milliseconds (minimum: 1, default: %d)"), DEFAULT_CONNECT_TIMEOUT));
+ strUsage += HelpMessageOpt("-bloomfilters", _("Allow peers to set bloom filters (default: 1)"));
#ifdef USE_UPNP
#if USE_UPNP
strUsage += HelpMessageOpt("-upnp", _("Use UPnP to map the listening port (default: 1 when listening)"));
@@ -669,6 +670,11 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
fLogTimestamps = GetBoolArg("-logtimestamps", true);
fLogIPs = GetBoolArg("-logips", false);
+ fBloomFilters = GetBoolArg("-bloomfilters", true);
+ if (fBloomFilters) {
+ nLocalServices |= NODE_BLOOM;
+ }
+
// when specifying an explicit binding address, you want to listen on it
// even when -connect or -proxy is specified
if (mapArgs.count("-bind")) {
diff --git a/src/main.cpp b/src/main.cpp
index 070b27832..8e52b5a8e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3550,7 +3550,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
}
}
} catch (const std::exception& e) {
- LogPrintf("%s: Deserialize or I/O error - %s", __func__, e.what());
+ LogPrintf("%s: Deserialize or I/O error - %s\n", __func__, e.what());
}
}
} catch (const std::runtime_error& e) {
@@ -4691,6 +4691,15 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
}
}
+ else if (!fBloomFilters &&
+ (strCommand == "filterload" ||
+ strCommand == "filteradd" ||
+ strCommand == "filterclear"))
+ {
+ pfrom->CloseSocketDisconnect();
+ return error("peer %s attempted to set a bloom filter even though we do not advertise that service",
+ pfrom->addr.ToString().c_str());
+ }
else if (strCommand == "filterload")
{
diff --git a/src/net.cpp b/src/net.cpp
index 3908be682..ce5cd29de 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -548,7 +548,7 @@ bool CNode::ReceiveMsgBytes(const char *pch, unsigned int nBytes)
return false;
if (msg.in_data && msg.hdr.nMessageSize > MAX_PROTOCOL_MESSAGE_LENGTH) {
- LogPrint("net", "Oversized message from peer=%i, disconnecting", GetId());
+ LogPrint("net", "Oversized message from peer=%i, disconnecting\n", GetId());
return false;
}
diff --git a/src/protocol.h b/src/protocol.h
index b5e65032a..b9e021990 100644
--- a/src/protocol.h
+++ b/src/protocol.h
@@ -71,10 +71,16 @@ enum {
// set by all Bitcoin Core nodes, and is unset by SPV clients or other peers that just want
// network services but don't provide them.
NODE_NETWORK = (1 << 0),
+
+ // NODE_BLOOM means the node is capable and willing to handle bloom-filtered connections.
+ // Dogecoin Core will continue to support this by default, but will allow disabling it
+ // with the -bloomfilters option.
+ NODE_BLOOM = (1 << 1),
+
// NODE_GETUTXO means the node is capable of responding to the getutxo protocol request.
// Bitcoin Core does not support this but a patch set called Bitcoin XT does.
// See BIP 64 for details on how this is implemented.
- NODE_GETUTXO = (1 << 1),
+ NODE_GETUTXO = (1 << 2),
// Bits 24-31 are reserved for temporary experiments. Just pick a bit that
// isn't getting used, or one not being used much, and notify the
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index 1502cc6d2..24dd2a2ae 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -343,7 +343,7 @@ CTxMemPool::WriteFeeEstimates(CAutoFile& fileout) const
minerPolicyEstimator->Write(fileout);
}
catch (const std::exception&) {
- LogPrintf("CTxMemPool::WriteFeeEstimates(): unable to write policy estimator data (non-fatal)");
+ LogPrintf("CTxMemPool::WriteFeeEstimates(): unable to write policy estimator data (non-fatal)\n");
return false;
}
return true;
@@ -362,7 +362,7 @@ CTxMemPool::ReadFeeEstimates(CAutoFile& filein)
minerPolicyEstimator->Read(filein);
}
catch (const std::exception&) {
- LogPrintf("CTxMemPool::ReadFeeEstimates(): unable to read policy estimator data (non-fatal)");
+ LogPrintf("CTxMemPool::ReadFeeEstimates(): unable to read policy estimator data (non-fatal)\n");
return false;
}
return true;
diff --git a/src/util.cpp b/src/util.cpp
index bfb95c904..4fbe66219 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -106,6 +106,8 @@ bool fPrintToDebugLog = true;
bool fDaemon = false;
bool fServer = false;
string strMiscWarning;
+
+bool fBloomFilters = true;
bool fLogTimestamps = false;
bool fLogIPs = false;
volatile bool fReopenDebugLog = false;
diff --git a/src/util.h b/src/util.h
index 4cc0faf4d..9b0088d49 100644
--- a/src/util.h
+++ b/src/util.h
@@ -43,6 +43,9 @@ extern bool fPrintToConsole;
extern bool fPrintToDebugLog;
extern bool fServer;
extern std::string strMiscWarning;
+
+
+extern bool fBloomFilters;
extern bool fLogTimestamps;
extern bool fLogIPs;
extern volatile bool fReopenDebugLog;
diff --git a/src/version.h b/src/version.h
index 278ddb71e..02ccfd0e1 100644
--- a/src/version.h
+++ b/src/version.h
@@ -9,7 +9,7 @@
* network protocol versioning
*/
-static const int PROTOCOL_VERSION = 70003;
+static const int PROTOCOL_VERSION = 70004;
//! initial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;
diff --git a/src/wallet/crypter.cpp b/src/wallet/crypter.cpp
index c7f7e2167..0b0fb562e 100644
--- a/src/wallet/crypter.cpp
+++ b/src/wallet/crypter.cpp
@@ -186,7 +186,7 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn)
}
if (keyPass && keyFail)
{
- LogPrintf("The wallet is probably corrupted: Some keys decrypt but not all.");
+ LogPrintf("The wallet is probably corrupted: Some keys decrypt but not all.\n");
assert(false);
}
if (keyFail || !keyPass)
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 98d01978c..c635d21db 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2002,7 +2002,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey)
if (!wtxNew.AcceptToMemoryPool(false))
{
// This must not fail. The transaction has already been signed and recorded.
- LogPrintf("CommitTransaction(): Error: Transaction not valid");
+ LogPrintf("CommitTransaction(): Error: Transaction not valid\n");
return false;
}
wtxNew.RelayWalletTransaction();