Segwit temp disabled to connect to more than one node while sync'ing

This commit is contained in:
Ray Engelking 2018-01-09 09:49:21 -05:00
parent cc07563557
commit 46d41142a3
7 changed files with 76 additions and 13 deletions

View File

@ -5,13 +5,35 @@
<projects> <projects>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand>
<name>org.eclipse.cdt.autotools.core.genmakebuilderV2</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand> <buildCommand>
<name>org.python.pydev.PyDevBuilder</name> <name>org.python.pydev.PyDevBuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.python.pydev.pythonNature</nature> <nature>org.python.pydev.pythonNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.eclipse.cdt.autotools.core.autotoolsNatureV2</nature>
</natures> </natures>
</projectDescription> </projectDescription>

View File

@ -197,13 +197,19 @@ void CAddrMan::Good_(const CService& addr, int64_t nTime)
// if not found, bail out // if not found, bail out
if (!pinfo) if (!pinfo)
{
LogPrint(BCLog::ADDRMAN, "if not found, bail out: %s\n", addr.ToString());
return; return;
}
CAddrInfo& info = *pinfo; CAddrInfo& info = *pinfo;
// check whether we are talking about the exact same CService (including same port) // check whether we are talking about the exact same CService (including same port)
if (info != addr) if (info != addr)
{
LogPrint(BCLog::ADDRMAN, "exact same CService (including same port): %s\n", addr.ToString());
return; return;
}
// update info // update info
info.nLastSuccess = nTime; info.nLastSuccess = nTime;
@ -214,7 +220,10 @@ void CAddrMan::Good_(const CService& addr, int64_t nTime)
// if it is already in the tried set, don't do anything else // if it is already in the tried set, don't do anything else
if (info.fInTried) if (info.fInTried)
{
LogPrint(BCLog::ADDRMAN, "Already in tried set: %s\n", addr.ToString());
return; return;
}
// find a bucket it is in now // find a bucket it is in now
int nRnd = RandomInt(ADDRMAN_NEW_BUCKET_COUNT); int nRnd = RandomInt(ADDRMAN_NEW_BUCKET_COUNT);
@ -231,7 +240,10 @@ void CAddrMan::Good_(const CService& addr, int64_t nTime)
// if no bucket is found, something bad happened; // if no bucket is found, something bad happened;
// TODO: maybe re-add the node, but for now, just bail out // TODO: maybe re-add the node, but for now, just bail out
if (nUBucket == -1) if (nUBucket == -1)
{
LogPrint(BCLog::ADDRMAN, "No bucket found: %s\n", addr.ToString());
return; return;
}
LogPrint(BCLog::ADDRMAN, "Moving %s to tried\n", addr.ToString()); LogPrint(BCLog::ADDRMAN, "Moving %s to tried\n", addr.ToString());

View File

@ -96,11 +96,14 @@ public:
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0; consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1485561600; // January 28, 2017 consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1485561600; // January 28, 2017
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1530446401; // July 1, 2018 FLO future date consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1530446401; // July 1, 2018 FLO future date
// consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1517356801; // January 31st, 2018
// Deployment of SegWit (BIP141, BIP143, and BIP147) // Deployment of SegWit (BIP141, BIP143, and BIP147)
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1; consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1485561600; // January 28, 2017 consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1517356801; // January 31st, 2018
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1530446401; // July 1, 2018 FLO future date consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 0; // not using segwit
// consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1530446401; // July 1, 2018 FLO future date
// consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1517356801; // January 31st, 2018
// The best chain should have at least this much work. // The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000011f1db4843f05806"); consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000011f1db4843f05806");
@ -149,6 +152,25 @@ public:
// Note that of those with the service bits flag, most only support a subset of possible options // Note that of those with the service bits flag, most only support a subset of possible options
// vSeeds.emplace_back("flo.seednode.net", true); // vSeeds.emplace_back("flo.seednode.net", true);
vSeeds.emplace_back("seed1.florincoin.org", false);
vSeeds.emplace_back("seed2.florincoin.org", false);
vSeeds.emplace_back("seed3.florincoin.org", false);
vSeeds.emplace_back("seed4.florincoin.org", false);
vSeeds.emplace_back("seed5.florincoin.org", false);
vSeeds.emplace_back("seed6.florincoin.org", false);
vSeeds.emplace_back("seed7.florincoin.org", false);
vSeeds.emplace_back("seed8.florincoin.org", false);
vSeeds.emplace_back("seed1.florincoin.com", false);
vSeeds.emplace_back("seed2.florincoin.com", false);
vSeeds.emplace_back("seed3.florincoin.com", false);
vSeeds.emplace_back("seed4.florincoin.com", false);
vSeeds.emplace_back("nyc2.entertheblockchain.com", false);
vSeeds.emplace_back("sf1.entertheblockchain.com", false);
vSeeds.emplace_back("am2.entertheblockchain.com", false);
vSeeds.emplace_back("sgp.entertheblockchain.com", false);
vSeeds.emplace_back("ind.entertheblockchain.com", false);
vSeeds.emplace_back("de.entertheblockchain.com", false);
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,35); base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,35);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,8); base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,8);
base58Prefixes[SCRIPT_ADDRESS2] = std::vector<unsigned char>(1,50); base58Prefixes[SCRIPT_ADDRESS2] = std::vector<unsigned char>(1,50);
@ -194,8 +216,9 @@ public:
1515282818, // * UNIX timestamp of last known number of transactions 1515282818, // * UNIX timestamp of last known number of transactions
3223208, // * total number of transactions between genesis and that timestamp 3223208, // * total number of transactions between genesis and that timestamp
// (the tx=... number in the SetBestChain debug.log lines) // (the tx=... number in the SetBestChain debug.log lines)
0.04282469282115031 // * estimated number of transactions per second after that timestamp 0.04 // * estimated number of transactions per second after that timestamp
}; };
} }
}; };
@ -253,7 +276,7 @@ public:
vFixedSeeds.clear(); vFixedSeeds.clear();
vSeeds.clear(); vSeeds.clear();
// nodes with support for servicebits filtering should be at the top // nodes with support for servicebits filtering should be at the top
vSeeds.emplace_back("testnet.florincoin.info", true); vSeeds.emplace_back("testnet.florincoin.info", false);
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,115); base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,115);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,198); base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,198);

View File

@ -32,7 +32,7 @@ class CBaseMainParams : public CBaseChainParams
public: public:
CBaseMainParams() CBaseMainParams()
{ {
nRPCPort = 7312; nRPCPort = 7313;
} }
}; };
@ -44,7 +44,7 @@ class CBaseTestNetParams : public CBaseChainParams
public: public:
CBaseTestNetParams() CBaseTestNetParams()
{ {
nRPCPort = 17312; nRPCPort = 17313;
strDataDir = "testnet4"; strDataDir = "testnet4";
} }
}; };
@ -57,7 +57,7 @@ class CBaseRegTestParams : public CBaseChainParams
public: public:
CBaseRegTestParams() CBaseRegTestParams()
{ {
nRPCPort = 17312; nRPCPort = 17313;
strDataDir = "regtest"; strDataDir = "regtest";
} }
}; };

View File

@ -1266,6 +1266,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
// These bits have been used as a flag to indicate that a node is running incompatible // These bits have been used as a flag to indicate that a node is running incompatible
// consensus rules instead of changing the network magic, so we're stuck disconnecting // consensus rules instead of changing the network magic, so we're stuck disconnecting
// based on these service bits, at least for a while. // based on these service bits, at least for a while.
LogPrintf("Immediately disconnect peers that use service bits 6 or 8 until August 1st, 2018: %s\n", pfrom->addr.ToString());
pfrom->fDisconnect = true; pfrom->fDisconnect = true;
return false; return false;
} }
@ -1367,6 +1368,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
connman.PushMessage(pfrom, CNetMsgMaker(nSendVersion).Make(NetMsgType::GETADDR)); connman.PushMessage(pfrom, CNetMsgMaker(nSendVersion).Make(NetMsgType::GETADDR));
pfrom->fGetAddr = true; pfrom->fGetAddr = true;
} }
LogPrintf("MarkAddressGood: %s\n", pfrom->addr.ToString());
connman.MarkAddressGood(pfrom->addr); connman.MarkAddressGood(pfrom->addr);
} }
@ -1471,11 +1473,13 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
int64_t nSince = nNow - 10 * 60; int64_t nSince = nNow - 10 * 60;
for (CAddress& addr : vAddr) for (CAddress& addr : vAddr)
{ {
if (interruptMsgProc) if (interruptMsgProc)
return true; return true;
if ((addr.nServices & REQUIRED_SERVICES) != REQUIRED_SERVICES) if ((addr.nServices & REQUIRED_SERVICES) != REQUIRED_SERVICES)
continue; {
continue;
}
if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60) if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)
addr.nTime = nNow - 5 * 24 * 60 * 60; addr.nTime = nNow - 5 * 24 * 60 * 60;
@ -1488,7 +1492,9 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
} }
// Do not store addresses outside our network // Do not store addresses outside our network
if (fReachable) if (fReachable)
{
vAddrOk.push_back(addr); vAddrOk.push_back(addr);
}
} }
connman.AddNewAddresses(vAddrOk, pfrom->addr, 2 * 60 * 60); connman.AddNewAddresses(vAddrOk, pfrom->addr, 2 * 60 * 60);
if (vAddr.size() < 1000) if (vAddr.size() < 1000)

View File

@ -205,8 +205,8 @@ UniValue addnode(const JSONRPCRequest& request)
"1. \"node\" (string, required) The node (see getpeerinfo for nodes)\n" "1. \"node\" (string, required) The node (see getpeerinfo for nodes)\n"
"2. \"command\" (string, required) 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once\n" "2. \"command\" (string, required) 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once\n"
"\nExamples:\n" "\nExamples:\n"
+ HelpExampleCli("addnode", "\"192.168.0.6:7313\" \"onetry\"") + HelpExampleCli("addnode", "\"192.168.0.6:7312\" \"onetry\"")
+ HelpExampleRpc("addnode", "\"192.168.0.6:7313\", \"onetry\"") + HelpExampleRpc("addnode", "\"192.168.0.6:7312\", \"onetry\"")
); );
if(!g_connman) if(!g_connman)
@ -294,7 +294,7 @@ UniValue getaddednodeinfo(const JSONRPCRequest& request)
" \"connected\" : true|false, (boolean) If connected\n" " \"connected\" : true|false, (boolean) If connected\n"
" \"addresses\" : [ (list of objects) Only when connected = true\n" " \"addresses\" : [ (list of objects) Only when connected = true\n"
" {\n" " {\n"
" \"address\" : \"192.168.0.201:7313\", (string) The flo server IP and port we're connected to\n" " \"address\" : \"192.168.0.201:7312\", (string) The flo server IP and port we're connected to\n"
" \"connected\" : \"outbound\" (string) connection, inbound or outbound\n" " \"connected\" : \"outbound\" (string) connection, inbound or outbound\n"
" }\n" " }\n"
" ]\n" " ]\n"

View File

@ -520,7 +520,7 @@ std::string HelpExampleCli(const std::string& methodname, const std::string& arg
std::string HelpExampleRpc(const std::string& methodname, const std::string& args) std::string HelpExampleRpc(const std::string& methodname, const std::string& args)
{ {
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", " return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:7312/\n"; "\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:7313/\n";
} }
void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface) void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)