|
|
@ -73,7 +73,7 @@ Transaction.MAX_MONEY = 21000000 * 1e8; |
|
|
|
// nlocktime limit to be considered block height rather than a timestamp
|
|
|
|
Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT = 5e8; |
|
|
|
|
|
|
|
// Max value for an unsigned 32 bit value
|
|
|
|
// Max value for an unsigned 32 bit value
|
|
|
|
Transaction.NLOCKTIME_MAX_VALUE = 4294967295; |
|
|
|
|
|
|
|
// Value used for fee estimation (satoshis per kilobyte)
|
|
|
@ -639,6 +639,10 @@ Transaction.prototype.getChangeOutput = function() { |
|
|
|
* @return {Transaction} this, for chaining |
|
|
|
*/ |
|
|
|
Transaction.prototype.to = function(address, amount) { |
|
|
|
$.checkArgument( |
|
|
|
JSUtil.isPositiveInteger(amount), |
|
|
|
'Amount is expected to be a positive integer' |
|
|
|
); |
|
|
|
this.addOutput(new Output({ |
|
|
|
script: Script(new Address(address)), |
|
|
|
satoshis: amount |
|
|
@ -687,7 +691,7 @@ Transaction.prototype._addOutput = function(output) { |
|
|
|
/** |
|
|
|
* Calculates or gets the total output amount in satoshis |
|
|
|
* |
|
|
|
* @return {Number} the transaction total output amount |
|
|
|
* @return {Number} the transaction total output amount |
|
|
|
*/ |
|
|
|
Transaction.prototype._getOutputAmount = function() { |
|
|
|
if (_.isUndefined(this._outputAmount)) { |
|
|
@ -704,7 +708,7 @@ Transaction.prototype._getOutputAmount = function() { |
|
|
|
/** |
|
|
|
* Calculates or gets the total input amount in satoshis |
|
|
|
* |
|
|
|
* @return {Number} the transaction total input amount |
|
|
|
* @return {Number} the transaction total input amount |
|
|
|
*/ |
|
|
|
Transaction.prototype._getInputAmount = function() { |
|
|
|
if (_.isUndefined(this._inputAmount)) { |
|
|
|