Skip to content

Commit

Permalink
When the update key is changed, subscribe to the new key.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBab committed Jun 12, 2024
1 parent e403cfa commit 06a787d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/freenet/node/updater/NodeUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,14 @@ public synchronized boolean canUpdateNow() {
/** Called when the fetch URI has changed. No major locks are held by caller.
* @param uri The new URI. */
public void onChangeURI(FreenetURI uri) {
kill();
kill(); // unsubscribes from the old uri
this.URI = uri;
try {
USK myUsk = USK.create(URI.setSuggestedEdition(currentVersion));
core.getUskManager().subscribe(myUsk, this, true, getRequestClient());
} catch(MalformedURLException e) {
Logger.minor(this, "Cannot create update USK for correct version", e);
}
maybeUpdate();
}

Expand Down

0 comments on commit 06a787d

Please sign in to comment.