From 5bf91ba8800d23402536d758f02198eac0fd7d61 Mon Sep 17 00:00:00 2001 From: David Gumberg Date: Wed, 14 May 2025 11:09:59 -0700 Subject: [PATCH] wallet: Drop unused fFromMe from CWalletTx This has been unused since commit fe52346, previously attempted to be removed in PR #9351 (https://github.com/bitcoin/bitcoin/pull/9351/) Co-authored-by: Ryan Ofsky --- src/wallet/transaction.h | 15 ++++----------- src/wallet/wallet.cpp | 2 -- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/wallet/transaction.h b/src/wallet/transaction.h index 9079f6dd82a..e1ebcbe71e1 100644 --- a/src/wallet/transaction.h +++ b/src/wallet/transaction.h @@ -215,12 +215,6 @@ public: * CWallet::ComputeTimeSmart(). */ unsigned int nTimeSmart; - /** - * From me flag is set to 1 for transactions that were created by the wallet - * on this bitcoin node, and set to 0 for transactions that were created - * externally and came in through the network or sendrawtransaction RPC. - */ - bool fFromMe; int64_t nOrderPos; //!< position in ordered transaction list std::multimap::const_iterator m_it_wtxOrdered; @@ -249,7 +243,6 @@ public: fTimeReceivedIsTxTime = false; nTimeReceived = 0; nTimeSmart = 0; - fFromMe = false; fChangeCached = false; nChangeCached = 0; nOrderPos = -1; @@ -281,10 +274,10 @@ public: std::vector dummy_vector1; //!< Used to be vMerkleBranch std::vector dummy_vector2; //!< Used to be vtxPrev - bool dummy_bool = false; //!< Used to be fSpent + bool dummy_bool = false; //!< Used to be fFromMe and fSpent uint256 serializedHash = TxStateSerializedBlockHash(m_state); int serializedIndex = TxStateSerializedIndex(m_state); - s << TX_WITH_WITNESS(tx) << serializedHash << dummy_vector1 << serializedIndex << dummy_vector2 << mapValueCopy << vOrderForm << fTimeReceivedIsTxTime << nTimeReceived << fFromMe << dummy_bool; + s << TX_WITH_WITNESS(tx) << serializedHash << dummy_vector1 << serializedIndex << dummy_vector2 << mapValueCopy << vOrderForm << fTimeReceivedIsTxTime << nTimeReceived << dummy_bool << dummy_bool; } template @@ -294,10 +287,10 @@ public: std::vector dummy_vector1; //!< Used to be vMerkleBranch std::vector dummy_vector2; //!< Used to be vtxPrev - bool dummy_bool; //! Used to be fSpent + bool dummy_bool; //! Used to be fFromMe and fSpent uint256 serialized_block_hash; int serializedIndex; - s >> TX_WITH_WITNESS(tx) >> serialized_block_hash >> dummy_vector1 >> serializedIndex >> dummy_vector2 >> mapValue >> vOrderForm >> fTimeReceivedIsTxTime >> nTimeReceived >> fFromMe >> dummy_bool; + s >> TX_WITH_WITNESS(tx) >> serialized_block_hash >> dummy_vector1 >> serializedIndex >> dummy_vector2 >> mapValue >> vOrderForm >> fTimeReceivedIsTxTime >> nTimeReceived >> dummy_bool >> dummy_bool; m_state = TxStateInterpretSerialized({serialized_block_hash, serializedIndex}); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 3c5df177679..85a587e24d2 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -753,7 +753,6 @@ void CWallet::SyncMetaData(std::pair ran // fTimeReceivedIsTxTime not copied on purpose // nTimeReceived not copied on purpose copyTo->nTimeSmart = copyFrom->nTimeSmart; - copyTo->fFromMe = copyFrom->fFromMe; // nOrderPos not copied on purpose // cached members not copied on purpose } @@ -2242,7 +2241,6 @@ void CWallet::CommitTransaction(CTransactionRef tx, mapValue_t mapValue, std::ve wtx.mapValue = std::move(mapValue); wtx.vOrderForm = std::move(orderForm); wtx.fTimeReceivedIsTxTime = true; - wtx.fFromMe = true; return true; });