Bitcoin Core  0.20.99
P2P Digital Currency
Go to the documentation of this file.
1 // Copyright (c) 2009-2019 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;
22 // core_read.cpp
23 CScript ParseScript(const std::string& s);
24 std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode = false);
25 NODISCARD bool DecodeHexTx(CMutableTransaction& tx, const std::string& hex_tx, bool try_no_witness = false, bool try_witness = true);
26 NODISCARD bool DecodeHexBlk(CBlock&, const std::string& strHexBlk);
27 bool DecodeHexBlockHeader(CBlockHeader&, const std::string& hex_header);
37 bool ParseHashStr(const std::string& strHex, uint256& result);
38 std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName);
39 int ParseSighashString(const UniValue& sighash);
41 // core_write.cpp
42 UniValue ValueFromAmount(const CAmount& amount);
43 std::string FormatScript(const CScript& script);
44 std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0);
45 std::string SighashToStr(unsigned char sighash_type);
46 void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
47 void ScriptToUniv(const CScript& script, UniValue& out, bool include_address);
48 void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex = true, int serialize_flags = 0);
50 #endif // BITCOIN_CORE_IO_H
std::vector< unsigned char > ParseHexUV(const UniValue &v, const std::string &strName)
Definition: core_read.cpp:195
std::string FormatScript(const CScript &script)
Definition: core_write.cpp:28
Definition: block.h:62
void ScriptToUniv(const CScript &script, UniValue &out, bool include_address)
Definition: core_write.cpp:139
UniValue ValueFromAmount(const CAmount &amount)
Definition: core_write.cpp:18
bool DecodeHexBlockHeader(CBlockHeader &, const std::string &hex_header)
Definition: core_read.cpp:155
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:87
int ParseSighashString(const UniValue &sighash)
Definition: core_read.cpp:205
Definition: attributes.h:18
NODISCARD bool DecodeHexBlk(CBlock &, const std::string &strHexBlk)
Definition: core_read.cpp:169
std::string SighashToStr(unsigned char sighash_type)
Definition: core_write.cpp:73
256-bit opaque blob.
Definition: uint256.h:123
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:390
std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags=0)
Definition: core_write.cpp:132
void ScriptPubKeyToUniv(const CScript &scriptPubKey, UniValue &out, bool fIncludeHex)
Definition: core_write.cpp:154
A mutable version of CTransaction.
Definition: transaction.h:347
void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, UniValue &entry, bool include_hex=true, int serialize_flags=0)
Definition: core_write.cpp:180
bool ParseHashStr(const std::string &strHex, uint256 &result)
Parse a hex string into 256 bits.
Definition: core_read.cpp:186
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:253
CScript ParseScript(const std::string &s)
Definition: core_read.cpp:24
Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce value...
Definition: block.h:20
NODISCARD bool DecodeHexTx(CMutableTransaction &tx, const std::string &hex_tx, bool try_no_witness=false, bool try_witness=true)
Definition: core_read.cpp:120