From 6ee7ac8a51a1c702e511b168770f0b2f9ef6fe0e Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 9 Aug 2016 12:18:59 -0700 Subject: [PATCH] rpc: fix getrawmempool. --- lib/bcoin/http/rpc.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/bcoin/http/rpc.js b/lib/bcoin/http/rpc.js index da803940..df037814 100644 --- a/lib/bcoin/http/rpc.js +++ b/lib/bcoin/http/rpc.js @@ -970,7 +970,7 @@ RPC.prototype.mempoolToJSON = function mempoolToJSON(verbose, callback) { if (err) return callback(err); - tx = entry; + tx = entry.tx; out[tx.rhash] = { size: entry.size, @@ -980,10 +980,10 @@ RPC.prototype.mempoolToJSON = function mempoolToJSON(verbose, callback) { height: entry.height, startingpriority: entry.priority, currentpriority: entry.getPriority(self.chain.height), - descendantcount: -1, - descendantsize: -1, - descendantfees: -1, - depends: tx.getPrevout() + descendantcount: 0, + descendantsize: entry.size, + descendantfees: entry.fees, + depends: tx.getPrevout().map(utils.revHex) }; next(); @@ -1319,6 +1319,9 @@ RPC.prototype.generatetoaddress = function generatetoaddress(args, callback) { address = this.miner.address; this.miner.address = bcoin.address.fromBase58(args[1]); + args = args.slice(); + args.splice(1, 1); + this.generate(args, function(err, hashes) { if (err) return callback(err);