1 // Copyright (c) 2023-present The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 5 #ifndef BITCOIN_KERNEL_CS_MAIN_H
6 #define BITCOIN_KERNEL_CS_MAIN_H
7 8 #include <sync.h>
9 10 /**
11 * Mutex to guard access to validation specific variables, such as reading
12 * or changing the chainstate.
13 *
14 * This may also need to be locked when updating the transaction pool, e.g. on
15 * AcceptToMemoryPool. See CTxMemPool::cs comment for details.
16 *
17 * The transaction pool has a separate lock to allow reading from it and the
18 * chainstate at the same time.
19 */
20 extern RecursiveMutex cs_main;
21 22 #endif // BITCOIN_KERNEL_CS_MAIN_H
23