txdb: fix getMember.

This commit is contained in:
Christopher Jeffrey 2016-08-11 01:48:03 -07:00
parent e8cb71447c
commit de55c82227
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 6 additions and 10 deletions

View File

@ -3212,7 +3212,7 @@ RPC.prototype._toListTX = function _toListTX(tx, callback) {
account: member.path.name,
address: member.address.toBase58(self.network),
category: receive ? 'receive' : 'send',
amount: +utils.btc(member.value),
amount: +utils.btc(details.getValue()),
label: member.path.name,
vout: 0,
confirmations: details.confirmations,

View File

@ -2135,17 +2135,13 @@ Details.prototype.getValue = function getValue() {
Details.prototype.getMember = function getMember() {
var receive = this.isReceive();
var vector = receive ? this.outputs : this.inputs;
var i, member;
for (i = 0; i < this.outputs.length; i++) {
member = this.outputs[i];
if (receive) {
if (!member.path)
continue;
} else {
if (member.path)
continue;
}
for (i = 0; i < vector.length; i++) {
member = vector[i];
if (!member.path)
continue;
return member;
}