require height.
This commit is contained in:
parent
a5d72188c0
commit
c334d1f9d8
@ -83,8 +83,10 @@ utils.inherits(Coin, bcoin.output);
|
||||
*/
|
||||
|
||||
Coin.prototype.getConfirmations = function getConfirmations(height) {
|
||||
if (height == null)
|
||||
height = network.height;
|
||||
assert(typeof height === 'number');
|
||||
|
||||
if (height === -1)
|
||||
return 0;
|
||||
|
||||
if (this.height === -1)
|
||||
return 0;
|
||||
@ -131,7 +133,7 @@ Coin.prototype.inspect = function inspect() {
|
||||
coinbase: this.coinbase,
|
||||
hash: this.hash ? utils.revHex(this.hash) : null,
|
||||
index: this.index,
|
||||
age: this.getAge(),
|
||||
age: this.getAge(network.height),
|
||||
address: this.getAddress()
|
||||
};
|
||||
};
|
||||
|
||||
@ -1297,8 +1297,7 @@ MTX.prototype.sortMembers = function sortMembers() {
|
||||
*/
|
||||
|
||||
MTX.prototype.avoidFeeSniping = function avoidFeeSniping(height) {
|
||||
if (height == null)
|
||||
height = network.height;
|
||||
assert(typeof height === 'number');
|
||||
|
||||
if (height === -1)
|
||||
height = 0;
|
||||
|
||||
@ -1362,11 +1362,10 @@ TX.prototype.getPriority = function getPriority(height, size) {
|
||||
if (this.isCoinbase())
|
||||
return new bn(0);
|
||||
|
||||
if (height == null) {
|
||||
height = this.height;
|
||||
if (height === -1)
|
||||
height = network.height + 1;
|
||||
}
|
||||
assert(typeof height === 'number');
|
||||
|
||||
if (height === -1)
|
||||
height = 0;
|
||||
|
||||
if (size == null)
|
||||
size = this.maxSize();
|
||||
@ -1411,11 +1410,7 @@ TX.prototype.getPriority = function getPriority(height, size) {
|
||||
TX.prototype.isFree = function isFree(height, size) {
|
||||
var priority;
|
||||
|
||||
if (height == null) {
|
||||
height = this.height;
|
||||
if (height === -1)
|
||||
height = network.height + 1;
|
||||
}
|
||||
assert(typeof height === 'number');
|
||||
|
||||
priority = this.getPriority(height, size).priority;
|
||||
|
||||
@ -1483,8 +1478,10 @@ TX.prototype.getMaxFee = function getMaxFee(size, rate) {
|
||||
*/
|
||||
|
||||
TX.prototype.getConfirmations = function getConfirmations(height) {
|
||||
if (height == null)
|
||||
height = network.height;
|
||||
assert(typeof height === 'number');
|
||||
|
||||
if (height === -1)
|
||||
return 0;
|
||||
|
||||
if (this.height === -1)
|
||||
return 0;
|
||||
@ -1635,8 +1632,8 @@ TX.prototype.inspect = function inspect() {
|
||||
value: utils.btc(this.getOutputValue()),
|
||||
fee: utils.btc(this.getFee()),
|
||||
minFee: utils.btc(this.getMinFee()),
|
||||
confirmations: this.getConfirmations(),
|
||||
priority: this.getPriority().priority.toString(10),
|
||||
confirmations: this.getConfirmations(network.height),
|
||||
priority: this.getPriority(network.height).priority.toString(10),
|
||||
date: utils.date(this.ts || this.ps),
|
||||
block: this.block ? utils.revHex(this.block) : null,
|
||||
ts: this.ts,
|
||||
|
||||
@ -815,7 +815,7 @@ Wallet.prototype.createTX = function createTX(options, outputs, callback) {
|
||||
// if (options.locktime != null)
|
||||
// tx.setLocktime(options.locktime);
|
||||
// else
|
||||
// tx.avoidFeeSniping();
|
||||
// tx.avoidFeeSniping(network.height);
|
||||
|
||||
// Sign the transaction
|
||||
if (!self.sign(tx))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user