Logging improvements (#1268)
* Add default log messages when beginning asset sync * Added default log message for AskFor buffer full condition * Improve log message based on code review comments
This commit is contained in:
parent
b5239b790e
commit
2ea9c69985
@ -178,18 +178,22 @@ void CMasternodeSync::SwitchToNextAsset()
|
|||||||
case(MASTERNODE_SYNC_INITIAL):
|
case(MASTERNODE_SYNC_INITIAL):
|
||||||
ClearFulfilledRequests();
|
ClearFulfilledRequests();
|
||||||
nRequestedMasternodeAssets = MASTERNODE_SYNC_SPORKS;
|
nRequestedMasternodeAssets = MASTERNODE_SYNC_SPORKS;
|
||||||
|
LogPrintf("CMasternodeSync::SwitchToNextAsset -- Starting %s\n", GetAssetName());
|
||||||
break;
|
break;
|
||||||
case(MASTERNODE_SYNC_SPORKS):
|
case(MASTERNODE_SYNC_SPORKS):
|
||||||
nTimeLastMasternodeList = GetTime();
|
nTimeLastMasternodeList = GetTime();
|
||||||
nRequestedMasternodeAssets = MASTERNODE_SYNC_LIST;
|
nRequestedMasternodeAssets = MASTERNODE_SYNC_LIST;
|
||||||
|
LogPrintf("CMasternodeSync::SwitchToNextAsset -- Starting %s\n", GetAssetName());
|
||||||
break;
|
break;
|
||||||
case(MASTERNODE_SYNC_LIST):
|
case(MASTERNODE_SYNC_LIST):
|
||||||
nTimeLastPaymentVote = GetTime();
|
nTimeLastPaymentVote = GetTime();
|
||||||
nRequestedMasternodeAssets = MASTERNODE_SYNC_MNW;
|
nRequestedMasternodeAssets = MASTERNODE_SYNC_MNW;
|
||||||
|
LogPrintf("CMasternodeSync::SwitchToNextAsset -- Starting %s\n", GetAssetName());
|
||||||
break;
|
break;
|
||||||
case(MASTERNODE_SYNC_MNW):
|
case(MASTERNODE_SYNC_MNW):
|
||||||
nTimeLastGovernanceItem = GetTime();
|
nTimeLastGovernanceItem = GetTime();
|
||||||
nRequestedMasternodeAssets = MASTERNODE_SYNC_GOVERNANCE;
|
nRequestedMasternodeAssets = MASTERNODE_SYNC_GOVERNANCE;
|
||||||
|
LogPrintf("CMasternodeSync::SwitchToNextAsset -- Starting %s\n", GetAssetName());
|
||||||
break;
|
break;
|
||||||
case(MASTERNODE_SYNC_GOVERNANCE):
|
case(MASTERNODE_SYNC_GOVERNANCE):
|
||||||
LogPrintf("CMasternodeSync::SwitchToNextAsset -- Sync has finished\n");
|
LogPrintf("CMasternodeSync::SwitchToNextAsset -- Sync has finished\n");
|
||||||
|
@ -2445,8 +2445,11 @@ CNode::~CNode()
|
|||||||
|
|
||||||
void CNode::AskFor(const CInv& inv)
|
void CNode::AskFor(const CInv& inv)
|
||||||
{
|
{
|
||||||
if (mapAskFor.size() > MAPASKFOR_MAX_SZ || setAskFor.size() > SETASKFOR_MAX_SZ)
|
if (mapAskFor.size() > MAPASKFOR_MAX_SZ || setAskFor.size() > SETASKFOR_MAX_SZ) {
|
||||||
|
LogPrintf("CNode::AskFor -- WARNING: inventory message dropped: mapAskFor.size = %d, setAskFor.size = %d, MAPASKFOR_MAX_SZ = %d, SETASKFOR_MAX_SZ = %d, peer=%d\n",
|
||||||
|
mapAskFor.size(), setAskFor.size(), MAPASKFOR_MAX_SZ, SETASKFOR_MAX_SZ, id);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
// a peer may not have multiple non-responded queue positions for a single inv item
|
// a peer may not have multiple non-responded queue positions for a single inv item
|
||||||
if (!setAskFor.insert(inv.hash).second)
|
if (!setAskFor.insert(inv.hash).second)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user