Skip to content

Commit

Permalink
Fix DAO synchronization text after restore from seed
Browse files Browse the repository at this point in the history
After restoring from seed, the text shown under DAO /
BSQ Wallet / Transactions displays an incorrect progress - the numbers
are swapped. For example:
"Awaiting blocks... Verified 575,868 blocks out of 554,857"

Normally we get the latest block height from BitcoinJ as the
target height, and we request BSQ blocks from seed nodes up to latest
block.

But when restoring from seed, we receive the latest block height
from the seed nodes while BitcoinJ has not received all blocks yet and
is still syncing.

Fixes bisq-network#2825
  • Loading branch information
devinbileck committed May 16, 2019
1 parent cf9dc0d commit f0fc836
Showing 1 changed file with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,23 @@ private void onUpdateAnyChainHeight() {
chainSyncIndicator.setManaged(!synced);
if (synced) {
chainHeightLabel.setText(Res.get("dao.wallet.chainHeightSynced",
currentBlockHeight,
walletChainHeight));
currentBlockHeight));
} else {
chainSyncIndicator.setProgress(progress);
chainHeightLabel.setText(Res.get("dao.wallet.chainHeightSyncing",
currentBlockHeight,
walletChainHeight));
if (walletChainHeight > currentBlockHeight) {
// Normally we get the latest block height from BitcoinJ as the target height,
// and we request BSQ blocks from seed nodes up to latest block
chainHeightLabel.setText(Res.get("dao.wallet.chainHeightSyncing",
currentBlockHeight,
walletChainHeight));
} else {
// But when restoring from seed, we receive the latest block height
// from the seed nodes while BitcoinJ has not received all blocks yet and
// is still syncing
chainHeightLabel.setText(Res.get("dao.wallet.chainHeightSyncing",
walletChainHeight,
currentBlockHeight));
}
}
} else {
chainHeightLabel.setText(Res.get("dao.wallet.chainHeightSyncing",
Expand Down

0 comments on commit f0fc836

Please sign in to comment.