Skip to content

Conversation

@catbref
Copy link
Collaborator

@catbref catbref commented Sep 26, 2018

No description provided.

… leaving DB with two blocks at the same height.

Changed BlockGenerator to repeatedly try to sync instead just one attempt, in case the syncing attempt
fails due to ping timeout, etc. This also stops BlockGenerator from incorrectly changing status from syncing to OK.

Controller no longer allows new blocks to forged if we're still syncing and nowhere near up to date.

Added thread names to ConnectionCreator and ConnectionAcceptor.

Don't process new incoming block if we're synchronizing!

Fixed unnecessary error output when calling /blocks/byheight/{height} with a height that doesn't exist

Attempt to avoid networking deadlock

The networking layer can deadlock while processing an error condition,
typically Controller, some ArrayList (e.g. Network.connectedPeers) and
something else are all locked.

One of these cases is where a peer's Pinger object is trying to join()
after a ping failure, but can't because Network.connectedPeers is locked.

To ease this case, when Pinger.stopPing() is called, don't bother to
call join() after interrupt(). Waiting for the Pinger to exit isn't
needed.

No longer checks block signatures on arrival from peer as blocks
may arrive out-of-order and depend on processing of previous blocks.
(Checking will happen on in-order processing).

In Controller.onDisconnect(), notifying observers now done outside of synchronized(this.peerHeight)
to reduce deadlocks.

Resend unconfirmed transactions on a new node connects

When node receives a new block, it broadcasts new block to all peers except original sender.

All peers except sender learn node's blockchain height, but sender does not.
So now node's height is sent to sender (only height, not actual new block).

synchronization: after a round of synchronization, a peer will broadcast its new height

If remote peer sends new block but we have it already as blockchain tip,
then still update our peer DB to reflect remote peer's new height.

Send our height to random peer every 30 seconds instead of 5 minutes.

Better checking of deleted entries from forked DBMaps.
Generic code in DBMap classes to handle byte[] keys.

Bumped version!
…rly exit.

For example, sending a signal to the JVM process[*] triggers JVM shutdown hook,
which in turn calls Controller.stopAll().
Controller.stopAll calls ClosingDialog.getInstance() which also calls Controller.stopAll().

Previously the 2nd call would return quickly causing System.exit() to be called while the 1st
call is still closing the database.

Now, with the synchronized() block, all subsequent calls wait until the 1st is done and then all
exit quickly.

[*] Signal could be sent during O/S shutdown which is harder to notice
@catbref catbref merged commit e0a3a5b into Qoracoin:master Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant