mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 23:21:12 +02:00
config+rpcserver: hide deprecated option unsafe-disconnect
Also fix a case where this deprecated flag is used. We will always bypass the active channels check when `DisconnectPeer` because `!r.cfg.UnsafeDisconnect` is always false.
This commit is contained in:
@@ -346,7 +346,7 @@ type Config struct {
|
|||||||
BlockingProfile int `long:"blockingprofile" description:"Used to enable a blocking profile to be served on the profiling port. This takes a value from 0 to 1, with 1 including every blocking event, and 0 including no events."`
|
BlockingProfile int `long:"blockingprofile" description:"Used to enable a blocking profile to be served on the profiling port. This takes a value from 0 to 1, with 1 including every blocking event, and 0 including no events."`
|
||||||
MutexProfile int `long:"mutexprofile" description:"Used to Enable a mutex profile to be served on the profiling port. This takes a value from 0 to 1, with 1 including every mutex event, and 0 including no events."`
|
MutexProfile int `long:"mutexprofile" description:"Used to Enable a mutex profile to be served on the profiling port. This takes a value from 0 to 1, with 1 including every mutex event, and 0 including no events."`
|
||||||
|
|
||||||
UnsafeDisconnect bool `long:"unsafe-disconnect" description:"DEPRECATED: Allows the rpcserver to intentionally disconnect from peers with open channels. THIS FLAG WILL BE REMOVED IN 0.10.0"`
|
UnsafeDisconnect bool `long:"unsafe-disconnect" description:"DEPRECATED: Allows the rpcserver to intentionally disconnect from peers with open channels. THIS FLAG WILL BE REMOVED IN 0.10.0" hidden:"true"`
|
||||||
UnsafeReplay bool `long:"unsafe-replay" description:"Causes a link to replay the adds on its commitment txn after starting up, this enables testing of the sphinx replay logic."`
|
UnsafeReplay bool `long:"unsafe-replay" description:"Causes a link to replay the adds on its commitment txn after starting up, this enables testing of the sphinx replay logic."`
|
||||||
MaxPendingChannels int `long:"maxpendingchannels" description:"The maximum number of incoming pending channels permitted per peer."`
|
MaxPendingChannels int `long:"maxpendingchannels" description:"The maximum number of incoming pending channels permitted per peer."`
|
||||||
BackupFilePath string `long:"backupfilepath" description:"The target location of the channel backup file"`
|
BackupFilePath string `long:"backupfilepath" description:"The target location of the channel backup file"`
|
||||||
@@ -576,7 +576,6 @@ func DefaultConfig() Config {
|
|||||||
UserAgentVersion: neutrino.UserAgentVersion,
|
UserAgentVersion: neutrino.UserAgentVersion,
|
||||||
},
|
},
|
||||||
BlockCacheSize: defaultBlockCacheSize,
|
BlockCacheSize: defaultBlockCacheSize,
|
||||||
UnsafeDisconnect: true,
|
|
||||||
MaxPendingChannels: lncfg.DefaultMaxPendingChannels,
|
MaxPendingChannels: lncfg.DefaultMaxPendingChannels,
|
||||||
NoSeedBackup: defaultNoSeedBackup,
|
NoSeedBackup: defaultNoSeedBackup,
|
||||||
MinBackoff: defaultMinBackoff,
|
MinBackoff: defaultMinBackoff,
|
||||||
|
@@ -1747,7 +1747,7 @@ func (r *rpcServer) DisconnectPeer(ctx context.Context,
|
|||||||
// In order to avoid erroneously disconnecting from a peer that we have
|
// In order to avoid erroneously disconnecting from a peer that we have
|
||||||
// an active channel with, if we have any channels active with this
|
// an active channel with, if we have any channels active with this
|
||||||
// peer, then we'll disallow disconnecting from them.
|
// peer, then we'll disallow disconnecting from them.
|
||||||
if len(nodeChannels) > 0 && !r.cfg.UnsafeDisconnect {
|
if len(nodeChannels) > 0 {
|
||||||
return nil, fmt.Errorf("cannot disconnect from peer(%x), "+
|
return nil, fmt.Errorf("cannot disconnect from peer(%x), "+
|
||||||
"all active channels with the peer need to be closed "+
|
"all active channels with the peer need to be closed "+
|
||||||
"first", pubKeyBytes)
|
"first", pubKeyBytes)
|
||||||
|
Reference in New Issue
Block a user