Fix navigation issue. adjust logging.

This commit is contained in:
Manfred Karrer 2017-06-26 20:12:15 +02:00
parent 61b9766052
commit 724615b4ad
2 changed files with 8 additions and 11 deletions

View File

@ -77,7 +77,7 @@ public class BsqParser {
int genesisBlockHeight,
String genesisTxId) {
int blockHeight = bsqBlock.getHeight();
log.debug("Parse block at height={} ", blockHeight);
log.info("Parse block at height={} ", blockHeight);
List<Tx> txList = new ArrayList<>(bsqBlock.getTxs());
List<Tx> bsqTxsInBlock = new ArrayList<>();
bsqBlock.getTxs().stream()
@ -111,7 +111,7 @@ public class BsqParser {
bsqChainState.addBlock(bsqBlock);
newBlockHandler.accept(bsqBlock);
log.debug("parseBlock took {} ms at blockHeight {}; bsqTxsInBlock.size={}",
log.info("parseBlock took {} ms at blockHeight {}; bsqTxsInBlock.size={}",
System.currentTimeMillis() - startTs, blockHeight, bsqTxsInBlock.size());
}
} catch (BlockNotConnectingException e) {
@ -127,6 +127,7 @@ public class BsqParser {
int genesisBlockHeight,
String genesisTxId)
throws BsqBlockchainException {
int blockHeight = btcdBlock.getHeight();
log.debug("Parse block at height={} ", blockHeight);
@ -135,12 +136,14 @@ public class BsqParser {
// We use a list as we want to maintain sorting of tx intra-block dependency
List<Tx> bsqTxsInBlock = new ArrayList<>();
// We add all transactions to the block
long startTs = System.currentTimeMillis();
for (String txId : btcdBlock.getTx()) {
final Tx tx = rpcService.requestTransaction(txId, blockHeight);
txList.add(tx);
checkForGenesisTx(genesisBlockHeight, genesisTxId, blockHeight, bsqTxsInBlock, tx);
}
log.info("Requesting {} transactions took {} ms",
btcdBlock.getTx().size(), System.currentTimeMillis() - startTs);
// Worst case is that all txs in a block are depending on another, so only one get resolved at each iteration.
// Min tx size is 189 bytes (normally about 240 bytes), 1 MB can contain max. about 5300 txs (usually 2000).
// Realistically we don't expect more then a few recursive calls.

View File

@ -74,10 +74,7 @@ public class DaoView extends ActivatableViewAndModel<TabPane, Activatable> {
if (viewPath.size() == 3 && viewPath.indexOf(DaoView.class) == 1) {
if (compensationTab == null && viewPath.get(2).equals(BsqWalletView.class))
//noinspection unchecked
if (DevEnv.DAO_ACTIVATED)
navigation.navigateTo(MainView.class, DaoView.class, BsqWalletView.class);
else
navigation.navigateTo(MainView.class, DaoView.class, BsqWalletView.class, BsqDashboardView.class);
navigation.navigateTo(MainView.class, DaoView.class, BsqWalletView.class);
else
loadView(viewPath.tip());
}
@ -111,10 +108,7 @@ public class DaoView extends ActivatableViewAndModel<TabPane, Activatable> {
Tab selectedItem = root.getSelectionModel().getSelectedItem();
if (selectedItem == bsqWalletTab)
//noinspection unchecked
if (DevEnv.DAO_ACTIVATED)
navigation.navigateTo(MainView.class, DaoView.class, BsqWalletView.class);
else
navigation.navigateTo(MainView.class, DaoView.class, BsqWalletView.class, BsqDashboardView.class);
navigation.navigateTo(MainView.class, DaoView.class, BsqWalletView.class);
else if (selectedItem == compensationTab)
//noinspection unchecked
navigation.navigateTo(MainView.class, DaoView.class, CompensationView.class);