diff options
author | Andrew Chow <achow101-github@achow101.com> | 2022-01-18 21:04:26 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2022-03-23 14:32:05 -0400 |
commit | 0ba4d1916e26e2a5d603edcdb7625463989d25b6 (patch) | |
tree | ef3f9a7fddf9ed5216f26cc5e72059f61af4985c /src/wallet/spend.h | |
parent | d51f27d3bb0d6e3ca55bcd23ce53e4fe413a9360 (diff) |
wallet: Provide input bytes to COutput
Diffstat (limited to 'src/wallet/spend.h')
-rw-r--r-- | src/wallet/spend.h | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/wallet/spend.h b/src/wallet/spend.h index e71e90eaca..029560a16c 100644 --- a/src/wallet/spend.h +++ b/src/wallet/spend.h @@ -11,7 +11,9 @@ #include <wallet/wallet.h> namespace wallet { -/** Get the marginal bytes if spending the specified output from this transaction */ +/** Get the marginal bytes if spending the specified output from this transaction. + * use_max_sig indicates whether to use the maximum sized, 72 byte signature when calculating the + * size of the input spend. This should only be set when watch-only outputs are allowed */ int GetTxSpendSize(const CWallet& wallet, const CWalletTx& wtx, unsigned int out, bool use_max_sig = false); class COutput @@ -38,9 +40,6 @@ public: /** Whether we know how to spend this output, ignoring the lack of keys */ bool solvable; - /** Whether to use the maximum sized, 72 byte signature when calculating the size of the input spend. This should only be set when watch-only outputs are allowed */ - bool use_max_sig; - /** * Whether this output is considered safe to spend. Unconfirmed transactions * from outside keys and unconfirmed replacement transactions are considered @@ -54,24 +53,17 @@ public: /** Whether the transaction containing this output is sent from the owning wallet */ bool from_me; - COutput(const CWallet& wallet, const CWalletTx& wtx, int iIn, int depth, bool spendable, bool solvable, bool safe, int64_t time, bool from_me, bool use_max_sig_in) + COutput(const CWallet& wallet, const CWalletTx& wtx, int iIn, int depth, int input_bytes, bool spendable, bool solvable, bool safe, int64_t time, bool from_me) : tx(&wtx), i(iIn), depth(depth), - input_bytes(-1), + input_bytes(input_bytes), spendable(spendable), solvable(solvable), - use_max_sig(use_max_sig_in), safe(safe), time(time), from_me(from_me) - { - // If known and signable by the given wallet, compute input_bytes - // Failure will keep this value -1 - if (spendable) { - input_bytes = GetTxSpendSize(wallet, wtx, i, use_max_sig); - } - } + {} std::string ToString() const; |