diff options
author | Andrew Chow <github@achow101.com> | 2023-05-31 13:45:22 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2023-05-31 13:56:28 -0400 |
commit | 3a83d4417b35cb0173286b6da97315be861901bc (patch) | |
tree | 8aeff27622b62ffe07e148c73a47704385a86310 /test | |
parent | f08bde7f715cf84ef050c3f6902bc75fb90cedb3 (diff) | |
parent | 3126454dcfa1dd29bb66500d5f2b5261684d6c58 (diff) |
Merge bitcoin/bitcoin#27720: index: prevent race by calling 'CustomInit' prior setting 'synced' flag
3126454dcfa1dd29bb66500d5f2b5261684d6c58 index: prevent race by calling 'CustomInit' prior setting 'synced' flag (furszy)
Pull request description:
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 https://github.com/bitcoin/bitcoin/pull/25494.
ACKs for top commit:
achow101:
ACK 3126454dcfa1dd29bb66500d5f2b5261684d6c58
mzumsande:
Code review ACK 3126454dcfa1dd29bb66500d5f2b5261684d6c58
TheCharlatan:
Nice, ACK 3126454dcfa1dd29bb66500d5f2b5261684d6c58
Tree-SHA512: 7a53fed1d2035cb4c1f331d6ee9f92d499b6cbb618ea534c6440f5a45ff9b3ac4dcff5fb4b88937f45a0be249e3a9c6dc6c3ac77180f12ae25fc56856ba39735
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions