mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-23 19:35:28 +02:00
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:
committed by
Olaoluwa Osuntokun
parent
faf9daddf6
commit
2bf5794645
16
rpcserver.go
16
rpcserver.go
@@ -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