lnrpc: added rpc support for querying a channel's satoshis sent/received
Added total_satoshis_sent and total_satoshis_received fields to the ListChannels RPC call.
This commit is contained in:
1 parent
faf9daddf6
commit
2bf5794645
5 files changed
+280
-218
No files matched your search
+9
-7
@@ -551,13 +551,15 @@ func (r *rpcServer) ListChannels(ctx context.Context,
|
||||
nodeID := hex.EncodeToString(nodePub)
|
||||
|
||||
channel := &lnrpc.ActiveChannel{
|
||||
RemotePubkey: nodeID,
|
||||
ChannelPoint: dbChannel.ChanID.String(),
|
||||
Capacity: int64(dbChannel.Capacity),
|
||||
LocalBalance: int64(dbChannel.OurBalance),
|
||||
RemoteBalance: int64(dbChannel.TheirBalance),
|
||||
NumUpdates: dbChannel.NumUpdates,
|
||||
PendingHtlcs: make([]*lnrpc.HTLC, len(dbChannel.Htlcs)),
|
||||
RemotePubkey: nodeID,
|
||||
ChannelPoint: dbChannel.ChanID.String(),
|
||||
Capacity: int64(dbChannel.Capacity),
|
||||
LocalBalance: int64(dbChannel.OurBalance),
|
||||
RemoteBalance: int64(dbChannel.TheirBalance),
|
||||
TotalSatoshisSent: int64(dbChannel.TotalSatoshisSent),
|
||||
TotalSatoshisReceived: int64(dbChannel.TotalSatoshisReceived),
|
||||
NumUpdates: dbChannel.NumUpdates,
|
||||
PendingHtlcs: make([]*lnrpc.HTLC, len(dbChannel.Htlcs)),
|
||||
}
|
||||
|
||||
for i, htlc := range dbChannel.Htlcs {
|
||||
|
||||
Reference in new issue
Block a user