Decoupled from #27607.
Fixed a potential race condition in master (not possible so far) that could become an actual issue soon.
Where the index’s CustomAppend
method could be called (from BlockConnected
) before its
CustomInit
method, causing the index to try to update itself before it is initialized.
This could happen because we set the index m_synced
flag (which enables BlockConnected
events)
before calling to the child class init function (CustomInit
). So, for example, the block filter index could
process a block before initialize the next filter position field and end up overwriting the first stored filter.
This race was introduced in https://github.com/bitcoin/bitcoin/commit/bef4e405f3de2718dfee279a9abff4daf016da26 from #25494.