Page MenuHomePhabricator

Simplify and fix notifier removal on error.
ClosedPublic

Authored by PiRK on Fri, Oct 8, 11:57.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC9a008904eed3: Simplify and fix notifier removal on error.
Summary

This factors out the common logic to run over all ZMQ notifiers, call a
function on them, and remove them from the list if the function fails is
extracted to a helper method.

Note that this also fixes a potential memory leak: When a notifier was
removed previously after its callback returned false, it would just be
removed from the list without destructing the object. This is now done
correctly by std::unique_ptr behind the scenes.

This is a backport of core#13686 [2/5]
https://github.com/bitcoin/bitcoin/pull/13686/commits/b93b9d54569145bfcec6cee10968284fe05fe254

Depends on D10282

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable