Skip to content

Commit

Permalink
fix node update issue
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <[email protected]>
  • Loading branch information
jeromy-cannon committed Jan 8, 2025
1 parent 4685ff3 commit 572b581
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/commands/node/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,7 @@ export class NodeCommandTasks {
);
await sleep(Duration.ofSeconds(60));
const accountMap = getNodeAccountMap(config.allNodeAliases);
let skipNodeAlias: NodeAlias;

switch (transactionType) {
case NodeSubcommandType.ADD:
Expand All @@ -1044,18 +1045,17 @@ export class NodeCommandTasks {
if (config.newAccountNumber) {
// update map with current account ids
accountMap.set(config.nodeAlias, config.newAccountNumber);

// update _nodeClient with the new service map since one of the account number has changed
await self.accountManager.refreshNodeClient(config.namespace);
skipNodeAlias = config.nodeAlias;
}
break;
case NodeSubcommandType.DELETE:
if (config.nodeAlias) {
accountMap.delete(config.nodeAlias);
skipNodeAlias = config.nodeAlias;
}
}

config.nodeClient = await self.accountManager.loadNodeClient(config.namespace);
config.nodeClient = await self.accountManager.refreshNodeClient(config.namespace, skipNodeAlias);

// send some write transactions to invoke the handler that will trigger the stake weight recalculate
for (const nodeAlias of accountMap.keys()) {
Expand Down

0 comments on commit 572b581

Please sign in to comment.