[#2212] morph: Fix subscription restoration

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
pull/62/head
Evgenii Stratonikov 2023-01-27 13:26:49 +03:00 committed by fyrchik
parent c43b2dbac9
commit 9afe86ba3e
2 changed files with 3 additions and 0 deletions

View File

@ -26,6 +26,7 @@ Changelog for FrostFS Node
- Set flag `mode` required for `frostfs-cli control shards set-mode` (#8)
- Fix `dirty` suffix in debian package version (#53)
- Prevent node process from killing by systemd when shutting down (#1465)
- Restore subscriptions correctly on morph client switch (#2212)
### Removed
### Updated

View File

@ -226,6 +226,7 @@ func (c *Client) restoreSubscriptions(cli *rpcclient.WSClient, endpoint string)
// notification events restoration
for contract := range c.subscribedEvents {
contract := contract // See https://github.com/nspcc-dev/neo-go/issues/2890
id, err = cli.SubscribeForExecutionNotifications(&contract, nil)
if err != nil {
c.logger.Error("could not restore notification subscription after RPC switch",
@ -242,6 +243,7 @@ func (c *Client) restoreSubscriptions(cli *rpcclient.WSClient, endpoint string)
// notary notification events restoration
if c.notary != nil {
for signer := range c.subscribedNotaryEvents {
signer := signer // See https://github.com/nspcc-dev/neo-go/issues/2890
id, err = cli.SubscribeForNotaryRequests(nil, &signer)
if err != nil {
c.logger.Error("could not restore notary notification subscription after RPC switch",