 |
Bitcoin Core
21.99.0
P2P Digital Currency
|
Go to the documentation of this file.
19 TxInputStream(
int nVersionIn,
const unsigned char *txTo,
size_t txToLen) :
20 m_version(nVersionIn),
25 void read(
char* pch,
size_t nSize)
27 if (nSize > m_remaining)
28 throw std::ios_base::failure(std::string(__func__) +
": end of data");
31 throw std::ios_base::failure(std::string(__func__) +
": bad destination buffer");
33 if (m_data ==
nullptr)
34 throw std::ios_base::failure(std::string(__func__) +
": bad source buffer");
36 memcpy(pch, m_data, nSize);
42 TxInputStream& operator>>(T&& obj)
48 int GetVersion()
const {
return m_version; }
51 const unsigned char* m_data;
62 struct ECCryptoClosure
67 ECCryptoClosure instance_of_eccryptoclosure;
77 const unsigned char *txTo ,
unsigned int txToLen,
86 if (nIn >= tx.
vin.size())
96 }
catch (
const std::exception&) {
102 const unsigned char *txTo ,
unsigned int txToLen,
111 const unsigned char *txTo ,
unsigned int txToLen,
size_t GetSerializeSize(const T &t, int nVersion=0)
const std::vector< CTxIn > vin
@ bitcoinconsensus_ERR_TX_INDEX
static bool verify_flags(unsigned int flags)
Check that all specified flags are part of the libconsensus interface.
#define BITCOINCONSENSUS_API_VER
@ bitcoinconsensus_ERR_OK
@ bitcoinconsensus_ERR_INVALID_FLAGS
static int verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, CAmount amount, const unsigned char *txTo, unsigned int txToLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error *err)
bool VerifyScript(const CScript &scriptSig, const CScript &scriptPubKey, const CScriptWitness *witness, unsigned int flags, const BaseSignatureChecker &checker, ScriptError *serror)
The basic transaction that is broadcasted on the network and contained in blocks.
void Unserialize(Stream &s, char &a)
@ bitcoinconsensus_ERR_AMOUNT_REQUIRED
unsigned int bitcoinconsensus_version()
int64_t CAmount
Amount in satoshis (Can be negative)
int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, const unsigned char *txTo, unsigned int txToLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error *err)
Returns 1 if the input nIn of the serialized transaction pointed to by txTo correctly spends the scri...
@ bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS
Serialized script, used inside transaction inputs and outputs.
@ bitcoinconsensus_ERR_TX_DESERIALIZE
@ bitcoinconsensus_ERR_TX_SIZE_MISMATCH
Users of this module must hold an ECCVerifyHandle.
@ bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL
enum bitcoinconsensus_error_t bitcoinconsensus_error
int bitcoinconsensus_verify_script_with_amount(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount, const unsigned char *txTo, unsigned int txToLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error *err)
constexpr deserialize_type deserialize
static const int PROTOCOL_VERSION
network protocol versioning