diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-08-27 16:21:32 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-08-27 16:21:37 +0200 |
commit | 91af7ef831d32a9db7719c64442a7d76cef5a931 (patch) | |
tree | c29be12c807d96b927afa83aafcc59b454da61eb /src/wallet/wallet.h | |
parent | 2562d5d23863b6ef6cbdd9c34db5e485d9dc8406 (diff) | |
parent | b8405b833ad28351c80fb10f6f896f974013fd9e (diff) | |
download | bitcoin-91af7ef831d32a9db7719c64442a7d76cef5a931.tar.xz |
Merge #19289: wallet: GetWalletTx and IsMine require cs_wallet lock
b8405b833ad28351c80fb10f6f896f974013fd9e wallet: IsChange requires cs_wallet lock (João Barbosa)
d8441f30ff57e4ae98cff6694c995eaffc19c51a wallet: IsMine overloads require cs_wallet lock (João Barbosa)
a13cafc6c6998baedf3c5766259c21fcd763b99e wallet: GetWalletTx requires cs_wallet lock (João Barbosa)
Pull request description:
This change removes some unlock/lock and lock/lock cases regarding `GetWalletTx` and `IsMine` overloads.
ACKs for top commit:
laanwj:
Code review ACK b8405b833ad28351c80fb10f6f896f974013fd9e
ryanofsky:
Code review ACK b8405b833ad28351c80fb10f6f896f974013fd9e. Just new commit since last review changing IsChange GetChange locks and adding annotations
Tree-SHA512: 40d37c4fe5d10a1407f57d899d5822bb285633d8dbfad8afcf15a9b41b428ed9971a9a7b1aae84318371155132df3002699a15dab56e004527d50c889829187d
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r-- | src/wallet/wallet.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 2f9d301000..f421de0cf2 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -805,7 +805,7 @@ public: /** Interface for accessing chain state. */ interfaces::Chain& chain() const { assert(m_chain); return *m_chain; } - const CWalletTx* GetWalletTx(const uint256& hash) const; + const CWalletTx* GetWalletTx(const uint256& hash) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); //! check whether we are allowed to upgrade (or already support) to the named feature bool CanSupportFeature(enum WalletFeature wf) const override EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) { AssertLockHeld(cs_wallet); return nWalletMaxVersion >= wf; } @@ -1051,20 +1051,20 @@ public: bool GetNewDestination(const OutputType type, const std::string label, CTxDestination& dest, std::string& error); bool GetNewChangeDestination(const OutputType type, CTxDestination& dest, std::string& error); - isminetype IsMine(const CTxDestination& dest) const; - isminetype IsMine(const CScript& script) const; - isminetype IsMine(const CTxIn& txin) const; + isminetype IsMine(const CTxDestination& dest) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); + isminetype IsMine(const CScript& script) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); + isminetype IsMine(const CTxIn& txin) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); /** * Returns amount of debit if the input matches the * filter, otherwise returns 0 */ CAmount GetDebit(const CTxIn& txin, const isminefilter& filter) const; - isminetype IsMine(const CTxOut& txout) const; + isminetype IsMine(const CTxOut& txout) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); CAmount GetCredit(const CTxOut& txout, const isminefilter& filter) const; - bool IsChange(const CTxOut& txout) const; - bool IsChange(const CScript& script) const; - CAmount GetChange(const CTxOut& txout) const; - bool IsMine(const CTransaction& tx) const; + bool IsChange(const CTxOut& txout) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); + bool IsChange(const CScript& script) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); + CAmount GetChange(const CTxOut& txout) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); + bool IsMine(const CTransaction& tx) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); /** should probably be renamed to IsRelevantToMe */ bool IsFromMe(const CTransaction& tx) const; CAmount GetDebit(const CTransaction& tx, const isminefilter& filter) const; |