mirror of
https://github.com/dashpay/dash.git
synced 2024-12-30 14:25:53 +01:00
Add NODE_BLOOM service bit and option to disable bloom filters
This commit is contained in:
parent
1877fb9aae
commit
176e54c5f7
@ -315,6 +315,7 @@ std::string HelpMessage()
|
||||
" -bantime=<n> " + _("Number of seconds to keep misbehaving peers from reconnecting (default: 86400)") + "\n" +
|
||||
" -maxreceivebuffer=<n> " + _("Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)") + "\n" +
|
||||
" -maxsendbuffer=<n> " + _("Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)") + "\n" +
|
||||
" -bloomfilters " + _("Allow peers to set bloom filters (default: 0)") + "\n" +
|
||||
#ifdef USE_UPNP
|
||||
#if USE_UPNP
|
||||
" -upnp " + _("Use UPnP to map the listening port (default: 1 when listening)") + "\n" +
|
||||
@ -494,6 +495,9 @@ bool AppInit2(boost::thread_group& threadGroup)
|
||||
// ********************************************************* Step 2: parameter interactions
|
||||
|
||||
fTestNet = GetBoolArg("-testnet");
|
||||
fBloomFilters = GetBoolArg("-bloomfilters");
|
||||
if (fBloomFilters)
|
||||
nLocalServices |= NODE_BLOOM;
|
||||
|
||||
if (mapArgs.count("-bind")) {
|
||||
// when specifying an explicit binding address, you want to listen on it
|
||||
|
10
src/main.cpp
10
src/main.cpp
@ -3692,6 +3692,16 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
|
||||
}
|
||||
|
||||
|
||||
else if (!fBloomFilters &&
|
||||
(strCommand == "filterload" ||
|
||||
strCommand == "filteradd" ||
|
||||
strCommand == "filterclear"))
|
||||
{
|
||||
pfrom->Misbehaving(100);
|
||||
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")
|
||||
{
|
||||
CBloomFilter filter;
|
||||
|
@ -69,6 +69,7 @@ class CMessageHeader
|
||||
enum
|
||||
{
|
||||
NODE_NETWORK = (1 << 0),
|
||||
NODE_BLOOM = (1 << 1),
|
||||
};
|
||||
|
||||
/** A CService with information about it as peer */
|
||||
|
@ -79,6 +79,7 @@ bool fServer = false;
|
||||
bool fCommandLine = false;
|
||||
string strMiscWarning;
|
||||
bool fTestNet = false;
|
||||
bool fBloomFilters = false;
|
||||
bool fNoListen = false;
|
||||
bool fLogTimestamps = false;
|
||||
CMedianFilter<int64> vTimeOffsets(200,0);
|
||||
|
@ -144,6 +144,7 @@ extern bool fServer;
|
||||
extern bool fCommandLine;
|
||||
extern std::string strMiscWarning;
|
||||
extern bool fTestNet;
|
||||
extern bool fBloomFilters;
|
||||
extern bool fNoListen;
|
||||
extern bool fLogTimestamps;
|
||||
extern volatile bool fReopenDebugLog;
|
||||
|
@ -25,7 +25,7 @@ extern const std::string CLIENT_DATE;
|
||||
// network protocol versioning
|
||||
//
|
||||
|
||||
static const int PROTOCOL_VERSION = 70001;
|
||||
static const int PROTOCOL_VERSION = 70002;
|
||||
|
||||
// earlier versions not supported as of Feb 2012, and are disconnected
|
||||
static const int MIN_PROTO_VERSION = 209;
|
||||
|
Loading…
Reference in New Issue
Block a user