Skip to content

Commit

Permalink
Merge pull request #383 from FeatherCoin/0.18
Browse files Browse the repository at this point in the history
Testnet seeder and stale tip changes
  • Loading branch information
Feathercoin committed Jan 20, 2020
2 parents 405a468 + 64dfc68 commit 5ad682d
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 18)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_REVISION, 2)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
Expand Down
3 changes: 2 additions & 1 deletion contrib/seeds/nodes_test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
209.97.138.214:19336
46.101.143.71:19336
46.101.61.91:19336
165.227.77.105:19336
2 changes: 1 addition & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CMainParams : public CChainParams {
consensus.powNeoScryptLimit = uint256S("0000003fffff0000000000000000000000000000000000000000000000000000");
consensus.nPowTargetTimespan = 3.5 * 24 * 60 * 60; // two weeks
consensus.nPowTargetSpacing = 2.5 * 60;
consensus.checkpointPubKey = "04c67c0114bc7cb8bb84ee0f3319e1df3339d335a15bdb04605cf2655d19212848a66d4535f3c91e943061474b7cacfd4eaa10835d35a8d4e431c68a4c4f5450ba";
consensus.checkpointPubKey = "0425165000270c45a2df329bb6cc179782e1ddcdd9afc6240b5f465d49b8f480635c43e6b194e98f69e9827fa7a62d4791ee96c9fa90ec11e45af5d6b2dbb76774";
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = false;
consensus.nRuleChangeActivationThreshold = 15120; // 75% of 20160
Expand Down
6 changes: 3 additions & 3 deletions src/chainparamsseeds.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ static SeedSpec6 pnSeed6_main[] = {
};

static SeedSpec6 pnSeed6_test[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x65,0x3d,0x5b}, 19336},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa5,0xe3,0x4d,0x69}, 19336}
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0x61,0x8a,0xd6}, 19336},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x65,0x8f,0x47}, 19336},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x65,0x3d,0x5b}, 19336}
};
#endif // BITCOIN_CHAINPARAMSSEEDS_H

6 changes: 6 additions & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,12 @@ bool AppInitMain(InitInterfaces& interfaces)
MIN_BLOCKS_TO_KEEP);
}

uiInterface.InitMessage(_("Checking ACP ..."));
if (!CheckCheckpointPubKey()) {
strLoadError = _("Checking ACP pubkey failed");
break;
}

CBlockIndex* tip = chainActive.Tip();
RPCNotifyBlockChange(true, tip);
if (tip && tip->nTime > GetAdjustedTime() + 2 * 60 * 60) {
Expand Down
2 changes: 1 addition & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
return;

// Add seed nodes if DNS seeds are all down (an infrastructure attack?).
if (addrman.size() == 0 && (GetTime() - nStart > 60)) {
if (addrman.size() == 0 && (GetTime() - nStart > 5)) {
static bool done = false;
if (!done) {
LogPrintf("Adding fixed seed nodes as DNS doesn't seem to be available.\n");
Expand Down
2 changes: 1 addition & 1 deletion src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ static bool TipMayBeStale(const Consensus::Params &consensusParams) EXCLUSIVE_LO
if (g_last_tip_update == 0) {
g_last_tip_update = GetTime();
}
return g_last_tip_update < GetTime() - consensusParams.nPowTargetSpacing * 3 && mapBlocksInFlight.empty();
return g_last_tip_update < GetTime() - consensusParams.nPowTargetSpacing * 12 && mapBlocksInFlight.empty();
}

static bool CanDirectFetch(const Consensus::Params &consensusParams) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Expand Down
2 changes: 1 addition & 1 deletion src/test/denialofservice_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ BOOST_AUTO_TEST_CASE(stale_tip_peer_management)
BOOST_CHECK(node->fDisconnect == false);
}

SetMockTime(GetTime() + 4*consensusParams.nPowTargetSpacing + 1);
SetMockTime(GetTime() + 12*consensusParams.nPowTargetSpacing + 1);

// Now tip should definitely be stale, and we should look for an extra
// outbound peer
Expand Down

0 comments on commit 5ad682d

Please sign in to comment.