1
0

util.CallbackManager: use sets instead of lists

- to gracefully take duplicate calls of register_callbacks(): should be idempotent now
- as a side-effect, the order of the callbacks is changed and not guaranteed
  - not like anyone should have been relying on it before though
This commit is contained in:
SomberNight
2026-01-20 16:07:14 +00:00
parent 57b26ba473
commit 50b10284ac
2 changed files with 10 additions and 6 deletions

View File

@@ -49,13 +49,13 @@ class TestCallbackMgr(ElectrumTestCase):
el2.start()
self.assertEqual(4, _count_all_callbacks())
el1.start()
self.assertEqual(6, _count_all_callbacks())
el1.stop()
self.assertEqual(4, _count_all_callbacks())
el1.stop()
self.assertEqual(2, _count_all_callbacks())
el1.stop()
self.assertEqual(2, _count_all_callbacks())
el1.stop()
self.assertEqual(2, _count_all_callbacks())
el2.stop()
self.assertEqual(0, _count_all_callbacks())