aboutsummaryrefslogtreecommitdiff
path: root/src/util/transaction_identifier.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/transaction_identifier.h')
-rw-r--r--src/util/transaction_identifier.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/transaction_identifier.h b/src/util/transaction_identifier.h
index 77f4b8367d..4fb9b49966 100644
--- a/src/util/transaction_identifier.h
+++ b/src/util/transaction_identifier.h
@@ -1,6 +1,7 @@
#ifndef BITCOIN_UTIL_TRANSACTION_IDENTIFIER_H
#define BITCOIN_UTIL_TRANSACTION_IDENTIFIER_H
+#include <attributes.h>
#include <uint256.h>
#include <util/types.h>
@@ -35,7 +36,7 @@ public:
template <typename Other>
bool operator<(const Other& other) const { return Compare(other) < 0; }
- uint256 ToUint256() const { return m_wrapped; }
+ const uint256& ToUint256() const LIFETIMEBOUND { return m_wrapped; }
static transaction_identifier FromUint256(const uint256& id) { return {id}; }
/** Wrapped `uint256` methods. */
@@ -56,7 +57,7 @@ public:
* TODO: This should be removed once the majority of the code has switched
* to using the Txid and Wtxid types. Until then it makes for a smoother
* transition to allow this conversion. */
- operator uint256() const { return m_wrapped; }
+ operator const uint256&() const LIFETIMEBOUND { return m_wrapped; }
};
/** Txid commits to all transaction fields except the witness. */