@@ -43,11 +43,11 @@ struct TxStateInMempool {
4343};
4444
4545// ! State of rejected transaction that conflicts with a confirmed block.
46- struct TxStateConflicted {
46+ struct TxStateBlockConflicted {
4747 uint256 conflicting_block_hash;
4848 int conflicting_block_height;
4949
50- explicit TxStateConflicted (const uint256& block_hash, int height) : conflicting_block_hash(block_hash), conflicting_block_height(height) {}
50+ explicit TxStateBlockConflicted (const uint256& block_hash, int height) : conflicting_block_hash(block_hash), conflicting_block_height(height) {}
5151 std::string toString () const { return strprintf (" Conflicted (block=%s, height=%i)" , conflicting_block_hash.ToString (), conflicting_block_height); }
5252};
5353
@@ -75,7 +75,7 @@ struct TxStateUnrecognized {
7575};
7676
7777// ! All possible CWalletTx states
78- using TxState = std::variant<TxStateConfirmed, TxStateInMempool, TxStateConflicted , TxStateInactive, TxStateUnrecognized>;
78+ using TxState = std::variant<TxStateConfirmed, TxStateInMempool, TxStateBlockConflicted , TxStateInactive, TxStateUnrecognized>;
7979
8080// ! Subset of states transaction sync logic is implemented to handle.
8181using SyncTxState = std::variant<TxStateConfirmed, TxStateInMempool, TxStateInactive>;
@@ -90,7 +90,7 @@ static inline TxState TxStateInterpretSerialized(TxStateUnrecognized data)
9090 } else if (data.index >= 0 ) {
9191 return TxStateConfirmed{data.block_hash , /* height=*/ -1 , data.index };
9292 } else if (data.index == -1 ) {
93- return TxStateConflicted {data.block_hash , /* height=*/ -1 };
93+ return TxStateBlockConflicted {data.block_hash , /* height=*/ -1 };
9494 }
9595 return data;
9696}
@@ -102,7 +102,7 @@ static inline uint256 TxStateSerializedBlockHash(const TxState& state)
102102 [](const TxStateInactive& inactive) { return inactive.abandoned ? uint256::ONE : uint256::ZERO; },
103103 [](const TxStateInMempool& in_mempool) { return uint256::ZERO; },
104104 [](const TxStateConfirmed& confirmed) { return confirmed.confirmed_block_hash ; },
105- [](const TxStateConflicted & conflicted) { return conflicted.conflicting_block_hash ; },
105+ [](const TxStateBlockConflicted & conflicted) { return conflicted.conflicting_block_hash ; },
106106 [](const TxStateUnrecognized& unrecognized) { return unrecognized.block_hash ; }
107107 }, state);
108108}
@@ -114,7 +114,7 @@ static inline int TxStateSerializedIndex(const TxState& state)
114114 [](const TxStateInactive& inactive) { return inactive.abandoned ? -1 : 0 ; },
115115 [](const TxStateInMempool& in_mempool) { return 0 ; },
116116 [](const TxStateConfirmed& confirmed) { return confirmed.position_in_block ; },
117- [](const TxStateConflicted & conflicted) { return -1 ; },
117+ [](const TxStateBlockConflicted & conflicted) { return -1 ; },
118118 [](const TxStateUnrecognized& unrecognized) { return unrecognized.index ; }
119119 }, state);
120120}
@@ -335,9 +335,9 @@ class CWalletTx
335335 void updateState (interfaces::Chain& chain);
336336
337337 bool isAbandoned () const { return state<TxStateInactive>() && state<TxStateInactive>()->abandoned ; }
338- bool isConflicted () const { return state<TxStateConflicted >(); }
338+ bool isBlockConflicted () const { return state<TxStateBlockConflicted >(); }
339339 bool isInactive () const { return state<TxStateInactive>(); }
340- bool isUnconfirmed () const { return !isAbandoned () && !isConflicted () && !isConfirmed (); }
340+ bool isUnconfirmed () const { return !isAbandoned () && !isBlockConflicted () && !isConfirmed (); }
341341 bool isConfirmed () const { return state<TxStateConfirmed>(); }
342342 const Txid& GetHash () const LIFETIMEBOUND { return tx->GetHash (); }
343343 const Wtxid& GetWitnessHash () const LIFETIMEBOUND { return tx->GetWitnessHash (); }
0 commit comments