14 txCredit.
vin.resize(1);
15 txCredit.
vout.resize(1);
16 txCredit.
vin[0].prevout.SetNull();
19 txCredit.
vout[0].scriptPubKey = scriptPubKey;
20 txCredit.
vout[0].nValue = nValue;
30 txSpend.
vin.resize(1);
31 txSpend.
vout.resize(1);
32 txSpend.
vin[0].scriptWitness = scriptWitness;
33 txSpend.
vin[0].prevout.hash = txCredit.
GetHash();
34 txSpend.
vin[0].prevout.n = 0;
35 txSpend.
vin[0].scriptSig = scriptSig;
38 txSpend.
vout[0].nValue = txCredit.
vout[0].nValue;
45 std::vector<CMutableTransaction> dummyTransactions;
46 dummyTransactions.resize(2);
50 for (
int i = 0; i < 4; i++) {
52 keystoreRet.
AddKey(key[i]);
56 dummyTransactions[0].vout.resize(2);
57 dummyTransactions[0].vout[0].nValue = nValues[0];
59 dummyTransactions[0].vout[1].nValue = nValues[1];
63 dummyTransactions[1].vout.resize(2);
64 dummyTransactions[1].vout[0].nValue = nValues[2];
66 dummyTransactions[1].vout[1].nValue = nValues[3];
70 return dummyTransactions;
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 uint256 & GetHash() const
static const uint32_t SEQUENCE_FINAL
Setting nSequence to this value for every input in a transaction disables nLockTime/IsFinalTx().
Fillable signing provider that keeps keys in an address->secret map.
virtual bool AddKey(const CKey &key)
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.
std::vector< unsigned char > ToByteVector(const T &in)
static bool GetPubKey(const SigningProvider &provider, const SignatureData &sigdata, const CKeyID &address, CPubKey &pubkey)
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
A mutable version of CTransaction.
std::vector< CTxOut > vout
CMutableTransaction BuildSpendingTransaction(const CScript &scriptSig, const CScriptWitness &scriptWitness, const CTransaction &txCredit)
CMutableTransaction BuildCreditingTransaction(const CScript &scriptPubKey, int nValue)
std::vector< CMutableTransaction > SetupDummyInputs(FillableSigningProvider &keystoreRet, CCoinsViewCache &coinsRet, const std::array< CAmount, 4 > &nValues)