19 static std::vector<CMutableTransaction>
22 std::vector<CMutableTransaction> dummyTransactions;
23 dummyTransactions.resize(2);
27 for (
int i = 0; i < 4; i++) {
29 keystoreRet.
AddKey(key[i]);
33 dummyTransactions[0].vout.resize(2);
34 dummyTransactions[0].vout[0].nValue = 11 * CENT;
36 dummyTransactions[0].vout[1].nValue = 50 * CENT;
38 AddCoins(coinsRet, dummyTransactions[0], 0);
40 dummyTransactions[1].vout.resize(2);
41 dummyTransactions[1].vout[0].nValue = 21 * CENT;
43 dummyTransactions[1].vout[1].nValue = 22 * CENT;
45 AddCoins(coinsRet, dummyTransactions[1], 0);
47 return dummyTransactions;
61 std::vector<CMutableTransaction> dummyTransactions = SetupDummyInputs(keystore, coins);
65 t1.
vin[0].prevout.hash = dummyTransactions[0].GetHash();
66 t1.
vin[0].prevout.n = 1;
67 t1.
vin[0].scriptSig << std::vector<unsigned char>(65, 0);
68 t1.
vin[1].prevout.hash = dummyTransactions[1].GetHash();
69 t1.
vin[1].prevout.n = 0;
70 t1.
vin[1].scriptSig << std::vector<unsigned char>(65, 0) << std::vector<unsigned char>(33, 4);
71 t1.
vin[2].prevout.hash = dummyTransactions[1].GetHash();
72 t1.
vin[2].prevout.n = 1;
73 t1.
vin[2].scriptSig << std::vector<unsigned char>(65, 0) << std::vector<unsigned char>(33, 4);
75 t1.
vout[0].nValue = 90 * CENT;
82 CAmount value = coins.GetValueIn(t1);
83 assert(value == (50 + 21 + 22) * CENT);
void AddCoins(CCoinsViewCache &cache, const CTransaction &tx, int nHeight, bool check)
Utility function to add all of a transaction's outputs to a cache.
assert(len-trim+(2 *lenIndices)<=WIDTH)
int64_t CAmount
Amount in lius (Can be negative)
bool AreInputsStandard(const CTransaction &tx, const CCoinsViewCache &mapInputs)
Check for standard transaction types.
Abstract view on the open txout dataset.
void MakeNewKey(bool fCompressed)
Generate a new private key using a cryptographic PRNG.
BENCHMARK(CCoinsCaching, 170 *1000)
CScript GetScriptForDestination(const CTxDestination &dest)
virtual bool AddKey(const CKey &key)
std::vector< CTxOut > vout
A mutable version of CTransaction.
An encapsulated private key.
CCoinsView that adds a memory cache for transactions to another CCoinsView.
Basic key store, that keeps keys in an address->secret map.
std::vector< unsigned char > ToByteVector(const T &in)