Skip to content

Commit

Permalink
improve handling of unknown commands in CInv::ToString
Browse files Browse the repository at this point in the history
  • Loading branch information
leofidus committed Mar 8, 2014
1 parent 0365307 commit 8c62aa3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ const char* CInv::GetCommand() const

std::string CInv::ToString() const
{
return strprintf("%s %s", GetCommand(), hash.ToString().c_str());
if(IsKnownType())
return strprintf("%s %s", GetCommand(), hash.ToString().c_str());
else
return strprintf("type=%d %s", type, hash.ToString().c_str());
}

void CInv::print() const
Expand Down

0 comments on commit 8c62aa3

Please sign in to comment.