Bitcoin ABC 0.32.4
P2P Digital Currency
scriptcache.cpp
Go to the documentation of this file.
1// Copyright (c) 2017-2020 The Bitcoin developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
6
7#include <common/system.h>
8#include <crypto/sha256.h>
9#include <cuckoocache.h>
11#include <random.h>
12#include <script/sigcache.h>
13#include <sync.h>
14
16 CSHA256 &&hasher) {
17 std::array<uint8_t, 32> hash;
18 hasher.Write(tx.GetHash().begin(), 32)
19 .Write((uint8_t *)&flags, sizeof(flags))
20 .Finalize(hash.begin());
21
22 assert(data.size() < hash.size());
23 std::copy(hash.begin(), hash.begin() + data.size(), data.begin());
24}
int flags
Definition: bitcoin-tx.cpp:542
A hasher class for SHA-256.
Definition: sha256.h:13
The basic transaction that is broadcasted on the network and contained in blocks.
Definition: transaction.h:192
const TxHash GetHash() const
Definition: transaction.h:241
std::array< uint8_t, 28 > data
Definition: scriptcache.h:27
ScriptCacheKey()=default
uint8_t * begin()
Definition: uint256.h:85
assert(!tx.IsCoinBase())