rpc: clean up some rpc calls.
This commit is contained in:
parent
a68ade51bc
commit
769bbd1370
@ -920,7 +920,7 @@ RPC.prototype._headerToJSON = co(function* _headerToJSON(entry) {
|
|||||||
|
|
||||||
RPC.prototype._blockToJSON = co(function* _blockToJSON(entry, block, txDetails) {
|
RPC.prototype._blockToJSON = co(function* _blockToJSON(entry, block, txDetails) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var medianTime = yield entry.getMedianTime();
|
var mtp = yield entry.getMedianTime();
|
||||||
var nextHash = yield this.chain.db.getNextHash(entry.hash);
|
var nextHash = yield this.chain.db.getNextHash(entry.hash);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -938,7 +938,7 @@ RPC.prototype._blockToJSON = co(function* _blockToJSON(entry, block, txDetails)
|
|||||||
return tx.txid();
|
return tx.txid();
|
||||||
}),
|
}),
|
||||||
time: entry.ts,
|
time: entry.ts,
|
||||||
mediantime: medianTime,
|
mediantime: mtp,
|
||||||
bits: entry.bits,
|
bits: entry.bits,
|
||||||
difficulty: this._getDifficulty(entry),
|
difficulty: this._getDifficulty(entry),
|
||||||
chainwork: entry.chainwork.toString('hex', 64),
|
chainwork: entry.chainwork.toString('hex', 64),
|
||||||
@ -1151,22 +1151,21 @@ RPC.prototype._mempoolToJSON = function _mempoolToJSON(verbose) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
RPC.prototype._entryToJSON = function _entryToJSON(entry) {
|
RPC.prototype._entryToJSON = function _entryToJSON(entry) {
|
||||||
var tx = entry.tx;
|
|
||||||
return {
|
return {
|
||||||
size: entry.size,
|
size: entry.size,
|
||||||
fee: Amount.btc(entry.fee, true),
|
fee: Amount.btc(entry.fee, true),
|
||||||
modifiedfee: Amount.btc(entry.fee, true),
|
modifiedfee: 0,
|
||||||
time: entry.ts,
|
time: entry.ts,
|
||||||
height: entry.height,
|
height: entry.height,
|
||||||
startingpriority: entry.priority,
|
startingpriority: entry.priority,
|
||||||
currentpriority: entry.getPriority(this.chain.height),
|
currentpriority: entry.getPriority(this.chain.height),
|
||||||
descendantcount: this.mempool.countDescendants(entry),
|
descendantcount: this.mempool.countDescendants(entry),
|
||||||
descendantsize: entry.sizes,
|
descendantsize: entry.descSize,
|
||||||
descendantfees: Amount.btc(entry.fee, true),
|
descendantfees: Amount.btc(entry.descFee, true),
|
||||||
ancestorcount: this.mempool.countAncestors(entry),
|
ancestorcount: this.mempool.countAncestors(entry),
|
||||||
ancestorsize: entry.sizes,
|
ancestorsize: 0,
|
||||||
ancestorfees: Amount.btc(entry.fee, true),
|
ancestorfees: 0,
|
||||||
depends: this.mempool.getDepends(tx).map(util.revHex)
|
depends: this.mempool.getDepends(entry.tx).map(util.revHex)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user