This is a rebase and cleanup of #1426
Note that while these bits are less significant numerically, they are more useful because they are likely to be unique (whereas the most significant bits will generally be zero)
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/0e6b9c809b4941d3062f092743df8d8e5588e7c9 for binaries and test log.
113 | @@ -114,6 +114,8 @@ 114 | 115 | 116 | 117 | +#define BlockSubstr(hash) hash.ToString().substr(48)
Please use an inline function, not a macro
How long is the full string? 64? I suppose so. This patch makes it print 48 characters, so I guess you could just as well go all the way print the full string.
No, this patch skips 48 characters, so prints 16. I don't care either way, and it seems there's support for the full hash, so might as well do that anyway...
113 | @@ -114,6 +114,13 @@ 114 | 115 | 116 | 117 | +static inline
Why are you always trying to introduce new and weird coding conventions?
static inline std::string BlockSubstr(const uint256& hash) would do the job, no?
I'm also for changing it. Splitting up lines can be useful when they get too long for convenient reading, but this really breaks the flow of reading.
I guess this was changed by another dev and we need a rebase for this pull.
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/508c455bc337c3a56d1499c5cd691114427c8f46 for binaries and test log.
So.. this patch now makes the lines in debug.log longer instead of shorter?
ACK save for bikeshedding: "BlockSubstr" is a misleading name, because the end result of this changeset is not a substring, but rather the full hash string. Maybe "BlockHashStr".
Renamed.
How long will the line in the debug.log file now be with this change? What width of window is needed for it to look sufficiently neat? Is it worth adding a command line option to specify the length or format of the block string perhaps?
It's a debug log; it doesn't have to look neat. NACK on a command line option...
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/c97992845777f0625552153b5644f556fa15c8f4 for binaries and test log.
ACK
Needs rebase.
Rebased
Hmm just realized that this is only for blocks. Any reason not to print full hashes for transactions?