Bitcoin Core  21.99.0
P2P Digital Currency
Go to the documentation of this file.
1 // Copyright (c) 2009-2020 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or
8 #include <amount.h>
9 #include <attributes.h>
11 #include <string>
12 #include <vector>
14 class CBlock;
15 class CBlockHeader;
16 class CScript;
17 class CTransaction;
18 struct CMutableTransaction;
19 class uint256;
20 class UniValue;
21 class CTxUndo;
23 // core_read.cpp
24 CScript ParseScript(const std::string& s);
25 std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode = false);
26 [[nodiscard]] bool DecodeHexTx(CMutableTransaction& tx, const std::string& hex_tx, bool try_no_witness = false, bool try_witness = true);
27 [[nodiscard]] bool DecodeHexBlk(CBlock&, const std::string& strHexBlk);
28 bool DecodeHexBlockHeader(CBlockHeader&, const std::string& hex_header);
38 bool ParseHashStr(const std::string& strHex, uint256& result);
39 std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName);
40 int ParseSighashString(const UniValue& sighash);
42 // core_write.cpp
43 UniValue ValueFromAmount(const CAmount& amount);
44 std::string FormatScript(const CScript& script);
45 std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0);
46 std::string SighashToStr(unsigned char sighash_type);
47 void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
48 void ScriptToUniv(const CScript& script, UniValue& out, bool include_address);
49 void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex = true, int serialize_flags = 0, const CTxUndo* txundo = nullptr);
51 #endif // BITCOIN_CORE_IO_H
std::vector< unsigned char > ParseHexUV(const UniValue &v, const std::string &strName)
Definition: core_read.cpp:248
std::string FormatScript(const CScript &script)
Definition: core_write.cpp:30
bool DecodeHexBlk(CBlock &, const std::string &strHexBlk)
Definition: core_read.cpp:222
Definition: block.h:62
void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, UniValue &entry, bool include_hex=true, int serialize_flags=0, const CTxUndo *txundo=nullptr)
Definition: core_write.cpp:182
void ScriptToUniv(const CScript &script, UniValue &out, bool include_address)
Definition: core_write.cpp:141
UniValue ValueFromAmount(const CAmount &amount)
Definition: core_write.cpp:20
bool DecodeHexBlockHeader(CBlockHeader &, const std::string &hex_header)
Definition: core_read.cpp:208
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
std::string ScriptToAsmStr(const CScript &script, const bool fAttemptSighashDecode=false)
Create the assembly string representation of a CScript object.
Definition: core_write.cpp:89
int ParseSighashString(const UniValue &sighash)
Definition: core_read.cpp:258
std::string SighashToStr(unsigned char sighash_type)
Definition: core_write.cpp:75
256-bit opaque blob.
Definition: uint256.h:124
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:404
Undo information for a CTransaction.
Definition: undo.h:53
bool DecodeHexTx(CMutableTransaction &tx, const std::string &hex_tx, bool try_no_witness=false, bool try_witness=true)
Definition: core_read.cpp:198
std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags=0)
Definition: core_write.cpp:134
void ScriptPubKeyToUniv(const CScript &scriptPubKey, UniValue &out, bool fIncludeHex)
Definition: core_write.cpp:156
A mutable version of CTransaction.
Definition: transaction.h:344
bool ParseHashStr(const std::string &strHex, uint256 &result)
Parse a hex string into 256 bits.
Definition: core_read.cpp:239
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:259
CScript ParseScript(const std::string &s)
Definition: core_read.cpp:55
Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce value...
Definition: block.h:20