mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
0cd096fc22
cryptonote_protocol_handler calls `pool.get_blink(hash)` while already holding a blink shared lock, which should have been `pool.get_blink(hash, true)` to avoid `get_blink` trying to take its own lock. That double lock is undefined behaviour and can cause a deadlock on the mutex, although it appears rare that it actually does. If it does, however, this eventually backs up into vote relaying during the idle loop, which then stalls the idle loop so we stop sending out uptime proofs (since that is also in the idle loop). A simple fix here is to add the `true` argument, but on reconsideration this extra argument to take or not take a lock is messy and error prone, so this commit instead removes the second argument entirely and instead documents which call must and must not hold a lock, getting rid of the three methods (get_blink, has_blink, and add_existing_blink) that had the `have_lock` argument. This ends up having only a small impact on calling code - the vast majority of callers already hold a lock, and the few that don't are easily adjusted. |
||
---|---|---|
.. | ||
blockchain_db | ||
blockchain_utilities | ||
blocks | ||
checkpoints | ||
common | ||
crypto | ||
cryptonote_basic | ||
cryptonote_core | ||
cryptonote_protocol | ||
daemon | ||
daemonizer | ||
debug_utilities | ||
device | ||
device_trezor | ||
gen_multisig | ||
lmdb | ||
mnemonics | ||
multisig | ||
net | ||
p2p | ||
platform | ||
quorumnet | ||
ringct | ||
rpc | ||
serialization | ||
simplewallet | ||
wallet | ||
CMakeLists.txt | ||
cryptonote_config.h | ||
version.cpp.in | ||
version.h |