Merge #10126: Compensate for memory peak at flush time
Summary:
7228ce8 Compensate for memory peak at flush time (Pieter Wuille)
Tree-SHA512: 97e9848410fab061402c85d8440c54a50dd8a0203b2ea194013ea116700a6dc1b4b26b8c5f9c9c68c1f5c6b935c5d6c737437c1911b003d9ff5445c570cd449d
Backport of Core PR10126
https://github.com/bitcoin/bitcoin/pull/10126/files
Test Plan:
make check
test_runner.py
Reviewers: deadalnix, Fabien, #bitcoin_abc, markblundeberg
Reviewed By: #bitcoin_abc, markblundeberg
Subscribers: markblundeberg
Differential Revision: https://reviews.bitcoinabc.org/D2999