lnrpc/wtclientrpc: correctly merge tower client info

Prior to this commit, the wtclient would request tower info from both
the legacy client and the anchors client and would then merge the
results returned. This is incorrect since the two clients will have
different session info and different "active" statuses for the same
tower. This commit thus ensures that we dont lose this info.
This commit is contained in:
Elle Mouton committed 2023-03-16 14:59:08 +02:00
1 parent c1be420696
commit b635629e3c
4 files changed
+421 -167

No files matched your search

+35 -3
View File
@@ -359,19 +359,26 @@
},
"active_session_candidate": {
"type": "boolean",
"description": "Whether the watchtower is currently a candidate for new sessions."
"description": "Deprecated, use the active_session_candidate field under the\ncorrect identifier in the client_type map.\nWhether the watchtower is currently a candidate for new sessions."
},
"num_sessions": {
"type": "integer",
"format": "int64",
"description": "The number of sessions that have been negotiated with the watchtower."
"description": "Deprecated, use the num_sessions field under the correct identifier\nin the client_type map.\nThe number of sessions that have been negotiated with the watchtower."
},
"sessions": {
"type": "array",
"items": {
"$ref": "#/definitions/wtclientrpcTowerSession"
},
"description": "The list of sessions that have been negotiated with the watchtower."
"description": "Deprecated, use the sessions field under the correct identifier in the\nclient_type map.\nThe list of sessions that have been negotiated with the watchtower."
},
"session_info": {
"type": "array",
"items": {
"$ref": "#/definitions/wtclientrpcTowerSessionInfo"
},
"description": "A list sessions held with the tower."
}
}
},
@@ -404,6 +411,31 @@
"description": "The fee rate, in satoshis per vbyte, that will be used by the watchtower for\nthe justice transaction in the event of a channel breach."
}
}
},
"wtclientrpcTowerSessionInfo": {
"type": "object",
"properties": {
"active_session_candidate": {
"type": "boolean",
"description": "Whether the watchtower is currently a candidate for new sessions."
},
"num_sessions": {
"type": "integer",
"format": "int64",
"description": "The number of sessions that have been negotiated with the watchtower."
},
"sessions": {
"type": "array",
"items": {
"$ref": "#/definitions/wtclientrpcTowerSession"
},
"description": "The list of sessions that have been negotiated with the watchtower."
},
"policy_type": {
"$ref": "#/definitions/wtclientrpcPolicyType",
"description": "The session's policy type."
}
}
}
}
}