diff options
| author | Jeff Garzik <[email protected]> | 2012-11-15 18:47:07 -0800 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2012-11-15 18:47:07 -0800 |
| commit | 3ef292dc7db571b9eb35f2148d76bac4ae841796 (patch) | |
| tree | 4e8d7d0b44bc00959debdce0f0253b3b2d51cfba /src/protocol.cpp | |
| parent | Merge pull request #1945 from centromere/leveldb_fix (diff) | |
| parent | Change block references in debug.log to full hash instead of just 0..20 (diff) | |
| download | discoin-3ef292dc7db571b9eb35f2148d76bac4ae841796.tar.xz discoin-3ef292dc7db571b9eb35f2148d76bac4ae841796.zip | |
Merge pull request #1670 from luke-jr/blksubstr
Use full block hash as unique identifier in debug.log
Diffstat (limited to 'src/protocol.cpp')
| -rw-r--r-- | src/protocol.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/protocol.cpp b/src/protocol.cpp index d6e340e36..23969e5b9 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -6,6 +6,7 @@ #include "protocol.h" #include "util.h" #include "netbase.h" +#include "main.h" #ifndef WIN32 # include <arpa/inet.h> @@ -140,6 +141,11 @@ const char* CInv::GetCommand() const std::string CInv::ToString() const { + if (type == MSG_BLOCK) + return strprintf("%s %s", GetCommand(), BlockHashStr(hash).c_str()); + if (type == MSG_TX) + return strprintf("%s %s", GetCommand(), hash.ToString().substr(0,10).c_str()); + return strprintf("%s %s", GetCommand(), hash.ToString().substr(0,20).c_str()); } |