fixed hashing issues with mnw messages

This commit is contained in:
Evan Duffield 2015-05-27 15:07:53 -07:00
parent fe55b12a1f
commit d470eddc01
5 changed files with 6 additions and 13 deletions

View File

@ -4437,8 +4437,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
else if (strCommand == "inv")
{
printf("58\n");
vector<CInv> vInv;
vRecv >> vInv;
if (vInv.size() > MAX_INV_SZ)

View File

@ -337,8 +337,6 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
LOCK(cs_budget);
printf("%s\n", strCommand.c_str());
if (strCommand == "mnvs") { //Masternode vote sync
if(pfrom->HasFulfilledRequest("mnvs")) {
LogPrintf("mnvs - peer already asked me for the list\n");
@ -435,7 +433,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
}
if(!prop.IsValid()) {
printf("fbs - invalid prop\n");
LogPrintf("fbs - invalid prop\n");
return;
}
@ -451,8 +449,6 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
budget.AddFinalizedBudget(p);
prop.Relay();
printf("43\n");
if(!IsSyncingMasternodeAssets()) pmn->nVotedTimes++;
} else {
LogPrintf("mvote - masternode can't vote again - vin:%s \n", pmn->vin.ToString().c_str());

View File

@ -99,7 +99,6 @@ void CMasternodePayments::ProcessMessageMasternodePayments(CNode* pfrom, std::st
if(fDebug) LogPrintf("mnw - winning vote - Addr %s Height %d bestHeight %d\n", address2.ToString().c_str(), winner.nBlockHeight, chainActive.Tip()->nHeight);
if(masternodePayments.AddWinningMasternode(winner)){
printf("relay %s - %s \n", winner.GetHash().ToString().c_str(), winner.ToString().c_str());
winner.Relay();
}
}

View File

@ -124,7 +124,10 @@ public:
}
uint256 GetHash(){
return Hash(BEGIN(payee), END(payee));
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
ss << payee;
return ss.GetHash();
}
bool Sign(CKey& keyMasternode, CPubKey& pubKeyMasternode);

View File

@ -42,26 +42,23 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
if (about)
{
setWindowTitle(tr("About Dash Core"));
printf("1");
/// HTML-format the license message from the core
QString licenseInfo = QString::fromStdString(LicenseInfo());
QString licenseInfoHTML = licenseInfo;
printf("2");
// Make URLs clickable
QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2);
uri.setMinimal(true); // use non-greedy matching
licenseInfoHTML.replace(uri, "<a href=\"\\1\">\\1</a>");
// Replace newlines with HTML breaks
licenseInfoHTML.replace("\n\n", "<br><br>");
printf("3");
ui->helpMessageLabel->setTextFormat(Qt::RichText);
ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
text = version + "\n" + licenseInfo;
ui->helpMessageLabel->setText(version + "<br><br>" + licenseInfoHTML);
ui->helpMessageLabel->setWordWrap(true);
printf("4");
} else {
setWindowTitle(tr("Command-line options"));
QString header = tr("Usage:") + "\n" +