@@ -162,20 +162,19 @@ struct CCoinsCacheEntry
162
162
// ! Adding a flag also requires a self reference to the pair that contains
163
163
// ! this entry in the CCoinsCache map and a reference to the sentinel of the
164
164
// ! flagged pair linked list.
165
- void AddFlags (uint8_t flags, CoinsCachePair& pair, CoinsCachePair& sentinel) noexcept
165
+ static void AddFlags (uint8_t flags, CoinsCachePair& pair, CoinsCachePair& sentinel) noexcept
166
166
{
167
167
Assume (flags & (DIRTY | FRESH));
168
- Assume (&pair.second == this );
169
- if (!m_flags) {
170
- m_prev = sentinel.second .m_prev ;
171
- m_next = &sentinel;
168
+ if (!pair.second .m_flags ) {
169
+ pair.second .m_prev = sentinel.second .m_prev ;
170
+ pair.second .m_next = &sentinel;
172
171
sentinel.second .m_prev = &pair;
173
- m_prev->second .m_next = &pair;
172
+ pair. second . m_prev ->second .m_next = &pair;
174
173
}
175
- m_flags |= flags;
174
+ pair. second . m_flags |= flags;
176
175
}
177
- static void SetDirty (CoinsCachePair& pair, CoinsCachePair& sentinel) noexcept { pair. second . AddFlags (DIRTY, pair, sentinel); }
178
- static void SetFresh (CoinsCachePair& pair, CoinsCachePair& sentinel) noexcept { pair. second . AddFlags (FRESH, pair, sentinel); }
176
+ static void SetDirty (CoinsCachePair& pair, CoinsCachePair& sentinel) noexcept { AddFlags (DIRTY, pair, sentinel); }
177
+ static void SetFresh (CoinsCachePair& pair, CoinsCachePair& sentinel) noexcept { AddFlags (FRESH, pair, sentinel); }
179
178
180
179
void SetClean () noexcept
181
180
{
0 commit comments