mtx: fix verify methods.

This commit is contained in:
Christopher Jeffrey 2017-07-01 04:02:56 -07:00
parent c732333554
commit 7932a25abe
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -260,7 +260,14 @@ MTX.prototype.check = function check(flags) {
*/
MTX.prototype.verify = function verify(flags) {
return TX.prototype.verify.call(this, this.view, flags);
try {
this.check(flags);
} catch (e) {
if (e.type === 'ScriptError')
return false;
throw e;
}
return true;
};
/**
@ -382,7 +389,8 @@ MTX.prototype.getSigopsSize = function getSigopsSize() {
*/
MTX.prototype.verifyInputs = function verifyInputs(height) {
return TX.prototype.verifyInputs.call(this, this.view, height);
let [fee] = this.checkInputs(height);
return fee !== -1;
};
/**