rpcserver+lnd_test: adding PendingHtlcs to UnsetteldBalance

rpcserver: summing PendingHtlcs and assigning to UnsettledBalance

lnd_test: adding tests for UnsettledBalance
This commit is contained in:
ccdle12
2018-12-07 00:49:05 +00:00
parent cd15de4144
commit 264293ff89
2 changed files with 135 additions and 0 deletions

View File

@@ -2314,6 +2314,9 @@ func (r *rpcServer) ListChannels(ctx context.Context,
HashLock: rHash[:],
ExpirationHeight: htlc.RefundTimeout,
}
// Add the Pending Htlc Amount to UnsettledBalance field.
channel.UnsettledBalance += channel.PendingHtlcs[i].Amount
}
resp.Channels = append(resp.Channels, channel)