Skip to content

Commit

Permalink
Only save indexes if turned on
Browse files Browse the repository at this point in the history
  • Loading branch information
fireduck64 committed Sep 24, 2019
1 parent 6346613 commit 9e30b87
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions node/src/BlockIngestor.java
Expand Up @@ -243,10 +243,10 @@ public boolean ingestBlock(Block blk)
u.tickleBlocks();
}
node.getMemPool().tickleBlocks(new ChainHash(summary.getHeader().getUtxoRootHash()));
node.getPeerage().sendAllTips();
}


node.getPeerage().sendAllTips();
}

if (block_log != null)
Expand Down Expand Up @@ -276,10 +276,16 @@ private BlockSummary saveOtherChainIndexBits(BlockSummary summary_current, Block


// Block to TX index
TransactionMapUtil.saveTransactionMap(blk, update_map);
if (tx_index)
{
TransactionMapUtil.saveTransactionMap(blk, update_map);
}

// Address to TX List
AddressHistoryUtil.saveAddressHistory(blk, update_map);
if (addr_index)
{
AddressHistoryUtil.saveAddressHistory(blk, update_map);
}

ByteString new_hash_root = node.getDB().getChainIndexTrie().mergeBatch(
summary_prev.getChainIndexTrieHash(), update_map);
Expand Down

0 comments on commit 9e30b87

Please sign in to comment.