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
811811 class ChangeSet {
812812 public:
813813 explicit ChangeSet (CTxMemPool* pool) : m_pool(pool) {}
814- ~ChangeSet () = default ;
814+ ~ChangeSet () EXCLUSIVE_LOCKS_REQUIRED(m_pool->cs) { m_pool-> m_have_changeset = false ; }
815815
816816 ChangeSet (const ChangeSet&) = delete ;
817817 ChangeSet& operator =(const ChangeSet&) = delete ;
@@ -860,7 +860,13 @@ class CTxMemPool
860860 friend class CTxMemPool ;
861861 };
862862
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 };
864870
865871 friend class CTxMemPool ::ChangeSet;
866872
You can’t perform that action at this time.
0 commit comments