MCPcopy Create free account
hub / github.com/ElementsProject/elements / add_coin

Function add_coin

src/bench/coin_selection.cpp:96–105  ·  view source on GitHub ↗

Copied from src/wallet/test/coinselector_tests.cpp

Source from the content-addressed store, hash-verified

94
95// Copied from src/wallet/test/coinselector_tests.cpp
96static void add_coin(const CAmount& nValue, int nInput, std::vector<OutputGroup>& set)
97{
98 CMutableTransaction tx;
99 tx.vout.resize(nInput + 1);
100 tx.vout[nInput].nValue = nValue;
101 CWalletTx wtx(MakeTransactionRef(tx), TxStateInactive{});
102 CInputCoin coin(testWallet, &wtx, nInput);
103 set.emplace_back();
104 set.back().Insert(coin, 0, true, 0, 0, false);
105}
106// Copied from src/wallet/test/coinselector_tests.cpp
107static CAmount make_hard_case(int utxos, std::vector<OutputGroup>& utxo_pool)
108{

Callers 3

make_hard_caseFunction · 0.70
BOOST_AUTO_TEST_CASEFunction · 0.50
BOOST_AUTO_TEST_CASEFunction · 0.50

Calls 4

emplace_backMethod · 0.80
MakeTransactionRefFunction · 0.50
resizeMethod · 0.45
InsertMethod · 0.45

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.40
BOOST_AUTO_TEST_CASEFunction · 0.40