7 #if defined(HAVE_CONSENSUS_LIB) 22 txCredit.
vin.resize(1);
23 txCredit.
vout.resize(1);
24 txCredit.
vin[0].prevout.SetNull();
27 txCredit.
vout[0].scriptPubKey = scriptPubKey;
28 txCredit.
vout[0].nValue = 1;
39 txSpend.
vin.resize(1);
40 txSpend.
vout.resize(1);
41 txSpend.
vin[0].prevout.hash = txCredit.
GetHash();
42 txSpend.
vin[0].prevout.n = 0;
43 txSpend.
vin[0].scriptSig = scriptSig;
46 txSpend.
vout[0].nValue = txCredit.
vout[0].nValue;
56 const int witnessversion = 0;
60 static const std::array<unsigned char, 32> vchKey = {
62 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
65 key.
Set(vchKey.begin(), vchKey.end(),
false);
74 CTransaction txCredit = BuildCreditingTransaction(scriptPubKey);
77 witness.
stack.emplace_back();
86 txSpend.
vin[0].scriptSig,
87 txCredit.
vout[0].scriptPubKey,
88 &txSpend.
vin[0].scriptWitness,
95 #if defined(HAVE_CONSENSUS_LIB) 99 txCredit.
vout[0].scriptPubKey.data(),
100 txCredit.
vout[0].scriptPubKey.size(),
101 txCredit.
vout[0].nValue,
102 (
const unsigned char*)stream.data(), stream.size(), 0, flags,
nullptr);
enum ScriptError_t ScriptError
bool VerifyScript(const CScript &scriptSig, const CScript &scriptPubKey, const CScriptWitness *witness, unsigned int flags, const BaseSignatureChecker &checker, ScriptError *serror)
static const uint32_t SEQUENCE_FINAL
Only serialized through CTransaction.
unsigned int size() const
Simple read-only vector-like interface to the pubkey data.
std::vector< std::vector< unsigned char > > stack
assert(len-trim+(2 *lenIndices)<=WIDTH)
Double ended buffer combining vector and stream-like interfaces.
uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, unsigned int nIn, int nHashType, const CAmount &amount, SigVersion sigversion, const PrecomputedTransactionData *cache)
CPubKey GetPubKey() const
Compute the public key from a private key.
An encapsulated public key.
const std::vector< CTxOut > vout
CHash160 & Write(const unsigned char *data, size_t len)
std::vector< CTxOut > vout
void Set(const T pbegin, const T pend, bool fCompressedIn)
Initialize using begin and end iterators to byte data.
uint256 GetHash() const
Compute the hash of this CMutableTransaction.
const unsigned char * begin() const
int fabcoinconsensus_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, fabcoinconsensus_error *err)
Serialized script, used inside transaction inputs and outputs.
A mutable version of CTransaction.
BENCHMARK(VerifyScriptBench, 6300)
An encapsulated private key.
The basic transaction that is broadcasted on the network and contained in blocks. ...
A hasher class for Fabcoin's 160-bit hash (SHA-256 + RIPEMD-160).
bool Sign(const uint256 &hash, std::vector< unsigned char > &vchSig, uint32_t test_case=0) const
Create a DER-serialized signature.
std::vector< unsigned char > ToByteVector(const T &in)