|
|
@ -308,18 +308,18 @@ Transaction.prototype.lockUntilDate = function(time) { |
|
|
|
* Sets nLockTime so that transaction is not valid until the desired block |
|
|
|
* height. |
|
|
|
* |
|
|
|
* @param {Number} time |
|
|
|
* @param {Number} height |
|
|
|
* @return {Transaction} this |
|
|
|
*/ |
|
|
|
Transaction.prototype.lockUntilBlockHeight = function(time) { |
|
|
|
$.checkArgument(_.isNumber(time)); |
|
|
|
if (time >= Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT) { |
|
|
|
Transaction.prototype.lockUntilBlockHeight = function(height) { |
|
|
|
$.checkArgument(_.isNumber(height)); |
|
|
|
if (height >= Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT) { |
|
|
|
throw new errors.Transaction.BlockHeightTooHigh(); |
|
|
|
} |
|
|
|
if (time < 0) { |
|
|
|
if (height < 0) { |
|
|
|
throw new errors.Transaction.NLockTimeOutOfRange(); |
|
|
|
} |
|
|
|
this.nLockTime = time; |
|
|
|
this.nLockTime = height; |
|
|
|
return this; |
|
|
|
}; |
|
|
|
|
|
|
|