Skip to content

Commit

Permalink
fix(node): fix some logging
Browse files Browse the repository at this point in the history
benchmark and negative fee are too verbose
  • Loading branch information
micahriggan committed Dec 22, 2018
1 parent d8dea8b commit da5ede5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/bitcore-node/src/models/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class Transaction extends BaseModel<ITransaction> {
// TODO: Fee is negative for mempool txs
fee = groupedSpends[txid].total - groupedMints[txid].total;
if (fee < 0) {
console.error(txid, groupedSpends[txid], groupedMints[txid]);
logger.debug('negative fee', txid, groupedSpends[txid], groupedMints[txid]);
}
}

Expand Down
4 changes: 3 additions & 1 deletion packages/bitcore-node/test/benchmark/benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ function startBenchmarkDatabase() {
async function benchmark(blockCount: number, blockSizeMb: number) {
await resetDatabase();
const startTime = new Date();
console.log('Adding blocks');
for (let block of generateBlocks(blockCount, blockSizeMb)) {
console.log('Adding block', block.hash);
process.stdout.write('.');
await BlockModel.addBlock({ block, chain: 'BENCH', network: 'MARK', initialSyncComplete: false });
}
process.stdout.write('\n');
const endTime = new Date();
const time = endTime.getTime() - startTime.getTime();
const seconds = time / 1000;
Expand Down

0 comments on commit da5ede5

Please sign in to comment.