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);