From 532e46b2d1e1169a46ac29e9f3aca37a9e470d07 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 11 Aug 2016 02:35:02 -0700 Subject: [PATCH] rpc: tx json again. --- lib/bcoin/http/rpc.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/bcoin/http/rpc.js b/lib/bcoin/http/rpc.js index 7055074e..f1f0670b 100644 --- a/lib/bcoin/http/rpc.js +++ b/lib/bcoin/http/rpc.js @@ -9,6 +9,7 @@ var bcoin = require('../env'); var utils = require('../utils'); var IP = require('../ip'); +var assert = utils.assert; var constants = bcoin.protocol.constants; function RPC(node) { @@ -3273,6 +3274,13 @@ RPC.prototype._toListTX = function _toListTX(tx, callback) { member = receive ? recMember : sendMember; + // In the odd case where we send to ourselves. + if (!member) { + assert(!receive); + member = recMember; + sent = received; + } + json = { account: member.path.name, address: member.address.toBase58(self.network),