scheduler: Capture ‘this’ explicitly in lambda
Summary:
Without the changes, g++ will warn to compile under C++20:
scheduler.cpp:114:21: warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Wdeprecated] 114 | scheduleFromNow([=] { Repeat(*this, f, delta); }, delta); | ^ scheduler.cpp:114:21: note: add explicit ‘this’ or ‘*this’ capture
This is a partial backport of core#24169
https://github.com/bitcoin/bitcoin/pull/24169/commits/fae2220f4e48934313389864d3d362f672627eb8
Depends on D15314
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D15315