miner: log block creation.

This commit is contained in:
Christopher Jeffrey 2017-02-26 23:06:43 -08:00
parent 2d9f96d86b
commit 0a8228b3f4
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -12,6 +12,7 @@ var util = require('../utils/util');
var co = require('../utils/co');
var Heap = require('../utils/heap');
var AsyncObject = require('../utils/asyncobject');
var Amount = require('../btc/amount');
var Address = require('../primitives/address');
var MinerBlock = require('./minerblock');
var Network = require('../protocol/network');
@ -470,6 +471,13 @@ Miner.prototype.build = function build(attempt) {
attempt.refresh();
this.logger.debug(
'Created miner block (height=%d, weight=%d, fees=%d, txs=%s).',
attempt.height,
attempt.weight,
Amount.btc(attempt.fees),
attempt.items.length + 1);
assert(block.getWeight() <= attempt.weight,
'Block exceeds reserved weight!');
assert(block.getBaseSize() <= consensus.MAX_BLOCK_SIZE,