Skip to content

Commit

Permalink
Merge pull request #27 from coolblock/master
Browse files Browse the repository at this point in the history
Bug Fixes and Reporting Enhancements
  • Loading branch information
coolblock committed Jun 25, 2019
2 parents 568d00a + a11e9a1 commit 77c95ed
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 18 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 12)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_BUILD, 16)
define(_CLIENT_VERSION_BUILD, 17)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2018)
AC_INIT([Vivo Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/vivocoin/vivo/issues],[vivocore])
Expand Down
2 changes: 1 addition & 1 deletion share/genbuild.sh
Expand Up @@ -28,7 +28,7 @@ if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/

# otherwise generate suffix from git, i.e. string like "59887e8-dirty"
SUFFIX=$(git rev-parse --short HEAD)
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty"
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-Special"

# get a string like "2012-04-10 16:27:19 +0200"
LAST_COMMIT_DATE="$(git log -n 1 --format="%ci")"
Expand Down
5 changes: 3 additions & 2 deletions src/chainparams.cpp
Expand Up @@ -182,8 +182,9 @@ class CMainParams : public CChainParams {
(308000, uint256S("0x0000000018ee47a3c93296309ce207724868232706f59a6937362581476ce462"))
(349891, uint256S("0x000000000965eb7af631e8717d10b477568a699cbb5cc172f723204f699e3488"))
(378129, uint256S("0x000000002f22a53a0228c6b94c960ba923df660531911392841196f641970b5f"))
(420300, uint256S("0x0000000037e291974d11f3f0c5309632db5d1b5c70162014a11e3de7920a548b")),
1557968975, // * UNIX timestamp of last checkpoint block
(420300, uint256S("0x0000000037e291974d11f3f0c5309632db5d1b5c70162014a11e3de7920a548b"))
(444770, uint256S("0x00000000a21f0077a24e0d814dcfca41144a49d671ad2f3adb9f5fe5f509efaa")),
1561331573, // * UNIX timestamp of last checkpoint block
5000, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
500 // * estimated number of transactions per day after checkpoint
Expand Down
25 changes: 21 additions & 4 deletions src/governance.cpp
Expand Up @@ -106,10 +106,18 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
// lite mode is not supported
if(fLiteMode) return;
if(!masternodeSync.IsBlockchainSynced()) return;

//LogPrintf("GGGGGG <%i> <%i> %d \n", pfrom->strSubVer, pfrom->cleanSubVer, pfrom->nVersion);
if(pfrom->nVersion < MIN_GOVERNANCE_PEER_PROTO_VERSION) return;
if(pfrom->nVersion == 70209) return;
if(pfrom->nVersion == 70208) return;
if(pfrom->nVersion == 70208) return;
string searchVersion ("Vivo Core:0.12.1.12");
if (pfrom->cleanSubVer.find(searchVersion) != std::string::npos)
{
LogPrintf("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZAAAAAAAAAA\n");
return;
}

//exsplit

// ANOTHER USER IS ASKING US TO HELP THEM SYNC GOVERNANCE OBJECT DATA
if (strCommand == NetMsgType::MNGOVERNANCESYNC)
Expand All @@ -127,7 +135,8 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C


if(pfrom->nVersion != 70209)
if(pfrom->nVersion != 70208)
if(pfrom->nVersion != 70208)
//exsplit
if(pfrom->nVersion >= GOVERNANCE_FILTER_PROTO_VERSION) {
vRecv >> filter;
filter.UpdateEmptyFull();
Expand Down Expand Up @@ -1051,6 +1060,8 @@ void CGovernanceManager::RequestGovernanceObject(CNode* pfrom, const uint256& nH
return;
}

//LogPrintf("FFFFFF <%i> <%i> %d \n", pfrom->strSubVer, pfrom->cleanSubVer, pfrom->nVersion);

LogPrint("gobject", "CGovernanceObject::RequestGovernanceObject -- hash = %s (peer=%d)\n", nHash.ToString(), pfrom->GetId());

if(pfrom->nVersion < GOVERNANCE_FILTER_PROTO_VERSION) {
Expand Down Expand Up @@ -1079,7 +1090,11 @@ void CGovernanceManager::RequestGovernanceObject(CNode* pfrom, const uint256& nH

int CGovernanceManager::RequestGovernanceObjectVotes(CNode* pnode)
{
//LogPrintf("DDDDDD <%i> <%i> %d \n", pnode->strSubVer, pnode->cleanSubVer, pnode->nVersion);
if(pnode->nVersion < MIN_GOVERNANCE_PEER_PROTO_VERSION) return -3;
//exsplit


std::vector<CNode*> vNodesCopy;
vNodesCopy.push_back(pnode);
return RequestGovernanceObjectVotes(vNodesCopy);
Expand Down Expand Up @@ -1158,12 +1173,14 @@ int CGovernanceManager::RequestGovernanceObjectVotes(const std::vector<CNode*>&
// they stay connected for a short period of time and it's possible that we won't get everything we should.
// Only use outbound connections - inbound connection could be a "masternode" connection
// initialted from another node, so skip it too.
//LogPrintf("CCCCCC <%i> <%i> %d \n", pnode->strSubVer, pnode->cleanSubVer, pnode->nVersion);
if(pnode->fMasternode || (fMasterNode && pnode->fInbound)) continue;
// only use up to date peers
if(pnode->nVersion < MIN_GOVERNANCE_PEER_PROTO_VERSION) continue;
if(pnode->nVersion == 70209) continue;
if(pnode->nVersion == 70208) continue;

//exsplit

// stop early to prevent setAskFor overflow
size_t nProjectedSize = pnode->setAskFor.size() + nProjectedVotes;
if(nProjectedSize > SETASKFOR_MAX_SZ/2) continue;
Expand Down
33 changes: 26 additions & 7 deletions src/main.cpp
Expand Up @@ -5305,11 +5305,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
#define SIX_WEEKS_SINCE_BLOCK 447187
#define THREE_MONTHS_SINCE_BLOCK 474067
#define FOUR_MONTHS_PLUS_TWOWEEKS_SINCE_BLOCK 500947
#define SIX_MONTHS_PLUS_TWOWEEKS_SINCE_BLOCK 559811

if (chainActive.Height() > FOUR_MONTHS_PLUS_TWOWEEKS_SINCE_BLOCK) {
LogPrintf("YOU NEED TO GET NEW VERSION- UPGRADE VIVO\n");
StartShutdown();
}
//if (chainActive.Height() > SIX_MONTHS_PLUS_TWOWEEKS_SINCE_BLOCK) {
// LogPrintf("YOU NEED TO GET NEW VERSION- UPGRADE VIVO\n");
// StartShutdown();
//}


if (pfrom->nVersion < 70210)
Expand All @@ -5333,7 +5334,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
vRecv >> LIMITED_STRING(pfrom->strSubVer, MAX_SUBVERSION_LENGTH);
pfrom->cleanSubVer = SanitizeString(pfrom->strSubVer);
}


if (!vRecv.empty())
vRecv >> pfrom->nStartingHeight;

string remoteAddrx;
remoteAddrx = ", peeraddr=" + pfrom->addr.ToString();
Expand Down Expand Up @@ -5386,11 +5389,27 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
return false;
}
}

if (chainActive.Height() > FOUR_MONTHS_PLUS_TWOWEEKS_SINCE_BLOCK) {
LogPrintf("===================xxxxxxxxxx4===========================\n");
string searchVersion ("Vivo Core:0.12.1.16");
if (pfrom->cleanSubVer.find(searchVersion) != std::string::npos)
{
LogPrintf("******************* peer=%d using obsolete version %i %s; disconnecting\n", pfrom->id, pfrom->cleanSubVer, remoteAddrx);
//pfrom->PushMessage(NetMsgType::REJECT, strCommand, REJECT_OBSOLETE,
// strprintf("Version must be %d or greater", MIN_PEER_PROTO_VERSION));
pfrom->fDisconnect = true;
return false;
}
}




//END MODS


if (!vRecv.empty())
vRecv >> pfrom->nStartingHeight;

if (!vRecv.empty())
vRecv >> pfrom->fRelayTxes; // set to true after we get the first filter* message
else
Expand Down
6 changes: 5 additions & 1 deletion src/masternode-sync.cpp
Expand Up @@ -489,7 +489,9 @@ void CMasternodeSync::ProcessTick()
if (pnode->nVersion < MIN_GOVERNANCE_PEER_PROTO_VERSION) continue;
if(pnode->nVersion == 70209) continue;
if(pnode->nVersion == 70208) continue;

//exsplit
//LogPrintf("BBBBBB <%i> <%i> %d \n", pnode->strSubVer, pnode->cleanSubVer, pnode->nVersion);

nRequestedMasternodeAttempt++;

SendGovernanceSyncRequest(pnode);
Expand All @@ -505,8 +507,10 @@ void CMasternodeSync::ProcessTick()

void CMasternodeSync::SendGovernanceSyncRequest(CNode* pnode)
{
//LogPrintf("AAAAAA <%i> <%i> %d \n", pnode->strSubVer, pnode->cleanSubVer, pnode->nVersion);
if(pnode->nVersion != 70209)
if(pnode->nVersion != 70208)
//exsplit

if(pnode->nVersion >= GOVERNANCE_FILTER_PROTO_VERSION) {
CBloomFilter filter;
Expand Down
14 changes: 12 additions & 2 deletions src/net.cpp
Expand Up @@ -1581,8 +1581,8 @@ void ThreadOpenConnections()
continue;

// do not allow non-default ports, unless after 50 invalid addresses selected already
if (addr.GetPort() != Params().GetDefaultPort() && nTries < 50)
continue;
//if (addr.GetPort() != Params().GetDefaultPort() && nTries < 50)
// continue;

addrConnect = addr;
break;
Expand Down Expand Up @@ -2135,10 +2135,20 @@ void RelayTransaction(const CTransaction& tx, const CDataStream& ss)

void RelayInv(CInv &inv, const int minProtoVersion) {
LOCK(cs_vNodes);
//exsplit
BOOST_FOREACH(CNode* pnode, vNodes)
{


//LogPrintf("AAAAAA <%i> <%i> %d \n", pnode->strSubVer, pnode->cleanSubVer, pnode->nVersion);
string searchVersion ("Vivo Core:0.12.1.12");
if (pnode->cleanSubVer.find(searchVersion) != std::string::npos)
{
LogPrintf("ZZZZZZZZZZZZZZZZZZZZZ .12 ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\n");
} else
if(pnode->nVersion >= 70210)
pnode->PushInventory(inv);
}
}

void CNode::RecordBytesRecv(uint64_t bytes)
Expand Down

0 comments on commit 77c95ed

Please sign in to comment.