mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Make OP_DETERMINISTICRANDOM endian-safe
Fixing a TODO from elements-0.14.1. Signed-off-by: Steven Roose <steven@stevenroose.org>
This commit is contained in:
parent
1967112d98
commit
a09e63fdad
1 changed files with 2 additions and 2 deletions
|
|
@ -1374,8 +1374,8 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
|
|||
hasher.Write(vchSeed.data(), vchSeed.size());
|
||||
do {
|
||||
if (nHashIndex >= 3) {
|
||||
//TODO this isn't endian safe
|
||||
CSHA256(hasher).Write((const unsigned char*)&nCounter, sizeof(nCounter)).Finalize(vchHash.data());
|
||||
uint64_t le_counter = htole64(nCounter);
|
||||
CSHA256(hasher).Write((const unsigned char*)&le_counter, sizeof(nCounter)).Finalize(vchHash.data());
|
||||
nHashIndex = 0;
|
||||
nCounter++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue