watchtower/wtclient/client: use existing session with same TxPolicy
This commit modifies the client's filtering when selecting from existing sessions. The new logic compares the configured TxPolicy with the TxPolicy of the candidate sessions, which has the effect of ignoring operational parameters such as MaxUpdates. Prior, changing MaxUpdates would cause the client to request a new session even if it had perfectly good slots available in a policy with an equal TxPolicy.
This commit is contained in:
2 files changed
+65
-3
No files matched your search
@@ -519,9 +519,10 @@ func (c *TowerClient) nextSessionQueue() *sessionQueue {
|
||||
delete(c.candidateSessions, id)
|
||||
|
||||
// Skip any sessions with policies that don't match the current
|
||||
// configuration. These can be used again if the client changes
|
||||
// their configuration back.
|
||||
if sessionInfo.Policy != c.cfg.Policy {
|
||||
// TxPolicy, as they would result in different justice
|
||||
// transactions from what is requested. These can be used again
|
||||
// if the client changes their configuration and restarting.
|
||||
if sessionInfo.Policy.TxPolicy != c.cfg.Policy.TxPolicy {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user