neo-go/pkg/consensus
Roman Khimov af6a6f5f30 consensus: fix potential system deadlock
There is a notification pushed into the channel when block is being added,
that notification is read by special goroutine that then forwards it to all
subscribers to that particular event. Consensus goroutine is one of that
subscribers, so for the system to properly function it has to read these
events, but at the same time it can generate new blocks inside, so in some
cases it can generate two blocks without ever reading from the subscription
channel and this will lead to a deadlock.

To avoid that we need to check subscription channel for events on every loop.
2020-09-18 10:21:47 +03:00
..
testdata Merge pull request #1169 from nspcc-dev/neo3/rpc/fields_names_adjustment 2020-07-15 18:24:54 +03:00
block.go consensus: replace magic 1000000 with something more meaningful 2020-07-11 19:54:50 +03:00
block_test.go block/transaction: add network magic into the hash 2020-06-18 12:39:50 +03:00
cache.go *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
cache_test.go consensus: added partial message decoding 2020-04-16 14:35:58 +03:00
change_view.go consensus: replace magic 1000000 with something more meaningful 2020-07-11 19:54:50 +03:00
change_view_test.go consensus: replace magic 1000000 with something more meaningful 2020-07-11 19:54:50 +03:00
commit.go *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
commit_test.go random: make use or random package in tests 2020-03-27 10:27:46 +03:00
consensus.go consensus: fix potential system deadlock 2020-09-18 10:21:47 +03:00
consensus_test.go consensus: add verifyBlock tests 2020-08-20 18:50:36 +03:00
crypto.go *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
crypto_test.go *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
payload.go crypto/consensus: sign hashes and cache them for consensus payloads 2020-09-09 20:46:31 +03:00
payload_test.go crypto/consensus: sign hashes and cache them for consensus payloads 2020-09-09 20:46:31 +03:00
prepare_request.go consensus: replace magic 1000000 with something more meaningful 2020-07-11 19:54:50 +03:00
prepare_request_test.go consensus: drop NextConsensus from the prepareRequest 2020-07-11 19:54:50 +03:00
prepare_response.go *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
prepare_response_test.go *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
recovery_message.go consensus: switch to uint8 for validator index 2020-08-23 16:44:56 +03:00
recovery_message_test.go crypto/consensus: sign hashes and cache them for consensus payloads 2020-09-09 20:46:31 +03:00
recovery_request.go consensus: replace magic 1000000 with something more meaningful 2020-07-11 19:54:50 +03:00
recovery_request_test.go consensus: replace magic 1000000 with something more meaningful 2020-07-11 19:54:50 +03:00