diff options
author | W. J. van der Laan <laanwj@protonmail.com> | 2021-09-16 16:53:47 +0200 |
---|---|---|
committer | W. J. van der Laan <laanwj@protonmail.com> | 2021-09-16 17:00:54 +0200 |
commit | cdf12c7b3d713e5b92e8631657cb4c666b4d27d4 (patch) | |
tree | 83f39054a5bcaaddffadd6bbea0c7c14333d8d52 /.github | |
parent | 58e02395bad59359cc0210f2ab633d0a82827ba4 (diff) | |
parent | 350e034e64d175f3db4c85ddca42e76e279912f6 (diff) |
Merge bitcoin/bitcoin#22895: consensus: don't call GetBlockPos in ReadBlockFromDisk without cs_main lock
350e034e64d175f3db4c85ddca42e76e279912f6 consensus: don't call GetBlockPos in ReadBlockFromDisk without lock (Jon Atack)
Pull request description:
Commit ccd8ef65 "Reduce cs_main lock in ReadBlockFromDisk, only read GetBlockPos under the lock" in #11281 moved the cs_main lock from caller to `ReadBlockFromDisk()` for calling `CBlockIndex::GetBlockPos()`, but the second invocation doesn't have the lock, and IIUC there is no guarantee the compiler can know if state has changed.
Use the `blockPos` local variable instead, rename it to `block_pos`, and make it const.
ACKs for top commit:
laanwj:
Code review ACK 350e034e64d175f3db4c85ddca42e76e279912f6
theStack:
Code-review ACK 350e034e64d175f3db4c85ddca42e76e279912f6
promag:
Code review ACK 350e034e64d175f3db4c85ddca42e76e279912f6.
Tree-SHA512: 0df0614ab1876885c85f7b53c604a759a29008da8027e95503b4726d2b820ec6d27546020c613337ff954406e01cb5d191978ba4a12124052fed6e1b0e9a226f
Diffstat (limited to '.github')
0 files changed, 0 insertions, 0 deletions