diff options
author | fanquake <fanquake@gmail.com> | 2023-10-29 10:05:13 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-10-29 10:10:53 +0100 |
commit | 42b0d5f59b868e8ed5ae6c7df3bc133f79e3bfb3 (patch) | |
tree | bd32913df89db000f46022e311540dffbdbea257 /src/wallet/transaction.h | |
parent | e789b30b2565c8bdbf48a45f2c5a7b92e5d61d25 (diff) | |
parent | faec889f938f90e0b887426db27a15ec0d169399 (diff) | |
download | bitcoin-42b0d5f59b868e8ed5ae6c7df3bc133f79e3bfb3.tar.xz |
Merge bitcoin/bitcoin#28740: refactor: Add LIFETIMEBOUND to all (w)txid getters
faec889f938f90e0b887426db27a15ec0d169399 refactor: Add LIFETIMEBOUND to all (w)txid getters (MarcoFalke)
Pull request description:
Currently some getters return a reference, some don't. Fix this by returning a reference everywhere. Also, add `LIFETIMEBOUND` to all. Then, use the compiler warnings to create copies only where needed.
Also, fix iwyu includes while touching the includes.
ACKs for top commit:
dergoegge:
Code review ACK faec889f938f90e0b887426db27a15ec0d169399
stickies-v:
ACK faec889f938f90e0b887426db27a15ec0d169399
pablomartin4btc:
cr ACK faec889f938f90e0b887426db27a15ec0d169399
Tree-SHA512: 0c2a151f39d0e007b4d33b0b85ad578cc220f3e9dd94890e812b3181c3901545b039325707731cc39a5e89557f59c1154c6320525f78f5de95f119a514d2d23f
Diffstat (limited to 'src/wallet/transaction.h')
-rw-r--r-- | src/wallet/transaction.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/wallet/transaction.h b/src/wallet/transaction.h index 2969ba7fdb..db858fa5ba 100644 --- a/src/wallet/transaction.h +++ b/src/wallet/transaction.h @@ -5,19 +5,20 @@ #ifndef BITCOIN_WALLET_TRANSACTION_H #define BITCOIN_WALLET_TRANSACTION_H -#include <bitset> -#include <cstdint> +#include <attributes.h> #include <consensus/amount.h> #include <primitives/transaction.h> -#include <serialize.h> -#include <wallet/types.h> -#include <threadsafety.h> #include <tinyformat.h> +#include <uint256.h> #include <util/overloaded.h> #include <util/strencodings.h> #include <util/string.h> +#include <wallet/types.h> -#include <list> +#include <bitset> +#include <cstdint> +#include <map> +#include <utility> #include <variant> #include <vector> @@ -330,8 +331,8 @@ public: bool isInactive() const { return state<TxStateInactive>(); } bool isUnconfirmed() const { return !isAbandoned() && !isConflicted() && !isConfirmed(); } bool isConfirmed() const { return state<TxStateConfirmed>(); } - const Txid& GetHash() const { return tx->GetHash(); } - const Wtxid& GetWitnessHash() const { return tx->GetWitnessHash(); } + const Txid& GetHash() const LIFETIMEBOUND { return tx->GetHash(); } + const Wtxid& GetWitnessHash() const LIFETIMEBOUND { return tx->GetWitnessHash(); } bool IsCoinBase() const { return tx->IsCoinBase(); } private: |