fix commitment hash checking.
This commit is contained in:
parent
799c4a8d6e
commit
4f715d86c7
@ -353,18 +353,19 @@ Block.prototype.__defineGetter__('commitmentHash', function() {
|
|||||||
if (!coinbase)
|
if (!coinbase)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < coinbase.outputs.length; i++) {
|
for (i = coinbase.outputs.length - 1; i >= 0; i--) {
|
||||||
commitment = coinbase.outputs[i].script;
|
commitment = coinbase.outputs[i].script;
|
||||||
if (commitment.isCommitment()) {
|
if (commitment.isCommitment()) {
|
||||||
commitmentHash = commitment.getCommitmentHash();
|
commitmentHash = commitment.getCommitmentHash();
|
||||||
commitmentHash = commitmentHash.toString('hex');
|
commitmentHash = commitmentHash.toString('hex');
|
||||||
|
|
||||||
|
if (!this.mutable)
|
||||||
|
this._commitmentHash = commitmentHash;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.mutable)
|
|
||||||
this._commitmentHash = commitmentHash;
|
|
||||||
|
|
||||||
return commitmentHash;
|
return commitmentHash;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user