Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
core_io.h
Go to the documentation of this file.
1// Copyright (c) 2009-2016 The Bitcoin Core 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#ifndef BITCOIN_CORE_IO_H
6#define BITCOIN_CORE_IO_H
7
9
10#include <string>
11#include <vector>
12
13struct Amount;
14struct BlockHash;
15class CBlock;
16class CBlockHeader;
18class CScript;
19class CTransaction;
20class uint256;
21class UniValue;
22class CTxUndo;
23
24// core_read.cpp
25CScript ParseScript(const std::string &s);
26std::string ScriptToAsmStr(const CScript &script,
27 const bool fAttemptSighashDecode = false);
29 const std::string &strHexTx);
30[[nodiscard]] bool DecodeHexBlk(CBlock &, const std::string &strHexBlk);
31bool DecodeHexBlockHeader(CBlockHeader &, const std::string &hex_header);
32
41bool ParseHashStr(const std::string &strHex, uint256 &result);
42std::vector<uint8_t> ParseHexUV(const UniValue &v, const std::string &strName);
44
45// core_write.cpp
46std::string FormatScript(const CScript &script);
47std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags = 0);
48std::string SighashToStr(uint8_t sighash_type);
49void ScriptPubKeyToUniv(const CScript &scriptPubKey, UniValue &out,
50 bool fIncludeHex);
51void ScriptToUniv(const CScript &script, UniValue &out, bool include_address);
52void TxToUniv(const CTransaction &tx, const BlockHash &hashBlock,
53 UniValue &entry, bool include_hex = true, int serialize_flags = 0,
54 const CTxUndo *txundo = nullptr);
55
56#endif // BITCOIN_CORE_IO_H
Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce value...
Definition block.h:23
Definition block.h:60
A mutable version of CTransaction.
Serialized script, used inside transaction inputs and outputs.
Definition script.h:431
The basic transaction that is broadcasted on the network and contained in blocks.
Restore the UTXO in a Coin at a given COutPoint.
Definition undo.h:62
Signature hash type wrapper class.
Definition sighashtype.h:37
256-bit opaque blob.
Definition uint256.h:129
void ScriptToUniv(const CScript &script, UniValue &out, bool include_address)
void TxToUniv(const CTransaction &tx, const BlockHash &hashBlock, UniValue &entry, bool include_hex=true, int serialize_flags=0, const CTxUndo *txundo=nullptr)
std::string SighashToStr(uint8_t sighash_type)
CScript ParseScript(const std::string &s)
Definition core_read.cpp:60
std::string FormatScript(const CScript &script)
void ScriptPubKeyToUniv(const CScript &scriptPubKey, UniValue &out, bool fIncludeHex)
bool DecodeHexTx(CMutableTransaction &tx, const std::string &strHexTx)
std::vector< uint8_t > ParseHexUV(const UniValue &v, const std::string &strName)
bool DecodeHexBlk(CBlock &, const std::string &strHexBlk)
bool ParseHashStr(const std::string &strHex, uint256 &result)
Parse a hex string into 256 bits.
bool DecodeHexBlockHeader(CBlockHeader &, const std::string &hex_header)
std::string ScriptToAsmStr(const CScript &script, const bool fAttemptSighashDecode=false)
Create the assembly string representation of a CScript object.
std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags=0)
SigHashType ParseSighashString(const UniValue &sighash)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
A BlockHash is a unqiue identifier for a block.
Definition blockhash.h:13