mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-18 06:34:27 +01:00
multi: replace per channel sigPool with global daemon level sigPool
In this commit, we remove the per channel `sigPool` within the `lnwallet.LightningChannel` struct. With this change, we ensure that as the number of channels grows, the number of gouroutines idling in the sigPool stays constant. It's the case that currently on the daemon, most channels are likely inactive, with only a hand full actually consistently carrying out channel updates. As a result, this change should reduce the amount of idle CPU usage, as we have less active goroutines in select loops. In order to make this change, the `SigPool` itself has been publicly exported such that outside callers can make a `SigPool` and pass it into newly created channels. Since the sig pool now lives outside the channel, we were also able to do away with the Stop() method on the channel all together. Finally, the server is the sub-system that is currently responsible for managing the `SigPool` within lnd.
This commit is contained in:
@@ -1431,7 +1431,6 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
channel.Stop()
|
||||
|
||||
// If a force closure was requested, then we'll handle all the details
|
||||
// around the creation and broadcast of the unilateral closure
|
||||
@@ -1667,7 +1666,7 @@ func (r *rpcServer) fetchOpenDbChannel(chanPoint wire.OutPoint) (
|
||||
|
||||
// fetchActiveChannel attempts to locate a channel identified by its channel
|
||||
// point from the database's set of all currently opened channels and
|
||||
// return it as a fully popuplated state machine
|
||||
// return it as a fully populated state machine
|
||||
func (r *rpcServer) fetchActiveChannel(chanPoint wire.OutPoint) (
|
||||
*lnwallet.LightningChannel, error) {
|
||||
|
||||
@@ -1680,7 +1679,7 @@ func (r *rpcServer) fetchActiveChannel(chanPoint wire.OutPoint) (
|
||||
// we create a fully populated channel state machine which
|
||||
// uses the db channel as backing storage.
|
||||
return lnwallet.NewLightningChannel(
|
||||
r.server.cc.wallet.Cfg.Signer, nil, dbChan,
|
||||
r.server.cc.wallet.Cfg.Signer, nil, dbChan, nil,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user