fix commit hash caching. fix miner race conditon.
This commit is contained in:
parent
b0c36d51dc
commit
a09c7365aa
@ -339,16 +339,15 @@ Block.prototype.__defineGetter__('commitmentHash', function() {
|
||||
commitment = coinbase.outputs[i].script;
|
||||
if (commitment.isCommitment()) {
|
||||
commitmentHash = commitment.getCommitmentHash();
|
||||
commitmentHash = commitmentHash.toString('hex');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.mutable) {
|
||||
if (commitmentHash)
|
||||
this._commitmentHash = commitmentHash.toString('hex');
|
||||
}
|
||||
if (!this.mutable)
|
||||
this._commitmentHash = commitmentHash;
|
||||
|
||||
return this._commitmentHash;
|
||||
return commitmentHash;
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@ -100,13 +100,15 @@ Miner.prototype._init = function _init() {
|
||||
this.mempool.on('tx', function(tx) {
|
||||
if (!self.running)
|
||||
return;
|
||||
self.attempt.addTX(tx);
|
||||
if (self.attempt)
|
||||
self.attempt.addTX(tx);
|
||||
});
|
||||
} else if (this.pool) {
|
||||
this.pool.on('tx', function(tx) {
|
||||
if (!self.running)
|
||||
return;
|
||||
self.attempt.addTX(tx);
|
||||
if (self.attempt)
|
||||
self.attempt.addTX(tx);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user