@@ -43,11 +43,11 @@ struct TxStateInMempool {
43
43
};
44
44
45
45
// ! State of rejected transaction that conflicts with a confirmed block.
46
- struct TxStateConflicted {
46
+ struct TxStateBlockConflicted {
47
47
uint256 conflicting_block_hash;
48
48
int conflicting_block_height;
49
49
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) {}
51
51
std::string toString () const { return strprintf (" Conflicted (block=%s, height=%i)" , conflicting_block_hash.ToString (), conflicting_block_height); }
52
52
};
53
53
@@ -75,7 +75,7 @@ struct TxStateUnrecognized {
75
75
};
76
76
77
77
// ! All possible CWalletTx states
78
- using TxState = std::variant<TxStateConfirmed, TxStateInMempool, TxStateConflicted , TxStateInactive, TxStateUnrecognized>;
78
+ using TxState = std::variant<TxStateConfirmed, TxStateInMempool, TxStateBlockConflicted , TxStateInactive, TxStateUnrecognized>;
79
79
80
80
// ! Subset of states transaction sync logic is implemented to handle.
81
81
using SyncTxState = std::variant<TxStateConfirmed, TxStateInMempool, TxStateInactive>;
@@ -90,7 +90,7 @@ static inline TxState TxStateInterpretSerialized(TxStateUnrecognized data)
90
90
} else if (data.index >= 0 ) {
91
91
return TxStateConfirmed{data.block_hash , /* height=*/ -1 , data.index };
92
92
} else if (data.index == -1 ) {
93
- return TxStateConflicted {data.block_hash , /* height=*/ -1 };
93
+ return TxStateBlockConflicted {data.block_hash , /* height=*/ -1 };
94
94
}
95
95
return data;
96
96
}
@@ -102,7 +102,7 @@ static inline uint256 TxStateSerializedBlockHash(const TxState& state)
102
102
[](const TxStateInactive& inactive) { return inactive.abandoned ? uint256::ONE : uint256::ZERO; },
103
103
[](const TxStateInMempool& in_mempool) { return uint256::ZERO; },
104
104
[](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 ; },
106
106
[](const TxStateUnrecognized& unrecognized) { return unrecognized.block_hash ; }
107
107
}, state);
108
108
}
@@ -114,7 +114,7 @@ static inline int TxStateSerializedIndex(const TxState& state)
114
114
[](const TxStateInactive& inactive) { return inactive.abandoned ? -1 : 0 ; },
115
115
[](const TxStateInMempool& in_mempool) { return 0 ; },
116
116
[](const TxStateConfirmed& confirmed) { return confirmed.position_in_block ; },
117
- [](const TxStateConflicted & conflicted) { return -1 ; },
117
+ [](const TxStateBlockConflicted & conflicted) { return -1 ; },
118
118
[](const TxStateUnrecognized& unrecognized) { return unrecognized.index ; }
119
119
}, state);
120
120
}
@@ -335,9 +335,9 @@ class CWalletTx
335
335
void updateState (interfaces::Chain& chain);
336
336
337
337
bool isAbandoned () const { return state<TxStateInactive>() && state<TxStateInactive>()->abandoned ; }
338
- bool isConflicted () const { return state<TxStateConflicted >(); }
338
+ bool isBlockConflicted () const { return state<TxStateBlockConflicted >(); }
339
339
bool isInactive () const { return state<TxStateInactive>(); }
340
- bool isUnconfirmed () const { return !isAbandoned () && !isConflicted () && !isConfirmed (); }
340
+ bool isUnconfirmed () const { return !isAbandoned () && !isBlockConflicted () && !isConfirmed (); }
341
341
bool isConfirmed () const { return state<TxStateConfirmed>(); }
342
342
const Txid& GetHash () const LIFETIMEBOUND { return tx->GetHash (); }
343
343
const Wtxid& GetWitnessHash () const LIFETIMEBOUND { return tx->GetWitnessHash (); }
0 commit comments