20 static std::vector<CMutableTransaction>
23 std::vector<CMutableTransaction> dummyTransactions;
24 dummyTransactions.resize(2);
28 for (
int i = 0; i < 4; i++) {
30 keystoreRet.
AddKey(key[i]);
34 dummyTransactions[0].vout.resize(2);
35 dummyTransactions[0].vout[0].nValue = 11 * CENT;
37 dummyTransactions[0].vout[1].nValue = 50 * CENT;
41 dummyTransactions[1].vout.resize(2);
42 dummyTransactions[1].vout[0].nValue = 21 * CENT;
44 dummyTransactions[1].vout[1].nValue = 22 * CENT;
48 return dummyTransactions;
62 std::vector<CMutableTransaction> dummyTransactions = SetupDummyInputs(keystore, coins);
66 t1.
vin[0].prevout.hash = dummyTransactions[0].GetHash();
67 t1.
vin[0].prevout.n = 1;
68 t1.
vin[0].scriptSig << std::vector<unsigned char>(65, 0);
69 t1.
vin[1].prevout.hash = dummyTransactions[1].GetHash();
70 t1.
vin[1].prevout.n = 0;
71 t1.
vin[1].scriptSig << std::vector<unsigned char>(65, 0) << std::vector<unsigned char>(33, 4);
72 t1.
vin[2].prevout.hash = dummyTransactions[1].GetHash();
73 t1.
vin[2].prevout.n = 1;
74 t1.
vin[2].scriptSig << std::vector<unsigned char>(65, 0) << std::vector<unsigned char>(33, 4);
76 t1.
vout[0].nValue = 90 * CENT;
83 CAmount value = coins.GetValueIn(t1);
84 assert(value == (50 + 21 + 22) * CENT);
int64_t CAmount
Amount in corbies (Can be negative)
bool AreInputsStandard(const CTransaction &tx, const CCoinsViewCache &mapInputs)
Check transaction inputs to mitigate two potential denial-of-service attacks:
Abstract view on the open txout dataset.
void MakeNewKey(bool fCompressed)
Generate a new private key using a cryptographic PRNG.
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Raven scriptPubKey for the given CTxDestination.
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.
void AddCoins(CCoinsViewCache &cache, const CTransaction &tx, int nHeight, uint256 blockHash, bool check, CAssetsCache *assetsCache, std::pair< std::string, CBlockAssetUndo > *undoAssetData)
Utility function to add all of a transaction's outputs to a cache.
Basic key store, that keeps keys in an address->secret map.
std::vector< unsigned char > ToByteVector(const T &in)