Bitcoin ABC 0.30.7
P2P Digital Currency
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);
28[[nodiscard]] bool DecodeHexTx(CMutableTransaction &tx,
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.
Definition: transaction.h:274
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:424
The basic transaction that is broadcasted on the network and contained in blocks.
Definition: transaction.h:192
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)
Definition: core_write.cpp:175
void TxToUniv(const CTransaction &tx, const BlockHash &hashBlock, UniValue &entry, bool include_hex=true, int serialize_flags=0, const CTxUndo *txundo=nullptr)
Definition: core_write.cpp:217
std::string SighashToStr(uint8_t sighash_type)
Definition: core_write.cpp:89
CScript ParseScript(const std::string &s)
Definition: core_read.cpp:60
std::string FormatScript(const CScript &script)
Definition: core_write.cpp:24
void ScriptPubKeyToUniv(const CScript &scriptPubKey, UniValue &out, bool fIncludeHex)
Definition: core_write.cpp:190
bool DecodeHexTx(CMutableTransaction &tx, const std::string &strHexTx)
Definition: core_read.cpp:197
std::vector< uint8_t > ParseHexUV(const UniValue &v, const std::string &strName)
Definition: core_read.cpp:257
bool DecodeHexBlk(CBlock &, const std::string &strHexBlk)
Definition: core_read.cpp:232
bool ParseHashStr(const std::string &strHex, uint256 &result)
Parse a hex string into 256 bits.
Definition: core_read.cpp:248
bool DecodeHexBlockHeader(CBlockHeader &, const std::string &hex_header)
Definition: core_read.cpp:217
std::string ScriptToAsmStr(const CScript &script, const bool fAttemptSighashDecode=false)
Create the assembly string representation of a CScript object.
Definition: core_write.cpp:106
std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags=0)
Definition: core_write.cpp:169
SigHashType ParseSighashString(const UniValue &sighash)
Definition: core_read.cpp:271
Definition: amount.h:19
A BlockHash is a unqiue identifier for a block.
Definition: blockhash.h:13