15 txCredit.
vin.resize(1);
16 txCredit.
vout.resize(1);
17 txCredit.
vin[0].prevout.SetNull();
20 txCredit.
vout[0].scriptPubKey = scriptPubKey;
21 txCredit.
vout[0].nValue = nValue;
31 txSpend.
vin.resize(1);
32 txSpend.
vout.resize(1);
33 txSpend.
vin[0].scriptWitness = scriptWitness;
34 txSpend.
vin[0].prevout.hash = txCredit.
GetHash();
35 txSpend.
vin[0].prevout.n = 0;
36 txSpend.
vin[0].scriptSig = scriptSig;
39 txSpend.
vout[0].nValue = txCredit.
vout[0].nValue;
46 std::vector<CMutableTransaction> dummyTransactions;
47 dummyTransactions.resize(2);
51 for (
int i = 0; i < 4; i++) {
53 keystoreRet.
AddKey(key[i]);
57 dummyTransactions[0].vout.resize(2);
58 dummyTransactions[0].vout[0].nValue = nValues[0];
60 dummyTransactions[0].vout[1].nValue = nValues[1];
64 dummyTransactions[1].vout.resize(2);
65 dummyTransactions[1].vout[0].nValue = nValues[2];
67 dummyTransactions[1].vout[1].nValue = nValues[3];
71 return dummyTransactions;
78 assert(target_weight >= unpadded_weight);
87 tx.
vout[0].scriptPubKey.insert(tx.
vout[0].scriptPubKey.end(), dummy_vbytes,
OP_1);
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
int64_t CAmount
Amount in satoshis (Can be negative)
CCoinsView that adds a memory cache for transactions to another CCoinsView.
An encapsulated private key.
void MakeNewKey(bool fCompressed)
Generate a new private key using a cryptographic PRNG.
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
const std::vector< CTxOut > vout
const Txid & GetHash() const LIFETIMEBOUND
An input of a transaction.
static const uint32_t SEQUENCE_FINAL
Setting nSequence to this value for every input in a transaction disables nLockTime/IsFinalTx().
An output of a transaction.
Fillable signing provider that keeps keys in an address->secret map.
virtual bool AddKey(const CKey &key)
A signature creator for transactions.
An interface to be implemented by keystores that support signing.
void AddCoins(CCoinsViewCache &cache, const CTransaction &tx, int nHeight, bool check_for_overwrite)
Utility function to add all of a transaction's outputs to a cache.
static int32_t GetTransactionWeight(const CTransaction &tx)
static const int WITNESS_SCALE_FACTOR
std::vector< unsigned char > ToByteVector(const T &in)
constexpr unsigned int GetSizeOfCompactSize(uint64_t nSize)
Compact Size size < 253 – 1 byte size <= USHRT_MAX – 3 bytes (253 + 2 bytes) size <= UINT_MAX – 5 byt...
bool ProduceSignature(const SigningProvider &provider, const BaseSignatureCreator &creator, const CScript &fromPubKey, SignatureData &sigdata)
Produce a script signature using a generic signature creator.
void UpdateInput(CTxIn &input, const SignatureData &data)
static bool GetPubKey(const SigningProvider &provider, const SignatureData &sigdata, const CKeyID &address, CPubKey &pubkey)
A mutable version of CTransaction.
std::vector< CTxOut > vout
CMutableTransaction BuildSpendingTransaction(const CScript &scriptSig, const CScriptWitness &scriptWitness, const CTransaction &txCredit)
void BulkTransaction(CMutableTransaction &tx, int32_t target_weight)
std::vector< CMutableTransaction > SetupDummyInputs(FillableSigningProvider &keystoreRet, CCoinsViewCache &coinsRet, const std::array< CAmount, 4 > &nValues)
bool SignSignature(const SigningProvider &provider, const CScript &fromPubKey, CMutableTransaction &txTo, unsigned int nIn, const CAmount &amount, int nHashType, SignatureData &sig_data)
Produce a satisfying script (scriptSig or witness).
CMutableTransaction BuildCreditingTransaction(const CScript &scriptPubKey, int nValue)