[NebulousLabs/Sia] Persist renter cache settings, and renter bandwidth limiter settings (#3052)

DavidVorick commented on this pull request.

> +func (r *Renter) updatePersistVersionFrom040To133() error {
+ metadata := persist.Metadata{
+ Header: settingsMetadata.Header,
+ Version: persistVersion040,
+ }
+
+ err := persist.LoadJSON(metadata, &r.persist, filepath.Join(r.persistDir, PersistFilename))
+ if err != nil {
+ return err
+ }
+ metadata.Version = persistVersion133
+ r.persist.MaxDownloadSpeed = DefaultMaxDownloadSpeed
+ r.persist.MaxUploadSpeed = DefaultMaxUploadSpeed
+ r.persist.StreamCacheSize = DefaultStreamCacheSize
+ return persist.SaveJSON(metadata, r.persist, filepath.Join(r.persistDir, PersistFilename))
+}

alright

Добавить комментарий