func (h *Host) loadCompatV100(p *persistence) error {
	var compatPersistence struct {
		FinancialMetrics struct {
			PotentialStorageRevenue types.Currency `json:"potentialerevenue"`
		}
		Settings struct {
			MinContractPrice          types.Currency `json:"contractprice"`
			MinDownloadBandwidthPrice types.Currency `json:"minimumdownloadbandwidthprice"`
			MinStoragePrice           types.Currency `json:"storageprice"`
			MinUploadBandwidthPrice   types.Currency `json:"minimumuploadbandwidthprice"`
		}
	}
	err := h.dependencies.LoadFile(v112PersistMetadata, &compatPersistence, filepath.Join(h.persistDir, settingsFile))
	if err != nil {
		return err
	}
	if !compatPersistence.FinancialMetrics.PotentialStorageRevenue.IsZero() && p.FinancialMetrics.PotentialStorageRevenue.IsZero() {
		h.financialMetrics.PotentialStorageRevenue = compatPersistence.FinancialMetrics.PotentialStorageRevenue
	}
	if !compatPersistence.Settings.MinContractPrice.IsZero() && p.Settings.MinContractPrice.IsZero() {
		h.settings.MinContractPrice = compatPersistence.Settings.MinContractPrice
	}
	if !compatPersistence.Settings.MinDownloadBandwidthPrice.IsZero() && p.Settings.MinDownloadBandwidthPrice.IsZero() {
		h.settings.MinDownloadBandwidthPrice = compatPersistence.Settings.MinDownloadBandwidthPrice
	}
	if !compatPersistence.Settings.MinStoragePrice.IsZero() && p.Settings.MinStoragePrice.IsZero() {
		h.settings.MinStoragePrice = compatPersistence.Settings.MinStoragePrice
	}
	if !compatPersistence.Settings.MinUploadBandwidthPrice.IsZero() && p.Settings.MinUploadBandwidthPrice.IsZero() {
		h.settings.MinUploadBandwidthPrice = compatPersistence.Settings.MinUploadBandwidthPrice
	}
	return nil
}
loadCompatV100 loads fields that have changed names or otherwise broken
compatibility with previous versions, enabling users to upgrade without
unexpected loss of data.

COMPAT v1.0.0

A spelling error in pre-1.0 versions means that, if this is the first time
running after an upgrade, the misspelled field needs to be transferred over.
package host
import (
	"encoding/hex"
	"encoding/json"
	"errors"
	"io/ioutil"
	"os"
	"path/filepath"
	"sync"
	"github.com/coreos/bbolt"
	"github.com/NebulousLabs/Sia/build"
	"github.com/NebulousLabs/Sia/crypto"
	"github.com/NebulousLabs/Sia/modules"
	"github.com/NebulousLabs/Sia/persist"
	"github.com/NebulousLabs/Sia/types"
)
const (
	contractManagerStorageFolderGranularity = 64
	v112StorageManagerDBFilename      = "storagemanager.db"
	v112StorageManagerDir             = "storagemanager"
	v112StorageManagerPersistFilename = "storagemanager.json"
)
var (
	minimumStorageFolderSize = contractManagerStorageFolderGranularity * modules.SectorSize
	v112PersistMetadata = persist.Metadata{
		Header:  "Sia Host",
		Version: "0.5",
	}
	v112StorageManagerBucketSectorUsage = []byte("BucketSectorUsage")
	v112StorageManagerDBMetadata = persist.Metadata{
		Header:  "Sia Storage Manager DB",
		Version: "0.6.0",
	}
	v112StorageManagerMetadata = persist.Metadata{
		Header:  "Sia Storage Manager",
		Version: "0.6.0",
	}
)
type (
	v112StorageManagerPersist struct {
		SectorSalt     crypto.Hash
		StorageFolders []*v112StorageManagerStorageFolder
	}
	v112StorageManagerSector struct {
		Count int
		Data  []byte
		Key   []byte
		Root  crypto.Hash
	}
	v112StorageManagerSectorUsage struct {
		Corrupted     bool
		Expiry        []types.BlockHeight
		StorageFolder []byte
	}
	v112StorageManagerStorageFolder struct {
		Path          string
		Size          uint64
		SizeRemaining uint64
		UID           []byte
	}
)