|
|
@ -126,6 +126,9 @@ Transaction.prototype.checkedSerialize = Transaction.prototype.toString = functi |
|
|
|
throw new errors.Transaction.FeeError(feeError); |
|
|
|
} |
|
|
|
} |
|
|
|
if (this._hasDustOutputs()) { |
|
|
|
throw new errors.Transaction.DustOutputs(); |
|
|
|
} |
|
|
|
return this.uncheckedSerialize(); |
|
|
|
}; |
|
|
|
|
|
|
@ -143,6 +146,18 @@ Transaction.prototype._validateChange = function() { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
Transaction.DUST_AMOUNT = 5460; |
|
|
|
|
|
|
|
Transaction.prototype._hasDustOutputs = function() { |
|
|
|
var output; |
|
|
|
for (output in this.outputs) { |
|
|
|
if (this.outputs[output].satoshis < Transaction.DUST_AMOUNT) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
}; |
|
|
|
|
|
|
|
Transaction.prototype.inspect = function() { |
|
|
|
return '<Transaction: ' + this.toString() + '>'; |
|
|
|
}; |
|
|
|