Browse Source

Change unnecesarily big name

patch-2
eordano 10 years ago
parent
commit
f0f90c5d6a
  1. 14
      lib/transaction/transaction.js

14
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 * Retrieve a hexa string that can be used with bitcoind's CLI interface
* (decoderawtransaction, sendrawtransaction) * (decoderawtransaction, sendrawtransaction)
* *
* @param {Object} skipOptions allows to skip certain tests: * @param {Object} opts allows to skip certain tests:
* <ul> * <ul>
* <li><tt>disableSmallFees</tt>: disable checking for fees that are too small</li> * <li><tt>disableSmallFees</tt>: disable checking for fees that are too small</li>
* <li><tt>disableLargeFees</tt>: disable checking for fees that are too large</li> * <li><tt>disableLargeFees</tt>: disable checking for fees that are too large</li>
@ -144,27 +144,27 @@ Transaction.prototype.uncheckedSerialize = Transaction.prototype.toString = func
* </ul> * </ul>
* @return {string} * @return {string}
*/ */
Transaction.prototype.checkedSerialize = function(skipOptions) { Transaction.prototype.checkedSerialize = function(opts) {
skipOptions = skipOptions || {}; opts = opts || {};
var missingChange = this._missingChange(); var missingChange = this._missingChange();
var feeIsTooLarge = this._isFeeTooLarge(); var feeIsTooLarge = this._isFeeTooLarge();
var feeIsTooSmall = this._isFeeTooSmall(); var feeIsTooSmall = this._isFeeTooSmall();
var isFullySigned = this.isFullySigned(); var isFullySigned = this.isFullySigned();
var hasDustOutputs = this._hasDustOutputs(); var hasDustOutputs = this._hasDustOutputs();
if (!skipOptions.disableLargeFees && feeIsTooLarge) { if (!opts.disableLargeFees && feeIsTooLarge) {
if (missingChange) { if (missingChange) {
throw new errors.Transaction.ChangeAddressMissing('Fee is too large and no change address was provided'); throw new errors.Transaction.ChangeAddressMissing('Fee is too large and no change address was provided');
} }
throw new errors.Transaction.FeeError(feeIsTooLarge); throw new errors.Transaction.FeeError(feeIsTooLarge);
} }
if (!skipOptions.disableSmallFees && feeIsTooSmall) { if (!opts.disableSmallFees && feeIsTooSmall) {
throw new errors.Transaction.FeeError(feeIsTooSmall); throw new errors.Transaction.FeeError(feeIsTooSmall);
} }
if (!skipOptions.disableDustOutputs && this._hasDustOutputs()) { if (!opts.disableDustOutputs && this._hasDustOutputs()) {
throw new errors.Transaction.DustOutputs(); throw new errors.Transaction.DustOutputs();
} }
if (!skipOptions.disableIsFullySigned && !isFullySigned) { if (!opts.disableIsFullySigned && !isFullySigned) {
throw new errors.Transaction.MissingSignatures(); throw new errors.Transaction.MissingSignatures();
} }
return this.uncheckedSerialize(); return this.uncheckedSerialize();

Loading…
Cancel
Save