Skip to content

Commit

Permalink
Merge #2351: [Wallet] Laggard wallet-related backports from btc 0.15
Browse files Browse the repository at this point in the history
d5526bd Wrap dumpwallet warning and note scripts aren't dumped (MeshCollider)
3711c6a Add wallet backup text to import*, add* and dumpwallet RPCs (MeshCollider)
dbda874 [Wallet] always show help-line of wallet encryption calls (Jonas Schnelli)
20c269b Avoid opening copied wallet databases simultaneously (Russell Yanofsky)
e411b70 [wallet] Fix leak in CDB constructor (João Barbosa)
f15aeea Change getmininginfo errors field to warnings (Andrew Chow)
c04390b Unify help text for GetWarnings output in get*info RPCs (random-zebra)
1d966ce Add warnings field to getblockchaininfo (Andrew Chow)
ffcd781 [Trivial] Cleanup after MOVE-ONLY commits (random-zebra)
e067235 MOVEONLY: Init functions wallet/wallet.cpp -> wallet/init.cpp (random-zebra)
e947eec MOVEONLY: Fee functions wallet/wallet.cpp -> wallet/fees.cpp (random-zebra)
2188c3e Move some static functions out of wallet.h/cpp (random-zebra)
f49acf7 [wallet] [moveonly] Move CAffectedKeysVisitor (random-zebra)
8bd979f [wallet] Specify wallet name in wallet loading errors (random-zebra)
900bbfa Reject invalid wallet files (João Barbosa)
a1f4e2a Reject duplicate wallet filenames (random-zebra)
ee52c2e Fix misleading "Method not found" multiwallet errors (Russell Yanofsky)
ce35e1e [Qt] Use wallet 0 in rpc console if running with multiple wallets (random-zebra)
37089d1 [tests] Update wallet_multiwallet.py functional test (random-zebra)
3955ee9 [Doc] Update release notes (random-zebra)
4fd5913 [wallet] [rpc] Add listwallets RPC (John Newbery)
1525281 [wallet] [rpc] print wallet name in getwalletinfo (John Newbery)
fdf5da0 [wallet] fix comment for CWallet::Verify() (John Newbery)
cf4a90b Remove factor of 3 from definition of dust. (random-zebra)
a1c56fd [Policy] Introduce -dustrelayfee (random-zebra)
9fb29cc [Doc] Update multiwallet release notes (random-zebra)
379255e [Tests][Trivial] Add wallet_multiwallet.py to test_runner (random-zebra)
808fbc3 [Bugfix] consider boolean value of -zapwallettxes ParameterInteraction (random-zebra)
f9141f8 [QA] Add wallet_multiwallet.py functional test (John Newbery)
2e02006 Rename -usewallet to -rpcwallet (Alex Morcos)
a64440b Select wallet based on the given endpoint (Jonas Schnelli)
5683a9c Complete previous commit by moving mn stuff out of libbitcoin_wallet (random-zebra)
b0fe92f Fix test_pivx circular dependency issue (random-zebra)
6cb2b92 Add wallet endpoint support to bitcoin-cli (-usewallet) (Jonas Schnelli)
7dd3916 Register wallet endpoint (Jonas Schnelli)
5bd1bd7 Properly forbid -salvagewallet and -zapwallettxes for multi wallet. (Alex Morcos)
41a7335 Remove unused variables (practicalswift)
5c3d73f Avoid CWalletTx copies in GetAddressBalances and GetAddressGroupings (Russell Yanofsky)
e7cafab [Refactoring] Mimic ListCoins for sapling notes (random-zebra)
54fa122 [qt] Move some WalletModel functions into CWallet (random-zebra)
494ba64 [test] Add test for getmemoryinfo (random-zebra)
2394083 [Wallet] unset change position when there is no change on exact match (Gregory Sanders)
7d977ac Remove unused C++ code not covered by unit tests (random-zebra)
60bb4da ApproximateBestSubset should take inputs by reference, not value (Ryan Havar)
3633d75 Initialize nRelockTime (Patrick Strateman)
3a599d0 [Refactor] Return safeTx boolean in CheckTXAvailability (random-zebra)
f219be9 Add safe flag to listunspent result (NicolasDorier)
0201065 Add COutput::fSafe member for safe handling of unconfirmed outputs (random-zebra)
75c8c6d Disallow copy of CReserveKeys (Gregory Sanders)
8378322 [Refactor] Replace optional reserveKey in PBF with unique pointer (random-zebra)

Pull request description:

  I think these are all the remaining Bitcoin Core v0.15 PRs in the wallet area that we don't have yet, and are useful to us.
  I've grouped them here since they are all pretty small, simple, and narrow-focused (on the wallet/rpcwallet files).

  This changeset is based on top of
  - [x] #2337

  as it keeps going with the multiwallet implementation, adding:
  - RPC endpoint support
  - `listwallets` RPC
  - wallet name in `getwalletinfo` RPC
  - `wallet_multiwallet.py` functional test

  As in some areas we are much closer to upstream, some of the commits needed adaptations (especially the functional tests). A couple of commits have been extended to include shield-related code.

  List of upstream PRs backported/adapted:

  - bitcoin#9906  : Disallow copy constructor CReserveKeys
  - bitcoin#9830  : Add safe flag to listunspent result
  - bitcoin#9993  : Initialize nRelockTime
  - bitcoin#10108 : ApproximateBestSubset should take inputs by reference, not value
  - bitcoin#10075 : Remove unused C++ code not covered by unit tests
  - bitcoin#10257 : Add test for getmemoryinfo
  - bitcoin#10295 : Move some WalletModel functions into CWallet
  - bitcoin#10500 : Avoid CWalletTx copies in GetAddressBalances and GetAddressGroupings
  - bitcoin#10522 : Remove unused variables
  - bitcoin#10816 : Properly forbid -salvagewallet and -zapwallettxes for multi wallet
  - bitcoin#10849 : Multiwallet: simplest endpoint support
  - bitcoin#9380  : Separate different uses of minimum fees (only dustRelayFee)
  - bitcoin#10817 : Redefine Dust and add a discard_rate (only first commit)
  - bitcoin#10883 : Rename -usewallet to -rpcwallet
  - bitcoin#10604 : Add listwallets RPC, include wallet name in getwalletinfo + tests
  - bitcoin#10893 : Avoid running multiwallet.py twice
  - bitcoin#10870 : Use wallet 0 in rpc console if running with multiple wallets
  - bitcoin#10931 : Fix misleading "method not found" multiwallet errors
  - bitcoin#10885 : Reject invalid wallets
  - bitcoin#11022 : Basic keypool topup
  - bitcoin#10976 : [MOVEONLY] Move some static functions out of wallet.h/cpp
  - bitcoin#11310 : Test listwallets RPC
  - bitcoin#10858 : "errors" to getblockchaininfo + unify "errors" field in get*info RPCs
  - bitcoin#11492 : Fix leak in CDB constructor
  - bitcoin#11476 : Avoid opening copied wallet databases simultaneously
  - bitcoin#11590 : always show help-line of wallet encryption calls
  - bitcoin#11289 : Add wallet backup text to import* and add* RPCs

ACKs for top commit:
  furszy:
    re-re-utACK d5526bd.
  Fuzzbawls:
    ACK d5526bd

Tree-SHA512: 115c4916ee212539b0a1b2cb25783ddf6753f5376de739a084191e874ed8717fff2c7cd9d744e397891f14eaa459ef2f48d675168621ef7316e81758fa6559f2
  • Loading branch information
random-zebra committed Jun 9, 2021
2 parents f752684 + d5526bd commit 2d50b6e
Show file tree
Hide file tree
Showing 49 changed files with 1,113 additions and 570 deletions.
30 changes: 16 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,28 +251,16 @@ if(ZMQ_FOUND)
endif()

set(WALLET_SOURCES
./src/activemasternode.cpp
./src/bip38.cpp
./src/wallet/db.cpp
./src/addressbook.cpp
./src/crypter.cpp
./src/budget/budgetdb.cpp
./src/budget/budgetmanager.cpp
./src/budget/budgetproposal.cpp
./src/budget/budgetvote.cpp
./src/budget/finalizedbudget.cpp
./src/budget/finalizedbudgetvote.cpp
./src/masternode.cpp
./src/masternode-payments.cpp
./src/masternode-sync.cpp
./src/tiertwo_networksync.cpp
./src/masternodeconfig.cpp
./src/masternodeman.cpp
./src/messagesigner.cpp
./src/zpiv/mintpool.cpp
./src/wallet/hdchain.cpp
./src/wallet/rpcdump.cpp
./src/zpiv/zerocoin.cpp
./src/wallet/fees.cpp
./src/wallet/init.cpp
./src/wallet/scriptpubkeyman.cpp
./src/wallet/rpcwallet.cpp
./src/kernel.cpp
Expand Down Expand Up @@ -353,8 +341,15 @@ add_library(ZEROCOIN_A STATIC ${ZEROCOIN_SOURCES})
target_include_directories(ZEROCOIN_A PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)

set(COMMON_SOURCES
./src/activemasternode.cpp
./src/base58.cpp
./src/bip38.cpp
./src/budget/budgetdb.cpp
./src/budget/budgetmanager.cpp
./src/budget/budgetproposal.cpp
./src/budget/budgetvote.cpp
./src/budget/finalizedbudget.cpp
./src/budget/finalizedbudgetvote.cpp
./src/consensus/params.cpp
./src/consensus/upgrades.cpp
./src/chainparams.cpp
Expand All @@ -377,6 +372,12 @@ set(COMMON_SOURCES
./src/invalid.cpp
./src/key.cpp
./src/keystore.cpp
./src/masternode.cpp
./src/masternode-payments.cpp
./src/masternode-sync.cpp
./src/masternodeconfig.cpp
./src/masternodeman.cpp
./src/messagesigner.cpp
./src/netaddress.cpp
./src/netbase.cpp
./src/policy/feerate.cpp
Expand All @@ -391,6 +392,7 @@ set(COMMON_SOURCES
./src/script/script_error.cpp
./src/spork.cpp
./src/sporkdb.cpp
./src/tiertwo_networksync.cpp
./src/warnings.cpp
)
add_library(COMMON_A STATIC ${BitcoinHeaders} ${COMMON_SOURCES})
Expand Down
23 changes: 20 additions & 3 deletions doc/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Notable Changes

(Developers: add your notes here as part of your pull requests whenever possible)


Cold-Staking Re-Activation
--------------------------
PIVX Core v6.0.0 includes a fix for the vulnerability identified within the cold-staking protocol (see PR [#2258](https://github.com/PIVX-Project/PIVX/pull/2258)).
Expand All @@ -60,13 +61,24 @@ Scripts with the old opcode are still accepted on the network (the restriction o
Multi-wallet support
--------------------

PIVX Core now supports loading multiple, separate wallets (See [PR 2337](https://github.com/PIVX-Project/PIVX/pull/2337)). The wallets are completely separated, with individual balances, keys and received transactions.
PIVX Core now supports loading multiple, separate wallets (See [PR #2337](https://github.com/PIVX-Project/PIVX/pull/2337)). The wallets are completely separated, with individual balances, keys and received transactions.

Multi-wallet is enabled by using more than one `-wallet` argument when starting PIVX client, either on the command line or in the pivx.conf config file.

**In pivx-qt, only the first wallet will be displayed and accessible for creating and signing transactions.** GUI selectable multiple wallets will be supported in a future version. However, even in 6.0 other loaded wallets will remain synchronized to the node's current tip in the background.

!TODO: update after endpoint support and multi-wallet RPC support
PIVX Core 6.0.0 contains the following changes to the RPC interface and pivx-cli for multi-wallet:

* When running PIVX Core with a single wallet, there are **no** changes to the RPC interface or `pivx-cli`. All RPC calls and `pivx-cli` commands continue to work as before.
* When running PIVX Core with multi-wallet, all *node-level* RPC methods continue to work as before. HTTP RPC requests should be send to the normal `<RPC IP address>:<RPC port>` endpoint, and `pivx-cli` commands should be run as before. A *node-level* RPC method is any method which does not require access to the wallet.
* When running PIVX Core with multi-wallet, *wallet-level* RPC methods must specify the wallet for which they're intended in every request. HTTP RPC requests should be send to the `<RPC IP address>:<RPC port>/wallet/<wallet name>` endpoint, for example `127.0.0.1:8332/wallet/wallet1.dat`. `pivx-cli` commands should be run with a `-rpcwallet` option, for example `pivx-cli -rpcwallet=wallet1.dat getbalance`.

* A new *node-level* `listwallets` RPC method is added to display which wallets are currently loaded. The names returned by this method are the same as those used in the HTTP endpoint and for the `rpcwallet` argument.

The `getwalletinfo` RPC method returns the name of the wallet used for the query.

Note that while multi-wallet is now fully supported, the RPC multi-wallet interface should be considered unstable for version 6.0.0, and there may backwards-incompatible changes in future versions.



GUI changes
Expand Down Expand Up @@ -125,13 +137,18 @@ A new init option flag '-blocksdir' will allow one to keep the blockfiles extern
Low-level RPC changes
---------------------

- The `listunspent` RPC now takes a `query_options` argument (see [PR 2317](https://github.com/PIVX-Project/PIVX/pull/2317)), which is a JSON object
- The `listunspent` RPC now takes a `query_options` argument (see [PR #2317](https://github.com/PIVX-Project/PIVX/pull/2317)), which is a JSON object
containing one or more of the following members:
- `minimumAmount` - a number specifying the minimum value of each UTXO
- `maximumAmount` - a number specifying the maximum value of each UTXO
- `maximumCount` - a number specifying the minimum number of UTXOs
- `minimumSumAmount` - a number specifying the minimum sum value of all UTXOs

- The `listunspent` RPC also takes an additional boolean argument `include_unsafe` (true by default) to optionally exclude "unsafe" utxos.
An unconfirmed output from outside keys is considered unsafe (see [PR #2351](https://github.com/PIVX-Project/PIVX/pull/2351)).

- The `listunspent` output also shows whether the utxo is considered safe to spend or not.

- the `stop` RPC no longer accepts the (already deprecated, ignored, and undocumented) optional boolean argument `detach`.


Expand Down
32 changes: 18 additions & 14 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ BITCOIN_CORE_H = \
wallet/rpcwallet.h \
wallet/scriptpubkeyman.h \
destination_io.h \
wallet/fees.h \
wallet/init.h \
wallet/wallet.h \
wallet/walletdb.h \
warnings.h \
Expand Down Expand Up @@ -386,28 +388,16 @@ endif
libbitcoin_wallet_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
libbitcoin_wallet_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libbitcoin_wallet_a_SOURCES = \
activemasternode.cpp \
bip38.cpp \
interfaces/wallet.cpp \
addressbook.cpp \
crypter.cpp \
key_io.cpp \
budget/budgetdb.cpp \
budget/budgetmanager.cpp \
budget/budgetproposal.cpp \
budget/budgetvote.cpp \
budget/finalizedbudget.cpp \
budget/finalizedbudgetvote.cpp \
masternode.cpp \
masternode-payments.cpp \
tiertwo_networksync.cpp \
masternode-sync.cpp \
masternodeconfig.cpp \
masternodeman.cpp \
messagesigner.cpp \
legacy/stakemodifier.cpp \
kernel.cpp \
wallet/db.cpp \
wallet/fees.cpp \
wallet/init.cpp \
wallet/rpcdump.cpp \
wallet/rpcwallet.cpp \
wallet/hdchain.cpp \
Expand Down Expand Up @@ -490,8 +480,15 @@ libzerocoin_libbitcoin_zerocoin_a_SOURCES = \
libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libbitcoin_common_a_SOURCES = \
activemasternode.cpp \
base58.cpp \
bip38.cpp \
budget/budgetdb.cpp \
budget/budgetmanager.cpp \
budget/budgetproposal.cpp \
budget/budgetvote.cpp \
budget/finalizedbudget.cpp \
budget/finalizedbudgetvote.cpp \
chainparams.cpp \
consensus/upgrades.cpp \
coins.cpp \
Expand All @@ -506,6 +503,12 @@ libbitcoin_common_a_SOURCES = \
invalid.cpp \
key.cpp \
keystore.cpp \
masternode.cpp \
masternode-payments.cpp \
masternode-sync.cpp \
masternodeconfig.cpp \
masternodeman.cpp \
messagesigner.cpp \
netaddress.cpp \
netbase.cpp \
policy/feerate.cpp \
Expand All @@ -517,6 +520,7 @@ libbitcoin_common_a_SOURCES = \
script/script.cpp \
script/sign.cpp \
script/standard.cpp \
tiertwo_networksync.cpp \
warnings.cpp \
script/script_error.cpp \
spork.cpp \
Expand Down
6 changes: 3 additions & 3 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ test_test_pivx_SOURCES = $(BITCOIN_TEST_SUITE) $(BITCOIN_TESTS) $(SAPLING_TESTS)
test_test_pivx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_FLAGS)
test_test_pivx_LDADD =

test_test_pivx_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBBITCOIN_ZEROCOIN) \
$(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(LIBSAPLING) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)

if ENABLE_WALLET
test_test_pivx_LDADD += $(LIBBITCOIN_WALLET)
endif

test_test_pivx_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBBITCOIN_ZEROCOIN) \
$(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(LIBSAPLING) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)

test_test_pivx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

test_test_pivx_LDADD += $(LIBRUSTZCASH) $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(MINIUPNPC_LIBS) $(LIBZCASH_LIBS)
Expand Down
2 changes: 2 additions & 0 deletions src/guiinterfaceutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#define GUIINTERFACEUTIL_H

#include "guiinterface.h"
#include "tinyformat.h"
#include "util/system.h"

inline static bool UIError(const std::string &str)
{
Expand Down
5 changes: 4 additions & 1 deletion src/httprpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ bool StartHTTPRPC()
return false;

RegisterHTTPHandler("/", true, HTTPReq_JSONRPC);

#ifdef ENABLE_WALLET
// ifdef can be removed once we switch to better endpoint support and API versioning
RegisterHTTPHandler("/wallet/", false, HTTPReq_JSONRPC);
#endif
assert(EventBase());
httpRPCTimerInterface = new HTTPRPCTimerInterface(EventBase());
RPCSetTimerInterface(httpRPCTimerInterface);
Expand Down
16 changes: 14 additions & 2 deletions src/httpserver.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2015 The Bitcoin Core developers
// Copyright (c) 2018-2020 The PIVX developers
// Copyright (c) 2015-2021 The Bitcoin Core developers
// Copyright (c) 2018-2021 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand Down Expand Up @@ -679,3 +679,15 @@ void UnregisterHTTPHandler(const std::string &prefix, bool exactMatch)
pathHandlers.erase(i);
}
}

std::string urlDecode(const std::string &urlEncoded) {
std::string res;
if (!urlEncoded.empty()) {
char *decoded = evhttp_uridecode(urlEncoded.c_str(), false, NULL);
if (decoded) {
res = std::string(decoded);
free(decoded);
}
}
return res;
}
11 changes: 7 additions & 4 deletions src/httpserver.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Copyright (c) 2015 The Bitcoin Core developers
// Copyright (c) 2015-2021 The Bitcoin Core developers
// Copyright (c) 2021 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_HTTPSERVER_H
#define BITCOIN_HTTPSERVER_H
#ifndef PIVX_HTTPSERVER_H
#define PIVX_HTTPSERVER_H

#include <string>
#include <stdint.h>
Expand Down Expand Up @@ -148,4 +149,6 @@ class HTTPEvent
struct event* ev;
};

#endif // BITCOIN_HTTPSERVER_H
std::string urlDecode(const std::string &urlEncoded);

#endif // PIVX_HTTPSERVER_H
22 changes: 16 additions & 6 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@
#include "validation.h"
#include "validationinterface.h"
#include "zpivchain.h"
#include "warnings.h"

#ifdef ENABLE_WALLET
#include "wallet/init.h"
#include "wallet/wallet.h"
#include "wallet/rpcwallet.h"

#endif
#include "warnings.h"

#include <atomic>
#include <fstream>
Expand Down Expand Up @@ -507,7 +507,7 @@ std::string HelpMessage(HelpMessageMode mode)
" " + _("Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway"));

#if ENABLE_WALLET
strUsage += CWallet::GetWalletHelpString(showDebug);
strUsage += GetWalletHelpString(showDebug);
#endif

if (mode == HMM_BITCOIN_QT) {
Expand Down Expand Up @@ -561,6 +561,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-minrelaytxfee=<amt>", strprintf(_("Fees (in %s/Kb) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)"), CURRENCY_UNIT, FormatMoney(::minRelayTxFee.GetFeePerK())));
strUsage += HelpMessageOpt("-printtoconsole", strprintf(_("Send trace/debug info to console instead of debug.log file (default: %u)"), 0));
if (showDebug) {
strUsage += HelpMessageOpt("-dustrelayfee=<amt>", strprintf("Fee rate (in %s/kB) used to define dust, the value of an output such that it will cost more than its value in fees at this fee rate to spend it. (default: %s)", CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE)));
strUsage += HelpMessageOpt("-printpriority", strprintf(_("Log transaction priority and fee per kB when mining blocks (default: %u)"), DEFAULT_PRINTPRIORITY));
}
strUsage += HelpMessageOpt("-shrinkdebugfile", _("Shrink debug.log file on client startup (default: 1 when no -debug)"));
Expand Down Expand Up @@ -1146,9 +1147,18 @@ bool AppInitParameterInteraction()
if (!chainparams.IsTestChain() && !fRequireStandard)
return UIError(strprintf("%s is not currently supported for %s chain", "-acceptnonstdtxn", chainparams.NetworkIDString()));

// Feerate used to define dust. Shouldn't be changed lightly as old
// implementations may inadvertently create non-standard transactions
if (gArgs.IsArgSet("-dustrelayfee")) {
CAmount n = 0;
if (!ParseMoney(gArgs.GetArg("-dustrelayfee", ""), n) || 0 == n)
return UIError(AmountErrMsg("dustrelayfee", gArgs.GetArg("-dustrelayfee", "")));
dustRelayFee = CFeeRate(n);
}

#ifdef ENABLE_WALLET
strWalletFile = gArgs.GetArg("-wallet", DEFAULT_WALLET_DAT);
if (!CWallet::ParameterInteraction())
if (!WalletParameterInteraction())
return false;
#endif // ENABLE_WALLET

Expand Down Expand Up @@ -1322,7 +1332,7 @@ bool AppInitMain()

// ********************************************************* Step 5: Verify wallet database integrity
#ifdef ENABLE_WALLET
if (!CWallet::Verify()) {
if (!WalletVerify()) {
return false;
}
#endif
Expand Down Expand Up @@ -1711,7 +1721,7 @@ bool AppInitMain()

// ********************************************************* Step 8: Backup and Load wallet
#ifdef ENABLE_WALLET
if (!CWallet::InitLoadWallet())
if (!InitLoadWallet())
return false;
#else
LogPrintf("No wallet compiled in!\n");
Expand Down
Loading

0 comments on commit 2d50b6e

Please sign in to comment.