wallet: Add input bytes to CInputCoin
With nInputBytes, coin selection can execute without a reference to the COutput
This commit is contained in:
2 files changed
+13
No files matched your search
@@ -28,12 +28,20 @@ public:
|
|||||||
effective_value = txout.nValue;
|
effective_value = txout.nValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CInputCoin(const CTransactionRef& tx, unsigned int i, int input_bytes) : CInputCoin(tx, i)
|
||||||
|
{
|
||||||
|
m_input_bytes = input_bytes;
|
||||||
|
}
|
||||||
|
|
||||||
COutPoint outpoint;
|
COutPoint outpoint;
|
||||||
CTxOut txout;
|
CTxOut txout;
|
||||||
CAmount effective_value;
|
CAmount effective_value;
|
||||||
CAmount fee = 0;
|
CAmount fee = 0;
|
||||||
CAmount long_term_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 {
|
bool operator<(const CInputCoin& rhs) const {
|
||||||
return outpoint < rhs.outpoint;
|
return outpoint < rhs.outpoint;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -525,6 +525,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string ToString() const;
|
std::string ToString() const;
|
||||||
|
|
||||||
|
inline CInputCoin GetInputCoin() const
|
||||||
|
{
|
||||||
|
return CInputCoin(tx->tx, i, nInputBytes);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user