Merge #7848: Divergence between 32- and 64-bit when hashing >4GB affects gettxoutsetinfo

28b400f doc: update release-notes for `gettxoutsetinfo` change (Wladimir J. van der Laan)
76212bb rpc: make sure `gettxoutsetinfo` hash has txids (Wladimir J. van der Laan)
9ad1a51 crypto: bytes counts are 64 bit (Wladimir J. van der Laan)
This commit is contained in:
Wladimir J. van der Laan 2016-04-18 12:48:06 +02:00
commit 88616d2008
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
6 changed files with 12 additions and 4 deletions

View File

@ -21,6 +21,13 @@ It is recommended to use this for sensitive information such as wallet
passphrases, as command-line arguments can usually be read from the process passphrases, as command-line arguments can usually be read from the process
table by any user on the system. table by any user on the system.
RPC low-level changes
----------------------
- `gettxoutsetinfo` UTXO hash (`hash_serialized`) has changed. There was a divergence between
32-bit and 64-bit platforms, and the txids were missing in the hashed data. This has been
fixed, but this means that the output will be different than from previous versions.
0.13.0 Change log 0.13.0 Change log
================= =================

View File

@ -14,7 +14,7 @@ class CRIPEMD160
private: private:
uint32_t s[5]; uint32_t s[5];
unsigned char buf[64]; unsigned char buf[64];
size_t bytes; uint64_t bytes;
public: public:
static const size_t OUTPUT_SIZE = 20; static const size_t OUTPUT_SIZE = 20;

View File

@ -14,7 +14,7 @@ class CSHA1
private: private:
uint32_t s[5]; uint32_t s[5];
unsigned char buf[64]; unsigned char buf[64];
size_t bytes; uint64_t bytes;
public: public:
static const size_t OUTPUT_SIZE = 20; static const size_t OUTPUT_SIZE = 20;

View File

@ -14,7 +14,7 @@ class CSHA256
private: private:
uint32_t s[8]; uint32_t s[8];
unsigned char buf[64]; unsigned char buf[64];
size_t bytes; uint64_t bytes;
public: public:
static const size_t OUTPUT_SIZE = 32; static const size_t OUTPUT_SIZE = 32;

View File

@ -14,7 +14,7 @@ class CSHA512
private: private:
uint64_t s[8]; uint64_t s[8];
unsigned char buf[128]; unsigned char buf[128];
size_t bytes; uint64_t bytes;
public: public:
static const size_t OUTPUT_SIZE = 64; static const size_t OUTPUT_SIZE = 64;

View File

@ -467,6 +467,7 @@ static bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats)
CCoins coins; CCoins coins;
if (pcursor->GetKey(key) && pcursor->GetValue(coins)) { if (pcursor->GetKey(key) && pcursor->GetValue(coins)) {
stats.nTransactions++; stats.nTransactions++;
ss << key;
for (unsigned int i=0; i<coins.vout.size(); i++) { for (unsigned int i=0; i<coins.vout.size(); i++) {
const CTxOut &out = coins.vout[i]; const CTxOut &out = coins.vout[i];
if (!out.IsNull()) { if (!out.IsNull()) {