oxen-core/src/cryptonote_protocol
Jason Rhinelander 0cd096fc22 Fix rare blink pool deadlock
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.
2020-01-18 22:29:26 -04:00
..
block_queue.cpp Optimizations and simplifications 2019-08-11 22:35:00 -03:00
block_queue.h Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
CMakeLists.txt Split up huge instanciations & header fixes 2019-12-03 00:51:18 -04:00
core_protocol_instantiation.cpp Split up huge instanciations & header fixes 2019-12-03 00:51:18 -04:00
cryptonote_protocol_defs.h Remove pre-HF14 p2p vote relaying command 2020-01-18 12:12:29 -04:00
cryptonote_protocol_handler.h Remove pre-HF14 p2p vote relaying command 2020-01-18 12:12:29 -04:00
cryptonote_protocol_handler.inl Remove pre-HF14 p2p vote relaying command 2020-01-18 12:12:29 -04:00
cryptonote_protocol_handler_common.h Remove pre-HF14 p2p vote relaying command 2020-01-18 12:12:29 -04:00
p2p_net_node_instantiation.cpp Split up huge instanciations & header fixes 2019-12-03 00:51:18 -04:00
quorumnet.cpp Fix rare blink pool deadlock 2020-01-18 22:29:26 -04:00
quorumnet.h Blink WIP 2019-11-27 14:07:52 -04:00