Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge missing commits from V0.12.0.x #650

Merged
merged 6 commits into from
Jan 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,11 +914,13 @@ bool AppInit2(boost::thread_group& threadGroup)
boost::filesystem::path backupFile = backupPathStr + dateTimeStr;
sourceFile.make_preferred();
backupFile.make_preferred();
try {
boost::filesystem::copy_file(sourceFile, backupFile);
LogPrintf("Creating backup of %s -> %s\n", sourceFile, backupFile);
} catch(boost::filesystem::filesystem_error &error) {
LogPrintf("Failed to create backup %s\n", error.what());
if(boost::filesystem::exists(sourceFile)) {
try {
boost::filesystem::copy_file(sourceFile, backupFile);
LogPrintf("Creating backup of %s -> %s\n", sourceFile, backupFile);
} catch(boost::filesystem::filesystem_error &error) {
LogPrintf("Failed to create backup %s\n", error.what());
}
}
// Keep only the last 10 backups, including the new one of course
typedef std::multimap<std::time_t, boost::filesystem::path> folder_set_t;
Expand Down
4 changes: 2 additions & 2 deletions src/masternode-budget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
mapSeenMasternodeBudgetVotes.insert(make_pair(vote.GetHash(), vote));
if(!vote.SignatureValid(true)){
LogPrintf("mvote - signature invalid\n");
Misbehaving(pfrom->GetId(), 20);
if(masternodeSync.IsSynced()) Misbehaving(pfrom->GetId(), 20);
// it could just be a non-synced masternode
mnodeman.AskForMN(pfrom, vote.vin);
return;
Expand Down Expand Up @@ -1026,7 +1026,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
mapSeenFinalizedBudgetVotes.insert(make_pair(vote.GetHash(), vote));
if(!vote.SignatureValid(true)){
LogPrintf("fbvote - signature invalid\n");
Misbehaving(pfrom->GetId(), 20);
if(masternodeSync.IsSynced()) Misbehaving(pfrom->GetId(), 20);
// it could just be a non-synced masternode
mnodeman.AskForMN(pfrom, vote.vin);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/masternode-payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ void CMasternodePayments::ProcessMessageMasternodePayments(CNode* pfrom, std::st

if(!winner.SignatureValid()){
LogPrintf("mnw - invalid signature\n");
Misbehaving(pfrom->GetId(), 20);
if(masternodeSync.IsSynced()) Misbehaving(pfrom->GetId(), 20);
// it could just be a non-synced masternode
mnodeman.AskForMN(pfrom, winner.vinMasternode);
return;
Expand Down Expand Up @@ -656,7 +656,7 @@ bool CMasternodePaymentWinner::IsValid(CNode* pnode, std::string& strError)
{
strError = strprintf("Masternode not in the top %d (%d)", MNPAYMENTS_SIGNATURES_TOTAL, n);
LogPrintf("CMasternodePaymentWinner::IsValid - %s\n", strError);
Misbehaving(pnode->GetId(), 20);
if(masternodeSync.IsSynced()) Misbehaving(pnode->GetId(), 20);
}
return false;
}
Expand Down
2 changes: 2 additions & 0 deletions src/masternodeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ void CMasternodeMan::Clear()
mAskedUsForMasternodeList.clear();
mWeAskedForMasternodeList.clear();
mWeAskedForMasternodeListEntry.clear();
mapSeenMasternodeBroadcast.clear();
mapSeenMasternodePing.clear();
nDsqCount = 0;
}

Expand Down