aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/spend.h
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2022-01-18 19:03:23 -0500
committerAndrew Chow <achow101-github@achow101.com>2022-03-17 11:04:22 -0400
commitd51f27d3bb0d6e3ca55bcd23ce53e4fe413a9360 (patch)
tree2be30afe1561e64d9410d8647ee01c238ff0f26f /src/wallet/spend.h
parentb799814bbd53736b79495072f3c9e05989a465e8 (diff)
downloadbitcoin-d51f27d3bb0d6e3ca55bcd23ce53e4fe413a9360.tar.xz
wallet: Store whether a COutput is from the wallet
Instead of determining whether the containing transaction is from the wallet dynamically as needed, just pass it in to COutput and store it. The transaction ownership isn't going to change.
Diffstat (limited to 'src/wallet/spend.h')
-rw-r--r--src/wallet/spend.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wallet/spend.h b/src/wallet/spend.h
index 86735fc998..e71e90eaca 100644
--- a/src/wallet/spend.h
+++ b/src/wallet/spend.h
@@ -51,7 +51,10 @@ public:
/** The time of the transaction containing this output as determined by CWalletTx::nTimeSmart */
int64_t time;
- COutput(const CWallet& wallet, const CWalletTx& wtx, int iIn, int depth, bool spendable, bool solvable, bool safe, int64_t time, bool use_max_sig_in)
+ /** 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)
: tx(&wtx),
i(iIn),
depth(depth),
@@ -60,7 +63,8 @@ public:
solvable(solvable),
use_max_sig(use_max_sig_in),
safe(safe),
- time(time)
+ time(time),
+ from_me(from_me)
{
// If known and signable by the given wallet, compute input_bytes
// Failure will keep this value -1