diff options
author | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2018-07-17 16:56:06 +0900 |
---|---|---|
committer | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2018-07-24 15:05:36 +0900 |
commit | 65b3eda458221644616d0fdd6ba0fe01bdbce893 (patch) | |
tree | c94e1b3f7ee693291c2ba32fafc83c0ba58ea85e /src/wallet/coinselection.h | |
parent | a443d7a0ca333b0bae63e04b5d476f9ad9c7aeac (diff) |
wallet: Add input bytes to CInputCoin
With nInputBytes, coin selection can execute without a reference to the COutput
Diffstat (limited to 'src/wallet/coinselection.h')
-rw-r--r-- | src/wallet/coinselection.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wallet/coinselection.h b/src/wallet/coinselection.h index 64111f3939..218d20fb47 100644 --- a/src/wallet/coinselection.h +++ b/src/wallet/coinselection.h @@ -28,12 +28,20 @@ public: effective_value = txout.nValue; } + CInputCoin(const CTransactionRef& tx, unsigned int i, int input_bytes) : CInputCoin(tx, i) + { + m_input_bytes = input_bytes; + } + COutPoint outpoint; CTxOut txout; CAmount effective_value; CAmount fee = 0; CAmount long_term_fee = 0; + /** Pre-computed estimated size of this output as a fully-signed input in a transaction. Can be -1 if it could not be calculated */ + int m_input_bytes{-1}; + bool operator<(const CInputCoin& rhs) const { return outpoint < rhs.outpoint; } |