Merge branch 'node-bloom-service-bit' of github.com:petertodd/bitcoin into bloom-todd

This commit is contained in:
Jannis Froese 2014-03-23 21:25:51 +01:00
commit 103a278443
5 changed files with 17 additions and 1 deletions

View file

@ -419,6 +419,11 @@ bool AppInit2(boost::thread_group& threadGroup)
// ********************************************************* Step 2: parameter interactions
fBloomFilters = GetBoolArg("-bloomfilters", true);
if (fBloomFilters) {
nLocalServices |= NODE_BLOOM;
}
if (mapArgs.count("-bind")) {
// when specifying an explicit binding address, you want to listen on it
// even when -connect or -proxy is specified

View file

@ -4015,6 +4015,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")
{

View file

@ -94,6 +94,7 @@ bool fPrintToDebugLog = true;
bool fDaemon = false;
bool fServer = false;
string strMiscWarning;
bool fBloomFilters = true;
bool fNoListen = false;
bool fLogTimestamps = false;
volatile bool fReopenDebugLog = false;

View file

@ -114,6 +114,7 @@ extern bool fPrintToConsole;
extern bool fPrintToDebugLog;
extern bool fServer;
extern std::string strMiscWarning;
extern bool fBloomFilters;
extern bool fNoListen;
extern bool fLogTimestamps;
extern volatile bool fReopenDebugLog;

View file

@ -27,7 +27,7 @@ extern const std::string CLIENT_DATE;
// network protocol versioning
//
static const int PROTOCOL_VERSION = 70001;
static const int PROTOCOL_VERSION = 70002;
// intial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;