diff --git a/lib/blockchain/chain.js b/lib/blockchain/chain.js index bdac3a17..acc1796d 100644 --- a/lib/blockchain/chain.js +++ b/lib/blockchain/chain.js @@ -20,9 +20,8 @@ const LRU = require('../utils/lru'); const ChainEntry = require('./chainentry'); const CoinView = require('../coins/coinview'); const Script = require('../script/script'); -const errors = require('../protocol/errors'); +const {VerifyError} = require('../protocol/errors'); const co = require('../utils/co'); -const VerifyError = errors.VerifyError; /** * Represents a blockchain. @@ -531,7 +530,8 @@ Chain.prototype.verifyDuplicates = async function verifyDuplicates(block, prev, * for historical data. * @method * @private - * @see TX#checkInputs + * @see TX#verifyInputs + * @see TX#verify * @param {Block} block * @param {ChainEntry} prev * @param {DeploymentState} state @@ -595,7 +595,7 @@ Chain.prototype.verifyInputs = async function verifyInputs(block, prev, state) { // Contextual sanity checks. if (!tx.isCoinbase()) { - let [fee, reason, score] = tx.checkContext(view, height); + let [fee, reason, score] = tx.checkInputs(view, height); if (fee === -1) { throw new VerifyError(block, diff --git a/lib/http/base.js b/lib/http/base.js index a454d63e..e8e730dd 100644 --- a/lib/http/base.js +++ b/lib/http/base.js @@ -8,18 +8,17 @@ 'use strict'; const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const URL = require('url'); -const StringDecoder = require('string_decoder').StringDecoder; +const {StringDecoder} = require('string_decoder'); const AsyncObject = require('../utils/asyncobject'); const util = require('../utils/util'); const co = require('../utils/co'); const Validator = require('../utils/validator'); -const List = require('../utils/list'); +const {List, ListItem} = require('../utils/list'); const fs = require('../utils/fs'); const digest = require('../crypto/digest'); const ccmp = require('../crypto/ccmp'); -const ListItem = List.Item; /** * HTTPBase @@ -1401,23 +1400,16 @@ Response.prototype.end = function end(data, enc) { }; Response.prototype.error = function error(code, err) { - let msg; - if (this.sent) return; - msg = err.message; - if (!code) code = 400; - if (typeof msg !== 'string') - msg += ''; - this.send(code, { error: { type: err.type || 'Error', - message: err.message || msg, + message: err.message, code: err.code } }); @@ -1435,6 +1427,7 @@ Response.prototype.redirect = function redirect(code, url) { url = code; code = 301; } + this.setStatus(code); this.setHeader('Location', url); this.end(); diff --git a/lib/http/rpc.js b/lib/http/rpc.js index 97e87d87..b3376a07 100644 --- a/lib/http/rpc.js +++ b/lib/http/rpc.js @@ -393,10 +393,16 @@ RPC.prototype.getPeerInfo = async function getPeerInfo(args, help) { for (let peer = this.pool.peers.head(); peer; peer = peer.next) { let offset = this.network.time.known.get(peer.hostname()); + let hashes = []; if (offset == null) offset = 0; + for (let hash in peer.blockMap.keys()) { + hash = util.revHex(hash); + hashes.push(hash); + } + peers.push({ id: peer.id, addr: peer.hostname(), @@ -422,7 +428,7 @@ RPC.prototype.getPeerInfo = async function getPeerInfo(args, help) { besthash: peer.bestHash ? util.revHex(peer.bestHash) : null, bestheight: peer.bestHeight, banscore: peer.banScore, - inflight: peer.blockMap.keys().map(util.revHex), + inflight: hashes, whitelisted: false }); } diff --git a/lib/http/rpcbase.js b/lib/http/rpcbase.js index 7c872936..a5fc15bc 100644 --- a/lib/http/rpcbase.js +++ b/lib/http/rpcbase.js @@ -7,7 +7,7 @@ 'use strict'; const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const util = require('../utils/util'); const Lock = require('../utils/lock'); const Logger = require('../node/logger'); diff --git a/lib/http/wallet.js b/lib/http/wallet.js index 2c9b00c9..fd0d910a 100644 --- a/lib/http/wallet.js +++ b/lib/http/wallet.js @@ -8,7 +8,7 @@ 'use strict'; const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const Network = require('../protocol/network'); const util = require('../utils/util'); const Client = require('./client'); @@ -442,7 +442,7 @@ HTTPWallet.prototype.unlock = function unlock(passphrase, timeout) { /** * Get wallet key. - * @param {Base58Address} address + * @param {String} address * @returns {Promise} */ @@ -452,7 +452,7 @@ HTTPWallet.prototype.getKey = function getKey(address) { /** * Get wallet key WIF dump. - * @param {Base58Address} address + * @param {String} address * @param {String?} passphrase * @returns {Promise} */ diff --git a/lib/mempool/mempool.js b/lib/mempool/mempool.js index c38fe78e..b3b13e42 100644 --- a/lib/mempool/mempool.js +++ b/lib/mempool/mempool.js @@ -12,7 +12,7 @@ const common = require('../blockchain/common'); const policy = require('../protocol/policy'); const util = require('../utils/util'); const random = require('../crypto/random'); -const errors = require('../protocol/errors'); +const {VerifyError} = require('../protocol/errors'); const RollingFilter = require('../utils/rollingfilter'); const Address = require('../primitives/address'); const Script = require('../script/script'); @@ -29,7 +29,6 @@ const Fees = require('./fees'); const CoinView = require('../coins/coinview'); const Coins = require('../coins/coins'); const Heap = require('../utils/heap'); -const VerifyError = errors.VerifyError; /** * Represents a mempool. @@ -949,7 +948,7 @@ Mempool.prototype.verify = async function verify(entry, view) { } // Contextual sanity checks. - [fee, reason, score] = tx.checkContext(view, height); + [fee, reason, score] = tx.checkInputs(view, height); if (fee === -1) throw new VerifyError(tx, 'invalid', reason, score); diff --git a/lib/net/bip150.js b/lib/net/bip150.js index 31f49898..39c07800 100644 --- a/lib/net/bip150.js +++ b/lib/net/bip150.js @@ -10,7 +10,7 @@ const assert = require('assert'); const path = require('path'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const util = require('../utils/util'); const co = require('../utils/co'); const digest = require('../crypto/digest'); diff --git a/lib/net/bip151.js b/lib/net/bip151.js index 3fd7a006..43f24943 100644 --- a/lib/net/bip151.js +++ b/lib/net/bip151.js @@ -13,7 +13,7 @@ 'use strict'; const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const util = require('../utils/util'); const co = require('../utils/co'); const digest = require('../crypto/digest'); diff --git a/lib/net/external.js b/lib/net/external.js index 5510b954..e0306c8a 100644 --- a/lib/net/external.js +++ b/lib/net/external.js @@ -38,7 +38,12 @@ external.getIPv4 = async function getIPv4() { ip = res.body.trim(); try { - ip = IP.normalize(ip); + ip = IP.toBuffer(ip); + + if (!IP.isMapped(ip)) + throw new Error('Could not find IPv4.'); + + ip = IP.toString(ip); } catch (e) { return await external.getIPv42(); } @@ -66,13 +71,13 @@ external.getIPv42 = async function getIPv42() { match = /IP Address:\s*([0-9a-f.:]+)/i.exec(res.body); if (!match) - throw new Error('Could not find IP.'); + throw new Error('Could not find IPv4.'); ip = match[1]; raw = IP.toBuffer(ip); if (!IP.isMapped(raw)) - throw new Error('Could not find IP.'); + throw new Error('Could not find IPv4.'); return IP.toString(raw); }; @@ -94,6 +99,10 @@ external.getIPv6 = async function getIPv6() { }); ip = res.body.trim(); + ip = IP.toBuffer(ip); - return IP.normalize(ip); + if (IP.isMapped(ip)) + throw new Error('Could not find IPv6.'); + + return IP.toString(ip); }; diff --git a/lib/net/parser.js b/lib/net/parser.js index 37ddd738..bce46885 100644 --- a/lib/net/parser.js +++ b/lib/net/parser.js @@ -8,7 +8,7 @@ 'use strict'; const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const Network = require('../protocol/network'); const util = require('../utils/util'); const digest = require('../crypto/digest'); diff --git a/lib/net/peer.js b/lib/net/peer.js index 8d2288dc..daea99aa 100644 --- a/lib/net/peer.js +++ b/lib/net/peer.js @@ -8,7 +8,7 @@ 'use strict'; const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const util = require('../utils/util'); const co = require('../utils/co'); const Parser = require('./parser'); diff --git a/lib/net/pool.js b/lib/net/pool.js index 0d69577a..4592389a 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -8,7 +8,7 @@ 'use strict'; const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const AsyncObject = require('../utils/asyncobject'); const util = require('../utils/util'); const IP = require('../utils/ip'); diff --git a/lib/net/proxysocket.js b/lib/net/proxysocket.js index d15c7d68..db4d6249 100644 --- a/lib/net/proxysocket.js +++ b/lib/net/proxysocket.js @@ -6,12 +6,12 @@ 'use strict'; +const assert = require('assert'); +const EventEmitter = require('events'); +const IOClient = require('socket.io-client'); const util = require('../utils/util'); const digest = require('../crypto/digest'); const BufferWriter = require('../utils/writer'); -const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; -const IOClient = require('socket.io-client'); function ProxySocket(uri) { if (!(this instanceof ProxySocket)) diff --git a/lib/net/socks.js b/lib/net/socks.js index 97dfe910..fe088ad8 100644 --- a/lib/net/socks.js +++ b/lib/net/socks.js @@ -11,7 +11,7 @@ */ const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const net = require('net'); const util = require('../utils/util'); const IP = require('../utils/ip'); diff --git a/lib/net/tcp-browser.js b/lib/net/tcp-browser.js index c73e3de5..1bff9426 100644 --- a/lib/net/tcp-browser.js +++ b/lib/net/tcp-browser.js @@ -7,7 +7,7 @@ 'use strict'; const ProxySocket = require('./proxysocket'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const tcp = exports; tcp.createSocket = function createSocket(port, host, proxy) { diff --git a/lib/net/tcp.js b/lib/net/tcp.js index 2ac8d716..5daec677 100644 --- a/lib/net/tcp.js +++ b/lib/net/tcp.js @@ -6,7 +6,7 @@ 'use strict'; -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const net = require('net'); const socks = require('./socks'); @@ -84,7 +84,7 @@ tcp.createServer = function createServer() { */ function wrap(resolve, reject) { - return (err, result) => { + return function(err, result) { if (err) { reject(err); return; diff --git a/lib/node/logger.js b/lib/node/logger.js index f9c0c4f1..88434078 100644 --- a/lib/node/logger.js +++ b/lib/node/logger.js @@ -703,15 +703,14 @@ LoggerContext.prototype.setLevel = function setLevel(name) { this.logger.setLevel(name); }; - /** * Output a log to the `error` log level. * @param {String|Object|Error} err * @param {...Object} args */ -LoggerContext.prototype.error = function error(err) { - let args; +LoggerContext.prototype.error = function error(...args) { + let err = args[0]; if (this.logger.level < Logger.levels.ERROR) return; @@ -722,18 +721,6 @@ LoggerContext.prototype.error = function error(err) { this.log(Logger.levels.ERROR, args); }; -/** - * Helper to parse an error into a nicer - * format. Call's `log` internally. - * @private - * @param {Number} level - * @param {Error} err - */ - -LoggerContext.prototype.logError = function logError(level, err) { - this.logger.logError(level, this.module, err); -}; - /** * Output a log to the `warning` log level. * @param {String|Object} obj @@ -827,6 +814,18 @@ LoggerContext.prototype.context = function context(module) { return new LoggerContext(this.logger, module); }; +/** + * Helper to parse an error into a nicer + * format. Call's `log` internally. + * @private + * @param {Number} level + * @param {Error} err + */ + +LoggerContext.prototype.logError = function logError(level, err) { + this.logger.logError(level, this.module, err); +}; + /** * Log the current memory usage. */ diff --git a/lib/primitives/mtx.js b/lib/primitives/mtx.js index 0e7f4295..92e37818 100644 --- a/lib/primitives/mtx.js +++ b/lib/primitives/mtx.js @@ -242,6 +242,17 @@ MTX.prototype.addOutput = function addOutput(script, value) { return output; }; +/** + * Verify all transaction inputs. + * @param {VerifyFlags} [flags=STANDARD_VERIFY_FLAGS] + * @returns {Boolean} Whether the inputs are valid. + * @throws {ScriptError} on invalid inputs + */ + +MTX.prototype.check = function check(flags) { + return TX.prototype.check.call(this, this.view, flags); +}; + /** * Verify all transaction inputs. * @param {VerifyFlags} [flags=STANDARD_VERIFY_FLAGS] @@ -364,16 +375,30 @@ MTX.prototype.getSigopsSize = function getSigopsSize() { * (coinbases can only be spent 100 blocks or more * after they're created). Note that this function is * consensus critical. - * @param {Number} spendHeight - Height at which the + * @param {Number} height - Height at which the * transaction is being spent. In the mempool this is * the chain height plus one at the time it entered the pool. - * @param {Object?} ret - Return object, may be - * set with properties `reason` and `score`. * @returns {Boolean} */ -MTX.prototype.checkInputs = function checkInputs(height, ret) { - return TX.prototype.checkInputs.call(this, this.view, height, ret); +MTX.prototype.verifyInputs = function verifyInputs(height) { + return TX.prototype.verifyInputs.call(this, this.view, height); +}; + +/** + * Perform contextual checks to verify input, output, + * and fee values, as well as coinbase spend maturity + * (coinbases can only be spent 100 blocks or more + * after they're created). Note that this function is + * consensus critical. + * @param {Number} height - Height at which the + * transaction is being spent. In the mempool this is + * the chain height plus one at the time it entered the pool. + * @returns {Array} [fee, reason, score] + */ + +MTX.prototype.checkInputs = function checkInputs(height) { + return TX.prototype.checkInputs.call(this, this.view, height); }; /** diff --git a/lib/primitives/tx.js b/lib/primitives/tx.js index b27c8e78..78f9b8bb 100644 --- a/lib/primitives/tx.js +++ b/lib/primitives/tx.js @@ -24,7 +24,7 @@ const InvItem = require('./invitem'); const Bloom = require('../utils/bloom'); const consensus = require('../protocol/consensus'); const policy = require('../protocol/policy'); -const ScriptError = require('../script/common').ScriptError; +const {ScriptError} = require('../script/common'); /** * A static transaction object. @@ -754,45 +754,7 @@ TX.prototype.signature = function signature(index, prev, value, key, type, versi * Verify all transaction inputs. * @param {CoinView} view * @param {VerifyFlags?} [flags=STANDARD_VERIFY_FLAGS] - * @returns {Boolean} Whether the inputs are valid. - */ - -TX.prototype.verify = function verify(view, flags) { - try { - this.check(view, flags); - } catch (e) { - if (e.type === 'ScriptError') - return false; - throw e; - } - return true; -}; - -/** - * Verify a transaction input. - * @param {Number} index - Index of output being - * verified. - * @param {Coin|Output} coin - Previous output. - * @param {VerifyFlags} [flags=STANDARD_VERIFY_FLAGS] - * @returns {Boolean} Whether the input is valid. - */ - -TX.prototype.verifyInput = function verifyInput(index, coin, flags) { - try { - this.checkInput(index, coin, flags); - } catch (e) { - if (e.type === 'ScriptError') - return false; - throw e; - } - return true; -}; - -/** - * Verify all transaction inputs. - * @param {CoinView} view - * @param {VerifyFlags?} [flags=STANDARD_VERIFY_FLAGS] - * @throws {ScriptError} on invalid input + * @throws {ScriptError} on invalid inputs */ TX.prototype.check = function check(view, flags) { @@ -839,6 +801,44 @@ TX.prototype.checkInput = function checkInput(index, coin, flags) { ); }; +/** + * Verify all transaction inputs. + * @param {CoinView} view + * @param {VerifyFlags?} [flags=STANDARD_VERIFY_FLAGS] + * @returns {Boolean} Whether the inputs are valid. + */ + +TX.prototype.verify = function verify(view, flags) { + try { + this.check(view, flags); + } catch (e) { + if (e.type === 'ScriptError') + return false; + throw e; + } + return true; +}; + +/** + * Verify a transaction input. + * @param {Number} index - Index of output being + * verified. + * @param {Coin|Output} coin - Previous output. + * @param {VerifyFlags} [flags=STANDARD_VERIFY_FLAGS] + * @returns {Boolean} Whether the input is valid. + */ + +TX.prototype.verifyInput = function verifyInput(index, coin, flags) { + try { + this.checkInput(index, coin, flags); + } catch (e) { + if (e.type === 'ScriptError') + return false; + throw e; + } + return true; +}; + /** * Verify the transaction inputs on the worker pool * (if workers are enabled). @@ -1657,8 +1657,8 @@ TX.prototype.hasStandardWitness = function hasStandardWitness(view) { * @returns {Boolean} */ -TX.prototype.checkInputs = function checkInputs(view, height) { - let [fee] = this.checkContext(view, height); +TX.prototype.verifyInputs = function verifyInputs(view, height) { + let [fee] = this.checkInputs(view, height); return fee !== -1; }; @@ -1675,7 +1675,7 @@ TX.prototype.checkInputs = function checkInputs(view, height) { * @returns {Array} [fee, reason, score] */ -TX.prototype.checkContext = function checkContext(view, height) { +TX.prototype.checkInputs = function checkInputs(view, height) { let total = 0; let fee, value; @@ -1958,10 +1958,6 @@ TX.prototype.isWatched = function isWatched(filter) { // Test the input script if (input.script.test(filter)) return true; - - // Test the witness - if (input.witness.test(filter)) - return true; } // 5. No match diff --git a/lib/protocol/timedata.js b/lib/protocol/timedata.js index 1d8f649d..326f3401 100644 --- a/lib/protocol/timedata.js +++ b/lib/protocol/timedata.js @@ -8,7 +8,7 @@ 'use strict'; const util = require('../utils/util'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); /** * An object which handles "adjusted time". This may not diff --git a/lib/utils/asyncobject.js b/lib/utils/asyncobject.js index 488eb11c..e7546180 100644 --- a/lib/utils/asyncobject.js +++ b/lib/utils/asyncobject.js @@ -7,7 +7,7 @@ 'use strict'; const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const util = require('./util'); const Lock = require('./lock'); diff --git a/lib/utils/list.js b/lib/utils/list.js index c0e3b74b..b66abf38 100644 --- a/lib/utils/list.js +++ b/lib/utils/list.js @@ -273,6 +273,8 @@ function ListItem(value) { */ exports = List; +exports.List = List; +exports.ListItem = ListItem; exports.Item = ListItem; module.exports = exports; diff --git a/lib/wallet/wallet.js b/lib/wallet/wallet.js index 5dbffb71..39279bda 100644 --- a/lib/wallet/wallet.js +++ b/lib/wallet/wallet.js @@ -8,7 +8,7 @@ 'use strict'; const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const Network = require('../protocol/network'); const util = require('../utils/util'); const encoding = require('../utils/encoding'); @@ -1574,7 +1574,7 @@ Wallet.prototype.createTX = async function createTX(options, force) { // Consensus sanity checks. assert(mtx.isSane(), 'TX failed sanity check.'); - assert(mtx.checkInputs(this.db.state.height + 1), 'CheckInputs failed.'); + assert(mtx.verifyInputs(this.db.state.height + 1), 'TX failed context check.'); total = await this.template(mtx); diff --git a/lib/workers/framer.js b/lib/workers/framer.js index b3307251..9afda782 100644 --- a/lib/workers/framer.js +++ b/lib/workers/framer.js @@ -7,7 +7,7 @@ 'use strict'; -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const util = require('../utils/util'); const StaticWriter = require('../utils/staticwriter'); diff --git a/lib/workers/master.js b/lib/workers/master.js index ee643443..179fac25 100644 --- a/lib/workers/master.js +++ b/lib/workers/master.js @@ -8,7 +8,7 @@ 'use strict'; const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const util = require('../utils/util'); const Network = require('../protocol/network'); const jobs = require('./jobs'); diff --git a/lib/workers/parser.js b/lib/workers/parser.js index 783c7387..829e1b5c 100644 --- a/lib/workers/parser.js +++ b/lib/workers/parser.js @@ -8,7 +8,7 @@ 'use strict'; const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const util = require('../utils/util'); const packets = require('./packets'); diff --git a/lib/workers/workerpool.js b/lib/workers/workerpool.js index a230b70c..90b157a3 100644 --- a/lib/workers/workerpool.js +++ b/lib/workers/workerpool.js @@ -8,7 +8,7 @@ 'use strict'; const assert = require('assert'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const os = require('os'); const path = require('path'); const cp = require('./cp'); diff --git a/test/block-test.js b/test/block-test.js index d6944e38..d0286a49 100644 --- a/test/block-test.js +++ b/test/block-test.js @@ -218,7 +218,7 @@ describe('Block', function() { for (let i = 1; i < block.txs.length; i++) { let tx = block.txs[i]; assert(tx.isSane()); - assert(tx.checkInputs(view, height)); + assert(tx.verifyInputs(view, height)); assert(tx.verify(view, flags)); assert(!tx.hasWitness()); sigops += tx.getSigopsCost(view, flags); diff --git a/test/tx-test.js b/test/tx-test.js index d29ae2de..97e49eb0 100644 --- a/test/tx-test.js +++ b/test/tx-test.js @@ -380,7 +380,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(tx.isSane()); - assert.ok(!tx.checkInputs(view, 0)); + assert.ok(!tx.verifyInputs(view, 0)); }); it('should handle 51 bit coin values', () => { @@ -396,7 +396,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(tx.isSane()); - assert.ok(tx.checkInputs(view, 0)); + assert.ok(tx.verifyInputs(view, 0)); }); it('should fail on >51 bit output values', () => { @@ -412,7 +412,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(!tx.isSane()); - assert.ok(!tx.checkInputs(view, 0)); + assert.ok(!tx.verifyInputs(view, 0)); }); it('should handle 51 bit output values', () => { @@ -428,7 +428,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(tx.isSane()); - assert.ok(tx.checkInputs(view, 0)); + assert.ok(tx.verifyInputs(view, 0)); }); it('should fail on >51 bit fees', () => { @@ -444,7 +444,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(tx.isSane()); - assert.ok(!tx.checkInputs(view, 0)); + assert.ok(!tx.verifyInputs(view, 0)); }); it('should fail on >51 bit values from multiple', () => { @@ -464,7 +464,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(tx.isSane()); - assert.ok(!tx.checkInputs(view, 0)); + assert.ok(!tx.verifyInputs(view, 0)); }); it('should fail on >51 bit output values from multiple', () => { @@ -490,7 +490,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(!tx.isSane()); - assert.ok(!tx.checkInputs(view, 0)); + assert.ok(!tx.verifyInputs(view, 0)); }); it('should fail on >51 bit fees from multiple', () => { @@ -510,7 +510,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(tx.isSane()); - assert.ok(!tx.checkInputs(view, 0)); + assert.ok(!tx.verifyInputs(view, 0)); }); it('should fail to parse >53 bit values', () => { @@ -562,7 +562,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(tx.isSane()); - assert.ok(!tx.checkInputs(view, 0)); + assert.ok(!tx.verifyInputs(view, 0)); }); it('should fail on 53 bit output values', () => { @@ -578,7 +578,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(!tx.isSane()); - assert.ok(!tx.checkInputs(view, 0)); + assert.ok(!tx.verifyInputs(view, 0)); }); it('should fail on 53 bit fees', () => { @@ -594,7 +594,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(tx.isSane()); - assert.ok(!tx.checkInputs(view, 0)); + assert.ok(!tx.verifyInputs(view, 0)); }); [MAX_SAFE_ADDITION, MAX_SAFE_INTEGER].forEach((MAX) => { @@ -615,7 +615,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(tx.isSane()); - assert.ok(!tx.checkInputs(view, 0)); + assert.ok(!tx.verifyInputs(view, 0)); }); it('should fail on >53 bit output values from multiple', () => { @@ -641,7 +641,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(!tx.isSane()); - assert.ok(!tx.checkInputs(view, 0)); + assert.ok(!tx.verifyInputs(view, 0)); }); it('should fail on >53 bit fees from multiple', () => { @@ -661,7 +661,7 @@ describe('TX', function() { locktime: 0 }); assert.ok(tx.isSane()); - assert.ok(!tx.checkInputs(view, 0)); + assert.ok(!tx.verifyInputs(view, 0)); }); });