MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / addCoin

Function addCoin

src/bench/coin_selection.cpp:33–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32namespace wallet {
33static void addCoin(const CAmount& nValue, std::vector<std::unique_ptr<CWalletTx>>& wtxs)
34{
35 static int nextLockTime = 0;
36 CMutableTransaction tx;
37 tx.nLockTime = nextLockTime++; // so all transactions get different hashes
38 tx.vout.resize(1);
39 tx.vout[0].nValue = nValue;
40 wtxs.push_back(std::make_unique<CWalletTx>(MakeTransactionRef(std::move(tx)), TxStateInactive{}));
41}
42
43// This benchmark is based on a large diverse UTXO pool. The UTXOs are
44// pseudorandomly generated and assigned one of the four relevant output types

Callers 1

CoinSelectionFunction · 0.70

Calls 3

MakeTransactionRefFunction · 0.85
resizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected