refactor: replace m_last_write with m_next_write
Summary:
Co-Authored-By: l0rinc <pap.lorinc@gmail.com>
This is a partial backport of core#30611
https://github.com/bitcoin/bitcoin/pull/30611/commits/2e2f41068128c38120a5b44d24ee30f71970455a
Depends on D18641
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18642