rpc: don't count pending channels in total channel balance
This commit is contained in:
parent
e1152148b7
commit
54177557be
@ -776,7 +776,9 @@ func (r *rpcServer) ChannelBalance(ctx context.Context,
|
|||||||
|
|
||||||
var balance btcutil.Amount
|
var balance btcutil.Amount
|
||||||
for _, channel := range channels {
|
for _, channel := range channels {
|
||||||
balance += channel.OurBalance
|
if !channel.IsPending {
|
||||||
|
balance += channel.OurBalance
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return &lnrpc.ChannelBalanceResponse{Balance: int64(balance)}, nil
|
return &lnrpc.ChannelBalanceResponse{Balance: int64(balance)}, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user