Skip to content

init: Take lock on blocks directory in BlockManager ctor

This ensures consistent directory locking for users of the kernel library by disallowing mistakenly creating multiple BlockManagers that might write into the same block or undo files.

The change here makes LockDirectory more strict: It now returns an error even if it is called again on the same directory from the same process. However from the description in https://github.com/bitcoin/bitcoin/pull/12422 , where this feature was introduced, it is not immediately clear what its usage was at the time. Supporting multiple wallets in the same directory is mentioned there, but it is not said why that might be a desirable feature.

Merge request reports

Loading