0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00
bitcoin-core/src
MarcoFalke 74ea1f3b0f
Merge #16399: wallet: Improve wallet creation
e967cae8fa Use switch on status in RpcWallet (Fabian Jahr)
ba1f128d6c Return error for ignored passphrase through disable private keys option (Fabian Jahr)
d6649d16b5 Use strong enum for WalletCreationStatus (Fabian Jahr)
3199610ad3 Place out args at the end for CreateWallet (Fabian Jahr)

Pull request description:

  This is a follow-up PR to #16244

  The following suggestions are included:
  - Usage of `enum class` (https://github.com/bitcoin/bitcoin/pull/16244#discussion_r296434142)
  - Placing out args at the end convention (https://github.com/bitcoin/bitcoin/pull/16244#discussion_r296434172)
  - Return error when passphrase would be ignored because of disabled private keys (including functional test) (https://github.com/bitcoin/bitcoin/pull/16244#pullrequestreview-252015195)
  - Make `status` return variable of `CreateWallet` (https://github.com/bitcoin/bitcoin/pull/16244#discussion_r302107394)
  - Using a `switch` statement instead of `if/else` in `RpcWallet` (https://github.com/bitcoin/bitcoin/pull/16244#discussion_r302112502)

  Not included was:
  - "new create wallet function [could take] separate option arguments instead of wallet flags" (https://github.com/bitcoin/bitcoin/pull/16244#pullrequestreview-252015195)
  - "blank wallet and disable private keys options could be combined into a single option" (https://github.com/bitcoin/bitcoin/pull/16244#pullrequestreview-252015195)

  For these last two changes, I was not sure what an ideal solution could look like and/or this might be of slightly larger scope than the other changes, but I would be happy to work on these as well in this PR or another follow-up if I get positive feedback on that. Is there a place in the codebase that handles flags like these in a better way that I can refer to? Nonetheless, I would prefer keeping it in a separate PR unless it is a really simple change.

ACKs for top commit:
  jnewbery:
    Code review utACK e967cae8fa
  MarcoFalke:
    ACK e967cae8fa

Tree-SHA512: 3d12880ff95add9e4a5702afa26ef38080b57b216a608c113a4d0a08ba2d61142c027ba0071c6402add45db90383eee0bada12dc42820dc0d602721d7175edd5
2019-07-29 09:36:55 -04:00
..
bench
compat
config
consensus
crypto
index scripted-diff: Make translation bilingual 2019-07-24 16:33:20 +03:00
interfaces Merge #16415: Get rid of PendingWalletTx class 2019-07-27 22:35:32 +12:00
leveldb
node
obj
obj-test
policy
primitives
qt Merge #16415: Get rid of PendingWalletTx class 2019-07-27 22:35:32 +12:00
rpc rpc: sendrawtransaction unconditionality/privacy note 2019-07-27 19:43:44 +02:00
script
secp256k1
support
test Refactor out translation.h 2019-07-24 16:32:53 +03:00
univalue
util scripted-diff: Make translation bilingual 2019-07-24 16:33:20 +03:00
wallet Merge #16399: wallet: Improve wallet creation 2019-07-29 09:36:55 -04:00
zmq
.clang-format
addrdb.cpp
addrdb.h
addrman.cpp
addrman.h
amount.h
arith_uint256.cpp
arith_uint256.h
attributes.h
banman.cpp scripted-diff: Make translation bilingual 2019-07-24 16:33:20 +03:00
banman.h
base58.cpp
base58.h
bech32.cpp
bech32.h
bitcoin-cli-res.rc
bitcoin-cli.cpp Refactor out translation.h 2019-07-24 16:32:53 +03:00
bitcoin-tx-res.rc
bitcoin-tx.cpp Refactor out translation.h 2019-07-24 16:32:53 +03:00
bitcoin-wallet-res.rc
bitcoin-wallet.cpp Refactor out translation.h 2019-07-24 16:32:53 +03:00
bitcoind-res.rc
bitcoind.cpp Trivial: add missing space 2019-07-28 13:33:10 -10:00
blockencodings.cpp
blockencodings.h
blockfilter.cpp
blockfilter.h
bloom.cpp
bloom.h
chain.cpp
chain.h
chainparams.cpp Remove wallet settings from chainparams 2019-07-16 16:22:14 -04:00
chainparams.h Remove wallet settings from chainparams 2019-07-16 16:22:14 -04:00
chainparamsbase.cpp
chainparamsbase.h Remove wallet settings from chainparams 2019-07-16 16:22:14 -04:00
chainparamsseeds.h
checkqueue.h
clientversion.cpp
clientversion.h
coins.cpp move-onlyish: move CCoinsViewErrorCatcher out of init.cpp 2019-07-21 21:00:31 -04:00
coins.h move-onlyish: move CCoinsViewErrorCatcher out of init.cpp 2019-07-21 21:00:31 -04:00
compat.h
compressor.cpp
compressor.h
core_io.h
core_memusage.h
core_read.cpp
core_write.cpp
cuckoocache.h
dbwrapper.cpp
dbwrapper.h
dummywallet.cpp
flatfile.cpp
flatfile.h
fs.cpp
fs.h
hash.cpp
hash.h
httprpc.cpp scripted-diff: Make translation bilingual 2019-07-24 16:33:20 +03:00
httprpc.h
httpserver.cpp
httpserver.h
indirectmap.h
init.cpp scripted-diff: Make translation bilingual 2019-07-24 16:33:20 +03:00
init.h
key.cpp
key.h
key_io.cpp
key_io.h
limitedmap.h
logging.cpp
logging.h
Makefile.am Refactor out translation.h 2019-07-24 16:32:53 +03:00
Makefile.bench.include
Makefile.leveldb.include
Makefile.qt.include
Makefile.qttest.include
Makefile.test.include
memusage.h
merkleblock.cpp
merkleblock.h
miner.cpp
miner.h
net.cpp scripted-diff: Make translation bilingual 2019-07-24 16:33:20 +03:00
net.h
net_processing.cpp
net_processing.h
netaddress.cpp
netaddress.h
netbase.cpp net: Make poll in InterruptibleRecv only filter for POLLIN events. 2019-07-18 13:04:16 +02:00
netbase.h
netmessagemaker.h
noui.cpp
noui.h
optional.h
outputtype.cpp
outputtype.h
pow.cpp
pow.h
prevector.h
protocol.cpp
protocol.h Remove unused bits from the service flags enum 2019-07-12 14:14:54 -04:00
psbt.cpp
psbt.h
pubkey.cpp
pubkey.h
random.cpp
random.h
rest.cpp
reverse_iterator.h
reverselock.h
scheduler.cpp
scheduler.h
serialize.h
shutdown.cpp
shutdown.h
span.h
streams.h
sync.cpp
sync.h
threadinterrupt.cpp
threadinterrupt.h
threadsafety.h
timedata.cpp scripted-diff: Make translation bilingual 2019-07-24 16:33:20 +03:00
timedata.h
tinyformat.h
torcontrol.cpp fix: tor: Call event_base_loopbreak from the event's callback 2019-07-17 15:32:38 +01:00
torcontrol.h
txdb.cpp scripted-diff: Make translation bilingual 2019-07-24 16:33:20 +03:00
txdb.h
txmempool.cpp
txmempool.h
ui_interface.cpp
ui_interface.h
uint256.cpp
uint256.h
undo.h
validation.cpp Merge #15305: [validation] Crash if disconnecting a block fails 2019-07-25 09:05:22 +08:00
validation.h Merge #15681: [mempool] Allow one extra single-ancestor transaction per package 2019-07-19 20:00:12 +02:00
validationinterface.cpp
validationinterface.h
version.h
versionbits.cpp
versionbits.h
versionbitsinfo.cpp
versionbitsinfo.h
walletinitinterface.h
warnings.cpp scripted-diff: Make translation bilingual 2019-07-24 16:33:20 +03:00
warnings.h