Skip to content

Commit

Permalink
Merge pull request #11 from ionomy/adammatlack-pravinaspa-patch
Browse files Browse the repository at this point in the history
Update main.cpp
  • Loading branch information
ionstaff committed Feb 13, 2017
2 parents 8c2aa15 + 84fbf84 commit 9915e87
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 2
#define CLIENT_VERSION_MINOR 1
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_REVISION 1
#define CLIENT_VERSION_BUILD 0

// Set to true for release, false for prerelease or test build
Expand Down
28 changes: 16 additions & 12 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3533,6 +3533,7 @@ void static ProcessGetData(CNode* pfrom)

bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{

RandAddSeedPerfmon();
LogPrint("net", "received: %s (%u bytes)\n", strCommand, vRecv.size());
if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0)
Expand Down Expand Up @@ -3835,6 +3836,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{
CBlockLocator locator;
uint256 hashStop;

vRecv >> locator >> hashStop;

LOCK(cs_main);
Expand Down Expand Up @@ -3880,26 +3882,27 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)

//masternode signed transaction
bool ignoreFees = false;
CTxIn vin;
CInv inv;
CTxIn vin;
vector<unsigned char> vchSig;
int64_t sigTime;
CInv inv;
CTxDB txdb("r");

if(strCommand == "tx") {
CInv inv(MSG_TX, tx.GetHash());
vRecv >> tx;
inv = CInv(MSG_TX, tx.GetHash());
// Check for recently rejected (and do other quick existence checks)
if (AlreadyHave(txdb, inv))
return true;
}

vRecv >> tx;
} else if (strCommand == "dstx") {
CInv inv(MSG_DSTX, tx.GetHash());
else if (strCommand == "dstx") {
vRecv >> tx >> vin >> vchSig >> sigTime;
inv = CInv(MSG_DSTX, tx.GetHash());
// Check for recently rejected (and do other quick existence checks)
if (AlreadyHave(txdb, inv))
return true;
//these allow masternodes to publish a limited amount of free transactions
vRecv >> tx >> vin >> vchSig >> sigTime;

CMasternode* pmn = mnodeman.Find(vin);
if(pmn != NULL)
Expand Down Expand Up @@ -4003,7 +4006,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
LogPrint("mempool", "mapOrphan overflow, removed %u tx\n", nEvicted);
}
if(strCommand == "dstx"){
CInv inv(MSG_DSTX, tx.GetHash());
inv = CInv(MSG_DSTX, tx.GetHash());
RelayInventory(inv);
}
if (tx.nDoS) Misbehaving(pfrom->GetId(), tx.nDoS);
Expand Down Expand Up @@ -4054,8 +4057,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
std::vector<uint256> vtxid;
mempool.queryHashes(vtxid);
vector<CInv> vInv;
for (unsigned int i = 0; i < vtxid.size(); i++) {
CInv inv(MSG_TX, vtxid[i]);
CInv inv;
for (unsigned int i = 0; i < vtxid.size(); i++) {
inv = CInv(MSG_TX, vtxid[i]);
vInv.push_back(inv);
if (i == (MAX_INV_SZ - 1))
break;
Expand Down Expand Up @@ -4493,8 +4497,8 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
// in flight for over two minutes, since we first had a chance to
// process an incoming block.
int64_t nNow = GetTimeMicros();
if (!pto->fDisconnect && state.nBlocksInFlight &&
state.nLastBlockReceive < state.nLastBlockProcess - BLOCK_DOWNLOAD_TIMEOUT*1000000 &&
if (!pto->fDisconnect && state.nBlocksInFlight &&
state.nLastBlockReceive < state.nLastBlockProcess - BLOCK_DOWNLOAD_TIMEOUT*1000000 &&
state.vBlocksInFlight.front().nTime < state.nLastBlockProcess - 2*BLOCK_DOWNLOAD_TIMEOUT*1000000) {
LogPrintf("Peer %s is stalling block download, disconnecting\n", state.name.c_str());
pto->fDisconnect = true;
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static const int DATABASE_VERSION = 70510;
// network protocol versioning
//

static const int PROTOCOL_VERSION = 95600;
static const int PROTOCOL_VERSION = 95605;

// intial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 900;
Expand Down

0 comments on commit 9915e87

Please sign in to comment.