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() {
|
Block.prototype.getWitnessNonce = function getWitnessNonce() {
|
||||||
var coinbase = this.txs[0];
|
var coinbase, input;
|
||||||
var input;
|
|
||||||
|
|
||||||
if (!coinbase)
|
if (this.txs.length === 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
coinbase = this.txs[0];
|
||||||
|
|
||||||
if (coinbase.inputs.length !== 1)
|
if (coinbase.inputs.length !== 1)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@ -394,12 +395,13 @@ Block.prototype.getWitnessNonce = function getWitnessNonce() {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Block.prototype.getCommitmentHash = function getCommitmentHash(enc) {
|
Block.prototype.getCommitmentHash = function getCommitmentHash(enc) {
|
||||||
var coinbase = this.txs[0];
|
var i, coinbase, hash, output;
|
||||||
var i, hash, output;
|
|
||||||
|
|
||||||
if (!coinbase)
|
if (this.txs.length === 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
coinbase = this.txs[0];
|
||||||
|
|
||||||
for (i = coinbase.outputs.length - 1; i >= 0; i--) {
|
for (i = coinbase.outputs.length - 1; i >= 0; i--) {
|
||||||
output = coinbase.outputs[i];
|
output = coinbase.outputs[i];
|
||||||
if (output.script.isCommitment()) {
|
if (output.script.isCommitment()) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user