more fixes. cleanup debugging.
This commit is contained in:
parent
0e3aa32677
commit
8a8b664061
@ -660,12 +660,6 @@ Chain.prototype._checkInputs = function _checkInputs(block, prev, flags, callbac
|
||||
var i, j, input, hash;
|
||||
var sigops = 0;
|
||||
|
||||
// utils.print(height);
|
||||
// utils.print(block.commitmentHash ? utils.revHex(block.commitmentHash) : null);
|
||||
// utils.print(utils.revHex(block.getCommitmentHash() || '00'));
|
||||
// utils.print(block.txs[0]);
|
||||
// utils.print(block.txs[1]);
|
||||
|
||||
if (err)
|
||||
return callback(err);
|
||||
|
||||
@ -711,9 +705,6 @@ Chain.prototype._checkInputs = function _checkInputs(block, prev, flags, callbac
|
||||
throw new Error('BUG: Bad inputs in historical data!');
|
||||
return callback(null, false);
|
||||
}
|
||||
|
||||
if (input.output.getType() === 'scripthash')
|
||||
utils.debug(tx);
|
||||
}
|
||||
|
||||
if (!scriptCheck)
|
||||
|
||||
@ -294,7 +294,7 @@ exports.flags = {
|
||||
VERIFY_CLEANSTACK: (1 << 8),
|
||||
VERIFY_CHECKLOCKTIMEVERIFY: (1 << 9),
|
||||
VERIFY_WITNESS: (1 << 10),
|
||||
VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM: (1 << 9)
|
||||
VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM: (1 << 11)
|
||||
};
|
||||
|
||||
// Block validation
|
||||
|
||||
@ -462,13 +462,8 @@ script.verifyProgram = function verifyProgram(witness, output, tx, i, flags) {
|
||||
return false;
|
||||
}
|
||||
|
||||
utils.debug(bcoin.script.format(stack));
|
||||
utils.debug(bcoin.script.format(redeem));
|
||||
|
||||
res = script.execute(redeem, stack, tx, i, flags, 1);
|
||||
|
||||
utils.debug(bcoin.script.format(stack));
|
||||
|
||||
// Verify the script did not fail as well as the stack values
|
||||
if (!res || stack.length === 0 || !script.bool(stack.pop()))
|
||||
return false;
|
||||
|
||||
@ -131,12 +131,14 @@ TX.prototype.witnessHash = function witnessHash(enc) {
|
||||
};
|
||||
|
||||
TX.prototype.hasWitness = function hasWitness() {
|
||||
if (this.inputs.length === 0)
|
||||
return false;
|
||||
var i;
|
||||
|
||||
return this.inputs.every(function(input) {
|
||||
return input.witness.length > 0;
|
||||
});
|
||||
for (i = 0; i < this.inputs.length; i++) {
|
||||
if (this.inputs[i].witness.length > 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
TX.prototype.render = function render() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user