CA: Use CAssetsDir that inits from config instead of wallet

- Don't maintain asset petnames in wallet.
- RPC: Remove addassetlabel
- Remove load functions in CWallet for asset labels.
- "bitcoin" already hardcoded in CAssetsDir::InitFromStrings, remove from CWallet::InitLoadWallet
- Remove CWallet::SetAssetPair
This commit is contained in:
Jorge Timón 2017-03-15 20:48:31 +01:00 committed by Gregory Sanders
parent bd48b5ed7b
commit 3cd9298b08
7 changed files with 21 additions and 122 deletions

View file

@ -17,6 +17,7 @@
#include "checkpoints.h"
#include "compat/sanity.h"
#include "consensus/validation.h"
#include "global/common.h"
#include "httpserver.h"
#include "httprpc.h"
#include "key.h"
@ -414,6 +415,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-limitancestorsize=<n>", strprintf("Do not accept transactions whose size with all in-mempool ancestors exceeds <n> kilobytes (default: %u)", DEFAULT_ANCESTOR_SIZE_LIMIT));
strUsage += HelpMessageOpt("-limitdescendantcount=<n>", strprintf("Do not accept transactions if any ancestor would have <n> or more in-mempool descendants (default: %u)", DEFAULT_DESCENDANT_LIMIT));
strUsage += HelpMessageOpt("-limitdescendantsize=<n>", strprintf("Do not accept transactions if any ancestor would have more than <n> kilobytes of in-mempool descendants (default: %u).", DEFAULT_DESCENDANT_SIZE_LIMIT));
strUsage += HelpMessageOpt("-assetdir=hexidstr:label", "For naming known assets");
strUsage += HelpMessageOpt("-bip9params=deployment:start:end", "Use given start/end times for specified bip9 deployment (regtest-only)");
}
string debugCategories = "addrman, alert, bench, coindb, db, http, libevent, lock, mempool, mempoolrej, net, proxy, prune, rand, reindex, rpc, selectcoins, tor, zmq"; // Don't translate these and qt below
@ -998,6 +1000,12 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
fEnableReplacement = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), "fee") != vstrReplacementModes.end());
}
try {
InitGlobalAssetDir(mapMultiArgs["-assetdir"]);
} catch (const std::exception& e) {
return InitError(strprintf("Error in -assetdir: %s\n", e.what()));
}
if (!mapMultiArgs["-bip9params"].empty()) {
// Allow overriding bip9 parameters for testing
if (!Params().MineBlocksOnDemand()) {