diff --git a/lib/transaction/transaction.js b/lib/transaction/transaction.js index 3f8c48d..c5e4500 100644 --- a/lib/transaction/transaction.js +++ b/lib/transaction/transaction.js @@ -135,7 +135,7 @@ Transaction.prototype.uncheckedSerialize = Transaction.prototype.toString = func * Retrieve a hexa string that can be used with bitcoind's CLI interface * (decoderawtransaction, sendrawtransaction) * - * @param {Object} skipOptions allows to skip certain tests: + * @param {Object} opts allows to skip certain tests: * * @return {string} */ -Transaction.prototype.checkedSerialize = function(skipOptions) { - skipOptions = skipOptions || {}; +Transaction.prototype.checkedSerialize = function(opts) { + opts = opts || {}; var missingChange = this._missingChange(); var feeIsTooLarge = this._isFeeTooLarge(); var feeIsTooSmall = this._isFeeTooSmall(); var isFullySigned = this.isFullySigned(); var hasDustOutputs = this._hasDustOutputs(); - if (!skipOptions.disableLargeFees && feeIsTooLarge) { + if (!opts.disableLargeFees && feeIsTooLarge) { if (missingChange) { throw new errors.Transaction.ChangeAddressMissing('Fee is too large and no change address was provided'); } throw new errors.Transaction.FeeError(feeIsTooLarge); } - if (!skipOptions.disableSmallFees && feeIsTooSmall) { + if (!opts.disableSmallFees && feeIsTooSmall) { throw new errors.Transaction.FeeError(feeIsTooSmall); } - if (!skipOptions.disableDustOutputs && this._hasDustOutputs()) { + if (!opts.disableDustOutputs && this._hasDustOutputs()) { throw new errors.Transaction.DustOutputs(); } - if (!skipOptions.disableIsFullySigned && !isFullySigned) { + if (!opts.disableIsFullySigned && !isFullySigned) { throw new errors.Transaction.MissingSignatures(); } return this.uncheckedSerialize();