Bitcoin ABC
0.32.4
P2P Digital Currency
src
script
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
5
#include <
script/scriptcache.h
>
6
7
#include <
common/system.h
>
8
#include <
crypto/sha256.h
>
9
#include <
cuckoocache.h
>
10
#include <
primitives/transaction.h
>
11
#include <
random.h
>
12
#include <
script/sigcache.h
>
13
#include <
sync.h
>
14
15
ScriptCacheKey::ScriptCacheKey
(
const
CTransaction
&tx, uint32_t
flags
,
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
}
flags
int flags
Definition:
bitcoin-tx.cpp:542
CSHA256
A hasher class for SHA-256.
Definition:
sha256.h:13
CTransaction
The basic transaction that is broadcasted on the network and contained in blocks.
Definition:
transaction.h:192
CTransaction::GetHash
const TxHash GetHash() const
Definition:
transaction.h:241
ScriptCacheKey::data
std::array< uint8_t, 28 > data
Definition:
scriptcache.h:27
ScriptCacheKey::ScriptCacheKey
ScriptCacheKey()=default
base_blob::begin
uint8_t * begin()
Definition:
uint256.h:85
cuckoocache.h
transaction.h
random.h
scriptcache.h
sha256.h
sigcache.h
sync.h
system.h
assert
assert(!tx.IsCoinBase())
Generated on Thu Dec 4 2025 17:00:34 for Bitcoin ABC by
1.9.4