Browse Source

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)
0.13
Wladimir J. van der Laan 9 years ago
parent
commit
88616d2008
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 7
      doc/release-notes.md
  2. 2
      src/crypto/ripemd160.h
  3. 2
      src/crypto/sha1.h
  4. 2
      src/crypto/sha256.h
  5. 2
      src/crypto/sha512.h
  6. 1
      src/rpc/blockchain.cpp

7
doc/release-notes.md

@ -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
================= =================

2
src/crypto/ripemd160.h

@ -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;

2
src/crypto/sha1.h

@ -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;

2
src/crypto/sha256.h

@ -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;

2
src/crypto/sha512.h

@ -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;

1
src/rpc/blockchain.cpp

@ -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()) {

Loading…
Cancel
Save