File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -811,7 +811,7 @@ class CTxMemPool
811
811
class ChangeSet {
812
812
public:
813
813
explicit ChangeSet (CTxMemPool* pool) : m_pool(pool) {}
814
- ~ChangeSet () = default ;
814
+ ~ChangeSet () EXCLUSIVE_LOCKS_REQUIRED(m_pool->cs) { m_pool-> m_have_changeset = false ; }
815
815
816
816
ChangeSet (const ChangeSet&) = delete ;
817
817
ChangeSet& operator =(const ChangeSet&) = delete ;
@@ -860,7 +860,13 @@ class CTxMemPool
860
860
friend class CTxMemPool ;
861
861
};
862
862
863
- std::unique_ptr<ChangeSet> GetChangeSet () EXCLUSIVE_LOCKS_REQUIRED(cs) { return std::make_unique<ChangeSet>(this ); }
863
+ std::unique_ptr<ChangeSet> GetChangeSet () EXCLUSIVE_LOCKS_REQUIRED(cs) {
864
+ Assume (!m_have_changeset);
865
+ m_have_changeset = true ;
866
+ return std::make_unique<ChangeSet>(this );
867
+ }
868
+
869
+ bool m_have_changeset GUARDED_BY (cs){false };
864
870
865
871
friend class CTxMemPool ::ChangeSet;
866
872
You can’t perform that action at this time.
0 commit comments