Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 4,390 Lines • ▼ Show 20 Lines | if (nLoadWalletRet != DBErrors::LOAD_OK) { | ||||
_(PACKAGE_NAME))); | _(PACKAGE_NAME))); | ||||
return nullptr; | return nullptr; | ||||
} else { | } else { | ||||
InitError(strprintf(_("Error loading %s"), walletFile)); | InitError(strprintf(_("Error loading %s"), walletFile)); | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
} | } | ||||
uiInterface.LoadWallet(walletInstance); | |||||
int prev_version = walletInstance->nWalletVersion; | int prev_version = walletInstance->nWalletVersion; | ||||
if (gArgs.GetBoolArg("-upgradewallet", fFirstRun)) { | if (gArgs.GetBoolArg("-upgradewallet", fFirstRun)) { | ||||
int nMaxVersion = gArgs.GetArg("-upgradewallet", 0); | int nMaxVersion = gArgs.GetArg("-upgradewallet", 0); | ||||
// The -upgradewallet without argument case | // The -upgradewallet without argument case | ||||
if (nMaxVersion == 0) { | if (nMaxVersion == 0) { | ||||
LogPrintf("Performing wallet upgrade to %i\n", FEATURE_LATEST); | LogPrintf("Performing wallet upgrade to %i\n", FEATURE_LATEST); | ||||
nMaxVersion = CLIENT_VERSION; | nMaxVersion = CLIENT_VERSION; | ||||
// permanently upgrade the wallet immediately | // permanently upgrade the wallet immediately | ||||
▲ Show 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | if (chainActive.Tip() && chainActive.Tip() != pindexRescan) { | ||||
copyTo->strFromAccount = copyFrom->strFromAccount; | copyTo->strFromAccount = copyFrom->strFromAccount; | ||||
copyTo->nOrderPos = copyFrom->nOrderPos; | copyTo->nOrderPos = copyFrom->nOrderPos; | ||||
batch.WriteTx(*copyTo); | batch.WriteTx(*copyTo); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
uiInterface.LoadWallet(walletInstance); | |||||
// Register with the validation interface. It's ok to do this after rescan | // Register with the validation interface. It's ok to do this after rescan | ||||
// since we're still holding cs_main. | // since we're still holding cs_main. | ||||
RegisterValidationInterface(walletInstance.get()); | RegisterValidationInterface(walletInstance.get()); | ||||
walletInstance->SetBroadcastTransactions( | walletInstance->SetBroadcastTransactions( | ||||
gArgs.GetBoolArg("-walletbroadcast", DEFAULT_WALLETBROADCAST)); | gArgs.GetBoolArg("-walletbroadcast", DEFAULT_WALLETBROADCAST)); | ||||
LOCK(walletInstance->cs_wallet); | LOCK(walletInstance->cs_wallet); | ||||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |