mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 08:22:51 +02:00
lntemp: remove balanceCount
from node state
Since channels are always closed when tests finish, there's no need to track them in node's state.
This commit is contained in:
@@ -103,20 +103,6 @@ type invoiceCount struct {
|
|||||||
LastIndexOffset uint64
|
LastIndexOffset uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
// balanceCount provides a summary over balances related to channels.
|
|
||||||
type balanceCount struct {
|
|
||||||
LocalBalance *lnrpc.Amount
|
|
||||||
RemoteBalance *lnrpc.Amount
|
|
||||||
UnsettledLocalBalance *lnrpc.Amount
|
|
||||||
UnsettledRemoteBalance *lnrpc.Amount
|
|
||||||
PendingOpenLocalBalance *lnrpc.Amount
|
|
||||||
PendingOpenRemoteBalance *lnrpc.Amount
|
|
||||||
|
|
||||||
// Deprecated fields.
|
|
||||||
Balance int64
|
|
||||||
PendingOpenBalance int64
|
|
||||||
}
|
|
||||||
|
|
||||||
// walletBalance provides a summary over balances related the node's wallet.
|
// walletBalance provides a summary over balances related the node's wallet.
|
||||||
type walletBalance struct {
|
type walletBalance struct {
|
||||||
TotalBalance int64
|
TotalBalance int64
|
||||||
@@ -139,9 +125,6 @@ type State struct {
|
|||||||
// CloseChannel gives the summary of close channel related counts.
|
// CloseChannel gives the summary of close channel related counts.
|
||||||
CloseChannel closedChannelCount
|
CloseChannel closedChannelCount
|
||||||
|
|
||||||
// Balance gives the summary of the channel balance.
|
|
||||||
Balance balanceCount
|
|
||||||
|
|
||||||
// Wallet gives the summary of the wallet balance.
|
// Wallet gives the summary of the wallet balance.
|
||||||
Wallet walletBalance
|
Wallet walletBalance
|
||||||
|
|
||||||
@@ -315,18 +298,6 @@ func (s *State) updateEdgeStats() {
|
|||||||
s.Edge.Public = len(resp.Edges)
|
s.Edge.Public = len(resp.Edges)
|
||||||
}
|
}
|
||||||
|
|
||||||
// updateChannelBalance creates stats for the node's channel balance.
|
|
||||||
func (s *State) updateChannelBalance() {
|
|
||||||
resp := s.rpc.ChannelBalance()
|
|
||||||
|
|
||||||
s.Balance.LocalBalance = resp.LocalBalance
|
|
||||||
s.Balance.RemoteBalance = resp.RemoteBalance
|
|
||||||
s.Balance.UnsettledLocalBalance = resp.UnsettledLocalBalance
|
|
||||||
s.Balance.UnsettledRemoteBalance = resp.UnsettledRemoteBalance
|
|
||||||
s.Balance.PendingOpenLocalBalance = resp.PendingOpenLocalBalance
|
|
||||||
s.Balance.PendingOpenRemoteBalance = resp.PendingOpenRemoteBalance
|
|
||||||
}
|
|
||||||
|
|
||||||
// updateWalletBalance creates stats for the node's wallet balance.
|
// updateWalletBalance creates stats for the node's wallet balance.
|
||||||
func (s *State) updateWalletBalance() {
|
func (s *State) updateWalletBalance() {
|
||||||
resp := s.rpc.WalletBalance()
|
resp := s.rpc.WalletBalance()
|
||||||
@@ -345,7 +316,6 @@ func (s *State) updateState() {
|
|||||||
s.updateInvoiceStats()
|
s.updateInvoiceStats()
|
||||||
s.updateUTXOStats()
|
s.updateUTXOStats()
|
||||||
s.updateEdgeStats()
|
s.updateEdgeStats()
|
||||||
s.updateChannelBalance()
|
|
||||||
s.updateWalletBalance()
|
s.updateWalletBalance()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user