From faec889f938f90e0b887426db27a15ec0d169399 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 27 Oct 2023 12:38:21 +0200 Subject: refactor: Add LIFETIMEBOUND to all (w)txid getters Then, use the compiler warnings to create copies only where needed. Also, fix iwyu includes while touching the includes. --- src/wallet/transaction.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/wallet/transaction.h') 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 -#include +#include #include #include -#include -#include -#include #include +#include #include #include #include +#include -#include +#include +#include +#include +#include #include #include @@ -330,8 +331,8 @@ public: bool isInactive() const { return state(); } bool isUnconfirmed() const { return !isAbandoned() && !isConflicted() && !isConfirmed(); } bool isConfirmed() const { return state(); } - 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: -- cgit v1.2.3