Auto merge of #1514 - bitcartel:master_1481_client_identifier, r=bitcartel

Rename client identifier from Satoshi to MagicBean (closes #1481)

@ageis seeder will have be to updated too.
This commit is contained in:
zkbot
2016-10-13 02:02:58 -04:00
7 changed files with 26 additions and 26 deletions

View File

@@ -27,7 +27,7 @@ import collections
PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})):(\d+)$") PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})):(\d+)$")
PATTERN_IPV6 = re.compile(r"^\[([0-9a-z:]+)\]:(\d+)$") PATTERN_IPV6 = re.compile(r"^\[([0-9a-z:]+)\]:(\d+)$")
PATTERN_ONION = re.compile(r"^([abcdefghijklmnopqrstuvwxyz234567]{16}\.onion):(\d+)$") PATTERN_ONION = re.compile(r"^([abcdefghijklmnopqrstuvwxyz234567]{16}\.onion):(\d+)$")
PATTERN_AGENT = re.compile(r"^(\/Satoshi:0\.8\.6\/|\/Satoshi:0\.9\.(2|3|4|5)\/|\/Satoshi:0\.10\.\d{1,2}\/|\/Satoshi:0\.11\.\d{1,2}\/)$") PATTERN_AGENT = re.compile(r"^(\/MagicBean:([0-9a-z-.]+)\/)$")
def parseline(line): def parseline(line):
sline = line.split() sline = line.split()

View File

@@ -103,8 +103,8 @@ Now use zcash-cli to verify there is only a single peer connection.
"id" : 1, "id" : 1,
"addr" : "zctestseie6wxgio.onion:18233", "addr" : "zctestseie6wxgio.onion:18233",
... ...
"version" : 70002, "version" : 170002,
"subver" : "/Satoshi:0.11.2/", "subver" : "/MagicBean:1.0.0/",
... ...
} }
] ]

View File

@@ -19,7 +19,7 @@
* for both bitcoind and bitcoin-core, to make it harder for attackers to * for both bitcoind and bitcoin-core, to make it harder for attackers to
* target servers or GUI users specifically. * target servers or GUI users specifically.
*/ */
const std::string CLIENT_NAME("Satoshi"); const std::string CLIENT_NAME("MagicBean");
/** /**
* Client version number * Client version number

View File

@@ -96,8 +96,8 @@ Value getpeerinfo(const Array& params, bool fHelp)
" \"timeoffset\": ttt, (numeric) The time offset in seconds\n" " \"timeoffset\": ttt, (numeric) The time offset in seconds\n"
" \"pingtime\": n, (numeric) ping time\n" " \"pingtime\": n, (numeric) ping time\n"
" \"pingwait\": n, (numeric) ping wait\n" " \"pingwait\": n, (numeric) ping wait\n"
" \"version\": v, (numeric) The peer version, such as 7001\n" " \"version\": v, (numeric) The peer version, such as 170002\n"
" \"subver\": \"/Satoshi:0.8.5/\", (string) The string version\n" " \"subver\": \"/MagicBean:x.y.z[-v]/\", (string) The string version\n"
" \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n" " \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n"
" \"startingheight\": n, (numeric) The starting height (block) of the peer\n" " \"startingheight\": n, (numeric) The starting height (block) of the peer\n"
" \"banscore\": n, (numeric) The ban score\n" " \"banscore\": n, (numeric) The ban score\n"
@@ -387,7 +387,7 @@ Value getnetworkinfo(const Array& params, bool fHelp)
"\nResult:\n" "\nResult:\n"
"{\n" "{\n"
" \"version\": xxxxx, (numeric) the server version\n" " \"version\": xxxxx, (numeric) the server version\n"
" \"subversion\": \"/Satoshi:x.x.x/\", (string) the server subversion string\n" " \"subversion\": \"/MagicBean:x.y.z[-v]/\", (string) the server subversion string\n"
" \"protocolversion\": xxxxx, (numeric) the protocol version\n" " \"protocolversion\": xxxxx, (numeric) the protocol version\n"
" \"localservices\": \"xxxxxxxxxxxxxxxx\", (string) the services we offer to the network\n" " \"localservices\": \"xxxxxxxxxxxxxxxx\", (string) the services we offer to the network\n"
" \"timeoffset\": xxxxx, (numeric) the time offset\n" " \"timeoffset\": xxxxx, (numeric) the time offset\n"

View File

@@ -92,7 +92,7 @@ void ThreadSendAlert()
alert.strRPCError = "URGENT: Upgrade required: see https://z.cash"; alert.strRPCError = "URGENT: Upgrade required: see https://z.cash";
// Set specific client version/versions here. If setSubVer is empty, no filtering on subver is done: // Set specific client version/versions here. If setSubVer is empty, no filtering on subver is done:
// alert.setSubVer.insert(std::string("/Satoshi:0.7.2/")); // alert.setSubVer.insert(std::string("/MagicBean:0.7.2/"));
// Sign // Sign
const CChainParams& chainparams = Params(); const CChainParams& chainparams = Params();

View File

@@ -166,12 +166,12 @@ void GenerateAlertTests()
SignAndSerialize(alert, sBuffer); SignAndSerialize(alert, sBuffer);
// More tests go here ... // More tests go here ...
alert.setSubVer.insert(std::string("/Satoshi:0.1.0/")); alert.setSubVer.insert(std::string("/MagicBean:0.1.0/"));
alert.strStatusBar = "Alert 1 for Satoshi 0.1.0"; alert.strStatusBar = "Alert 1 for MagicBean 0.1.0";
SignAndSerialize(alert, sBuffer); SignAndSerialize(alert, sBuffer);
alert.setSubVer.insert(std::string("/Satoshi:0.2.0/")); alert.setSubVer.insert(std::string("/MagicBean:0.2.0/"));
alert.strStatusBar = "Alert 1 for Satoshi 0.1.0, 0.2.0"; alert.strStatusBar = "Alert 1 for MagicBean 0.1.0, 0.2.0";
SignAndSerialize(alert, sBuffer); SignAndSerialize(alert, sBuffer);
alert.setSubVer.clear(); alert.setSubVer.clear();
@@ -204,8 +204,8 @@ void GenerateAlertTests()
SignAndSerialize(alert, sBuffer); SignAndSerialize(alert, sBuffer);
++alert.nID; ++alert.nID;
alert.strStatusBar = "Alert 2 for Satoshi 0.1.0"; alert.strStatusBar = "Alert 2 for MagicBean 0.1.0";
alert.setSubVer.insert(std::string("/Satoshi:0.1.0/")); alert.setSubVer.insert(std::string("/MagicBean:0.1.0/"));
SignAndSerialize(alert, sBuffer); SignAndSerialize(alert, sBuffer);
++alert.nID; ++alert.nID;
@@ -296,27 +296,27 @@ BOOST_AUTO_TEST_CASE(AlertApplies)
// Matches: // Matches:
BOOST_CHECK(alerts[0].AppliesTo(1, "")); BOOST_CHECK(alerts[0].AppliesTo(1, ""));
BOOST_CHECK(alerts[0].AppliesTo(999001, "")); BOOST_CHECK(alerts[0].AppliesTo(999001, ""));
BOOST_CHECK(alerts[0].AppliesTo(1, "/Satoshi:11.11.11/")); BOOST_CHECK(alerts[0].AppliesTo(1, "/MagicBean:11.11.11/"));
BOOST_CHECK(alerts[1].AppliesTo(1, "/Satoshi:0.1.0/")); BOOST_CHECK(alerts[1].AppliesTo(1, "/MagicBean:0.1.0/"));
BOOST_CHECK(alerts[1].AppliesTo(999001, "/Satoshi:0.1.0/")); BOOST_CHECK(alerts[1].AppliesTo(999001, "/MagicBean:0.1.0/"));
BOOST_CHECK(alerts[2].AppliesTo(1, "/Satoshi:0.1.0/")); BOOST_CHECK(alerts[2].AppliesTo(1, "/MagicBean:0.1.0/"));
BOOST_CHECK(alerts[2].AppliesTo(1, "/Satoshi:0.2.0/")); BOOST_CHECK(alerts[2].AppliesTo(1, "/MagicBean:0.2.0/"));
// Don't match: // Don't match:
BOOST_CHECK(!alerts[0].AppliesTo(-1, "")); BOOST_CHECK(!alerts[0].AppliesTo(-1, ""));
BOOST_CHECK(!alerts[0].AppliesTo(999002, "")); BOOST_CHECK(!alerts[0].AppliesTo(999002, ""));
BOOST_CHECK(!alerts[1].AppliesTo(1, "")); BOOST_CHECK(!alerts[1].AppliesTo(1, ""));
BOOST_CHECK(!alerts[1].AppliesTo(1, "Satoshi:0.1.0")); BOOST_CHECK(!alerts[1].AppliesTo(1, "MagicBean:0.1.0"));
BOOST_CHECK(!alerts[1].AppliesTo(1, "/Satoshi:0.1.0")); BOOST_CHECK(!alerts[1].AppliesTo(1, "/MagicBean:0.1.0"));
BOOST_CHECK(!alerts[1].AppliesTo(1, "Satoshi:0.1.0/")); BOOST_CHECK(!alerts[1].AppliesTo(1, "MagicBean:0.1.0/"));
BOOST_CHECK(!alerts[1].AppliesTo(-1, "/Satoshi:0.1.0/")); BOOST_CHECK(!alerts[1].AppliesTo(-1, "/MagicBean:0.1.0/"));
BOOST_CHECK(!alerts[1].AppliesTo(999002, "/Satoshi:0.1.0/")); BOOST_CHECK(!alerts[1].AppliesTo(999002, "/MagicBean:0.1.0/"));
BOOST_CHECK(!alerts[1].AppliesTo(1, "/Satoshi:0.2.0/")); BOOST_CHECK(!alerts[1].AppliesTo(1, "/MagicBean:0.2.0/"));
BOOST_CHECK(!alerts[2].AppliesTo(1, "/Satoshi:0.3.0/")); BOOST_CHECK(!alerts[2].AppliesTo(1, "/MagicBean:0.3.0/"));
SetMockTime(0); SetMockTime(0);
} }

Binary file not shown.