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

Method CInputCoin

src/wallet/coinselection.cpp:19–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18namespace wallet {
19CInputCoin::CInputCoin(const CWallet& wallet, const CWalletTx* wtx, unsigned int i) {
20 if (!wtx || !wtx->tx)
21 throw std::invalid_argument("tx should not be null");
22 if (i >= wtx->tx->vout.size())
23 throw std::out_of_range("The output index is out of range");
24
25 outpoint = COutPoint(wtx->tx->GetHash(), i);
26 txout = wtx->tx->vout[i];
27 effective_value = std::max<CAmount>(0, wtx->GetOutputValueOut(wallet, i));
28 value = wtx->GetOutputValueOut(wallet, i);
29 asset = wtx->GetOutputAsset(wallet, i);
30 bf_value = wtx->GetOutputAmountBlindingFactor(wallet, i);
31 bf_asset = wtx->GetOutputAssetBlindingFactor(wallet, i);
32}
33
34// Descending order comparator
35struct {

Callers

nothing calls this directly

Calls 7

GetOutputValueOutMethod · 0.80
GetOutputAssetMethod · 0.80
COutPointClass · 0.50
sizeMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected