mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Few inv related fixes:
- add missing strings and make inv strings a bit more consistent (imo) - remove "unknown" types that were used to prevent errors thrown at user with old wallet, just log such errors in debug mode for "net" category. Should also make behaviour of functions relaing on CInv::IsKnownType() more adequate (and it doesn't make sense to warn users by throwing errors at them in such situations anyway I guess)
This commit is contained in:
parent
a89b0e705f
commit
b66928043e
@ -22,19 +22,15 @@ static const char* ppszTypeName[] =
|
|||||||
"tx lock request",
|
"tx lock request",
|
||||||
"tx lock vote",
|
"tx lock vote",
|
||||||
"spork",
|
"spork",
|
||||||
"masternode winner",
|
"mn winner",
|
||||||
"masternode scan",
|
"mn scan error",
|
||||||
"masternode vote",
|
"mn budget vote",
|
||||||
"masternode proposal",
|
"mn budget proposal",
|
||||||
"masternode quorum",
|
"mn budget finalized",
|
||||||
"masternode announce",
|
"mn budget finalized vote",
|
||||||
"masternode ping",
|
"mn quorum",
|
||||||
"unknown",
|
"mn announce",
|
||||||
"unknown",
|
"mn ping"
|
||||||
"unknown",
|
|
||||||
"unknown",
|
|
||||||
"unknown",
|
|
||||||
"unknown"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CMessageHeader::CMessageHeader()
|
CMessageHeader::CMessageHeader()
|
||||||
@ -133,7 +129,7 @@ CInv::CInv(const std::string& strType, const uint256& hashIn)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i == ARRAYLEN(ppszTypeName))
|
if (i == ARRAYLEN(ppszTypeName))
|
||||||
throw std::out_of_range(strprintf("CInv::CInv(string, uint256) : unknown type '%s'", strType));
|
LogPrint("net", "CInv::CInv(string, uint256) : unknown type '%s'", strType);
|
||||||
hash = hashIn;
|
hash = hashIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,7 +146,8 @@ bool CInv::IsKnownType() const
|
|||||||
const char* CInv::GetCommand() const
|
const char* CInv::GetCommand() const
|
||||||
{
|
{
|
||||||
if (!IsKnownType())
|
if (!IsKnownType())
|
||||||
throw std::out_of_range(strprintf("CInv::GetCommand() : type=%d unknown type", type));
|
LogPrint("net", "CInv::GetCommand() : type=%d unknown type", type);
|
||||||
|
|
||||||
return ppszTypeName[type];
|
return ppszTypeName[type];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user