aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/test/group_outputs_tests.cpp2
-rw-r--r--src/wallet/test/wallet_tests.cpp2
-rw-r--r--src/wallet/transaction.h17
3 files changed, 11 insertions, 10 deletions
diff --git a/src/wallet/test/group_outputs_tests.cpp b/src/wallet/test/group_outputs_tests.cpp
index e6b25cc216..b32dc8ed5a 100644
--- a/src/wallet/test/group_outputs_tests.cpp
+++ b/src/wallet/test/group_outputs_tests.cpp
@@ -40,7 +40,7 @@ static void addCoin(CoinsResult& coins,
tx.vout[0].nValue = nValue;
tx.vout[0].scriptPubKey = GetScriptForDestination(dest);
- const uint256& txid = tx.GetHash();
+ const auto txid{tx.GetHash().ToUint256()};
LOCK(wallet.cs_wallet);
auto ret = wallet.mapWallet.emplace(std::piecewise_construct, std::forward_as_tuple(txid), std::forward_as_tuple(MakeTransactionRef(std::move(tx)), TxStateInactive{}));
assert(ret.second);
diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp
index dea7be03a6..bcbc31ed3e 100644
--- a/src/wallet/test/wallet_tests.cpp
+++ b/src/wallet/test/wallet_tests.cpp
@@ -963,7 +963,7 @@ BOOST_FIXTURE_TEST_CASE(wallet_sync_tx_invalid_state_test, TestingSetup)
mtx.vin.clear();
mtx.vin.emplace_back(tx_id_to_spend, 0);
wallet.transactionAddedToMempool(MakeTransactionRef(mtx));
- const uint256& good_tx_id = mtx.GetHash();
+ const auto good_tx_id{mtx.GetHash().ToUint256()};
{
// Verify balance update for the new tx and the old one
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: