do not overwrite lockTime input by user.

This commit is contained in:
Christopher Jeffrey 2015-12-17 17:58:09 -08:00
parent 7f70b573c1
commit 1e0a153b59

View File

@ -101,11 +101,11 @@ TX.prototype._input = function _input(i, index) {
var prev = input.out.tx.outputs[input.out.index].script;
var lock = bcoin.script.lockTime(prev);
if (lock) {
this.lock = Math.max(lock.toNumber(), this.lock);
// if (this.lock === 0)
// this.lock = lock.toNumber();
// if (!bcoin.script.spendable(this, this.lock))
// throw new Error('Cannot spend ' + utils.revHex(input.out.hash));
// this.lock = Math.max(lock.toNumber(), this.lock);
if (this.lock === 0)
this.lock = lock.toNumber();
if (!bcoin.script.spendable(this, this.lock))
throw new Error('Cannot spend ' + utils.revHex(input.out.hash));
if (input.seq === 0xffffffff)
input.seq = 0;
}