Batch flushing operations to the walletdb during top up and increase keypool size.
Summary: This backport core's PR10831
Test Plan:
make check ./test/functional/test_runner.py --extended
Reviewers: #bitcoin_abc, matiu
Reviewed By: #bitcoin_abc, matiu
Subscribers: matiu, teamcity
Differential Revision: https://reviews.bitcoinabc.org/D1045