A UTXO under consideration for use in funding a new transaction. */
| 29 | |
| 30 | /** A UTXO under consideration for use in funding a new transaction. */ |
| 31 | class CInputCoin { |
| 32 | public: |
| 33 | CInputCoin(const CWallet& wallet, const CWalletTx* wtx, unsigned int i); |
| 34 | |
| 35 | CInputCoin(const CWallet& wallet, const CWalletTx* wtx, unsigned int i, int input_bytes) : CInputCoin(wallet, wtx, i) |
| 36 | { |
| 37 | m_input_bytes = input_bytes; |
| 38 | } |
| 39 | |
| 40 | CInputCoin(const COutPoint& outpoint_in, const CTxOut& txout_in) |
| 41 | { |
| 42 | outpoint = outpoint_in; |
| 43 | txout = txout_in; |
| 44 | if (txout.nValue.IsExplicit()) { |
| 45 | effective_value = txout_in.nValue.GetAmount(); |
| 46 | value = txout.nValue.GetAmount(); |
| 47 | asset = txout.nAsset.GetAsset(); |
| 48 | } else { |
| 49 | effective_value = 0; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | CInputCoin(const COutPoint& outpoint_in, const CTxOut& txout_in, int input_bytes) : CInputCoin(outpoint_in, txout_in) |
| 54 | { |
| 55 | m_input_bytes = input_bytes; |
| 56 | } |
| 57 | |
| 58 | CInputCoin(const COutPoint& outpoint_in, const Sidechain::Bitcoin::CTxOut& txout_in) |
| 59 | { |
| 60 | outpoint = outpoint_in; |
| 61 | effective_value = txout_in.nValue; |
| 62 | txout.SetNull(); |
| 63 | txout.scriptPubKey = txout_in.scriptPubKey; |
| 64 | txout.nValue.SetToAmount(txout_in.nValue); |
| 65 | txout.nAsset.SetToAsset(Params().GetConsensus().pegged_asset); |
| 66 | asset = Params().GetConsensus().pegged_asset; |
| 67 | value = txout_in.nValue; |
| 68 | } |
| 69 | |
| 70 | CInputCoin(const COutPoint& outpoint_in, const Sidechain::Bitcoin::CTxOut& txout_in, int input_bytes) : CInputCoin(outpoint_in, txout_in) |
| 71 | { |
| 72 | m_input_bytes = input_bytes; |
| 73 | } |
| 74 | |
| 75 | COutPoint outpoint; |
| 76 | CTxOut txout; |
| 77 | CAmount effective_value; |
| 78 | CAmount m_fee{0}; |
| 79 | CAmount m_long_term_fee{0}; |
| 80 | // ELEMENTS: |
| 81 | CAmount value; |
| 82 | CAsset asset; |
| 83 | uint256 bf_value; |
| 84 | uint256 bf_asset; |
| 85 | |
| 86 | /** Pre-computed estimated size of this output as a fully-signed input in a transaction. Can be -1 if it could not be calculated */ |
| 87 | int m_input_bytes{-1}; |
| 88 |
no outgoing calls
no test coverage detected