block: minor.
This commit is contained in:
parent
e9d87dcd98
commit
60ff33bdb2
@ -366,12 +366,13 @@ Block.prototype.getMerkleRoot = function getMerkleRoot(enc) {
|
||||
*/
|
||||
|
||||
Block.prototype.getWitnessNonce = function getWitnessNonce() {
|
||||
var coinbase = this.txs[0];
|
||||
var input;
|
||||
var coinbase, input;
|
||||
|
||||
if (!coinbase)
|
||||
if (this.txs.length === 0)
|
||||
return null;
|
||||
|
||||
coinbase = this.txs[0];
|
||||
|
||||
if (coinbase.inputs.length !== 1)
|
||||
return null;
|
||||
|
||||
@ -394,12 +395,13 @@ Block.prototype.getWitnessNonce = function getWitnessNonce() {
|
||||
*/
|
||||
|
||||
Block.prototype.getCommitmentHash = function getCommitmentHash(enc) {
|
||||
var coinbase = this.txs[0];
|
||||
var i, hash, output;
|
||||
var i, coinbase, hash, output;
|
||||
|
||||
if (!coinbase)
|
||||
if (this.txs.length === 0)
|
||||
return null;
|
||||
|
||||
coinbase = this.txs[0];
|
||||
|
||||
for (i = coinbase.outputs.length - 1; i >= 0; i--) {
|
||||
output = coinbase.outputs[i];
|
||||
if (output.script.isCommitment()) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user