transaction: Change variable name from time to height
This commit is contained in:
parent
7cf3b6eb91
commit
f8974b383a
|
@ -308,18 +308,18 @@ Transaction.prototype.lockUntilDate = function(time) {
|
||||||
* Sets nLockTime so that transaction is not valid until the desired block
|
* Sets nLockTime so that transaction is not valid until the desired block
|
||||||
* height.
|
* height.
|
||||||
*
|
*
|
||||||
* @param {Number} time
|
* @param {Number} height
|
||||||
* @return {Transaction} this
|
* @return {Transaction} this
|
||||||
*/
|
*/
|
||||||
Transaction.prototype.lockUntilBlockHeight = function(time) {
|
Transaction.prototype.lockUntilBlockHeight = function(height) {
|
||||||
$.checkArgument(_.isNumber(time));
|
$.checkArgument(_.isNumber(height));
|
||||||
if (time >= Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT) {
|
if (height >= Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT) {
|
||||||
throw new errors.Transaction.BlockHeightTooHigh();
|
throw new errors.Transaction.BlockHeightTooHigh();
|
||||||
}
|
}
|
||||||
if (time < 0) {
|
if (height < 0) {
|
||||||
throw new errors.Transaction.NLockTimeOutOfRange();
|
throw new errors.Transaction.NLockTimeOutOfRange();
|
||||||
}
|
}
|
||||||
this.nLockTime = time;
|
this.nLockTime = height;
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -408,7 +408,7 @@ describe('Transaction', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe.only('setting the nLockTime', function() {
|
describe('setting the nLockTime', function() {
|
||||||
var MILLIS_IN_SECOND = 1000;
|
var MILLIS_IN_SECOND = 1000;
|
||||||
var timestamp = 1423504946;
|
var timestamp = 1423504946;
|
||||||
var blockHeight = 342734;
|
var blockHeight = 342734;
|
||||||
|
|
Loading…
Reference in New Issue