BTCP-Rebase/src
Wladimir J. van der Laan 262167393d
Merge #10952: [wallet] Remove vchDefaultKey and have better first run detection
e53615b Remove vchDefaultKey and have better first run detection (Andrew Chow)

Pull request description:

  Removes vchDefaultKey which was only used for first run detection. Improves wallet first run detection by checking to see if any keys were read from the database.

  This also fixes a (rather contrived) case where an encrypted non-HD wallet has corruption such that the default key is no longer valid and is loaded into a Core version that supports HD wallets. This causes a runtime exception since a new hd master key is generated as the software believes the wallet file is newly created but cannot add the generated key to the wallet since it is encrypted. I was only able to replicate this error by creating a non-hd wallet, encrypting it, then editing the wallet using `db_dump` and `db_load` before loading the wallet with hd enabled. This problem has been reported by [two](https://bitcointalk.org/index.php?topic=1993244.0) [users](https://bitcointalk.org/index.php?topic=1746976.msg17511261#msg17511261) so it is something that can happen, although that raises the question of "what corrupted the default key".

  ~P.S. I don't know what's up with the whitespace changes. I think my text editor is doing something stupid but I don't think those are important enough to attempt undoing them.~ Undid those

Tree-SHA512: 63b485f356566e8ffa033ad9b7101f7f6b56372b29ec2a43b947b0eeb1ada4c2cfe24740515d013aedd5f51aa1890dfbe499d2c5c062fc1b5d272324728a7d55
2017-08-18 18:56:49 +02:00
..
bench Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
compat
config
consensus scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
crypto Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
leveldb Update LevelDB with latest Bitcoin-specific patches 2017-08-01 12:40:42 -07:00
obj
obj-test
policy Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
primitives Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
qt Merge #11039: Avoid second mapWallet lookup 2017-08-18 16:25:59 +02:00
rpc Merge #11083: Fix combinerawtransaction RPC help result section 2017-08-18 09:52:48 +02:00
script Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
secp256k1
support Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
test Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
univalue Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
wallet Merge #10952: [wallet] Remove vchDefaultKey and have better first run detection 2017-08-18 18:56:49 +02:00
zmq Use nullptr instead of zero (0) as the null pointer constant 2017-08-16 10:24:18 +02:00
.clang-format
Makefile.am Protect SSE4 code behind a compile-time flag 2017-07-20 09:03:53 -07:00
Makefile.bench.include
Makefile.leveldb.include
Makefile.qt.include
Makefile.qttest.include
Makefile.test.include Fix test_bitcoin circular dependency issue 2017-07-17 17:42:21 +02:00
addrdb.cpp
addrdb.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
addrman.cpp scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
addrman.h scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
amount.h
arith_uint256.cpp
arith_uint256.h Prefer compile-time checking over run-time checking 2017-08-17 00:42:32 +02:00
base58.cpp Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
base58.h scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
bitcoin-cli-res.rc
bitcoin-cli.cpp scripted-diff: stop using the gArgs wrappers 2017-08-14 17:02:10 +02:00
bitcoin-tx-res.rc
bitcoin-tx.cpp scripted-diff: stop using the gArgs wrappers 2017-08-14 17:02:10 +02:00
bitcoind-res.rc
bitcoind.cpp scripted-diff: stop using the gArgs wrappers 2017-08-14 17:02:10 +02:00
blockencodings.cpp Fix typos 2017-07-15 14:28:40 +02:00
blockencodings.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
bloom.cpp
bloom.h
chain.cpp scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
chain.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
chainparams.cpp Update chain transaction statistics 2017-08-03 16:39:58 -07:00
chainparams.h
chainparamsbase.cpp scripted-diff: stop using the gArgs wrappers 2017-08-14 17:02:10 +02:00
chainparamsbase.h
chainparamsseeds.h p2p: Hardcoded seeds update pre-0.15 branch 2017-07-30 14:04:51 +02:00
checkpoints.cpp scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
checkpoints.h
checkqueue.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
clientversion.cpp
clientversion.h
coins.cpp Use nullptr instead of zero (0) as the null pointer constant 2017-08-16 10:24:18 +02:00
coins.h
compat.h Move CloseSocket out of SetSocketNonBlocking and pass SOCKET by const reference in SetSocket* functions 2017-07-22 09:11:55 +02:00
compressor.cpp
compressor.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
core_io.h rpc: Move ValueFromAmount to core_write 2017-08-07 17:01:21 +02:00
core_memusage.h
core_read.cpp
core_write.cpp Merge #10483: scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-14 16:30:59 +02:00
cuckoocache.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
dbwrapper.cpp Merge #9964: Add const to methods that do not modify the object for which it is called 2017-08-16 02:09:49 +02:00
dbwrapper.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
fs.cpp
fs.h
hash.cpp
hash.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
httprpc.cpp Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
httprpc.h
httpserver.cpp Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
httpserver.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
indirectmap.h
init.cpp Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
init.h init: Factor out AppInitLockDataDirectory 2017-07-17 14:56:52 +02:00
key.cpp scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
key.h Add length check for CExtKey deserialization 2017-08-17 21:54:23 +02:00
keystore.cpp
keystore.h
limitedmap.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
memusage.h
merkleblock.cpp Merge #9980: Fix mem access violation merkleblock 2017-07-17 15:12:39 -07:00
merkleblock.h Add const to methods that do not modify the object for which it is called 2017-07-25 13:46:52 +02:00
miner.cpp Merge #9964: Add const to methods that do not modify the object for which it is called 2017-08-16 02:09:49 +02:00
miner.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
net.cpp Use nullptr instead of zero (0) as the null pointer constant 2017-08-16 10:24:18 +02:00
net.h scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
net_processing.cpp Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
net_processing.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
netaddress.cpp scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
netaddress.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
netbase.cpp scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
netbase.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
netmessagemaker.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
noui.cpp
noui.h
pow.cpp scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
pow.h
prevector.h scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
protocol.cpp
protocol.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
pubkey.cpp scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
pubkey.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
random.cpp Document the preference of nullptr over NULL or (void*)0 2017-08-18 09:51:00 +02:00
random.h
rest.cpp Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
reverse_iterator.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
reverselock.h
scheduler.cpp Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
scheduler.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
serialize.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
streams.h Merge #9964: Add const to methods that do not modify the object for which it is called 2017-08-16 02:09:49 +02:00
sync.cpp Use nullptr instead of zero (0) as the null pointer constant 2017-08-16 10:24:18 +02:00
sync.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
threadinterrupt.cpp
threadinterrupt.h
threadsafety.h
timedata.cpp scripted-diff: stop using the gArgs wrappers 2017-08-14 17:02:10 +02:00
timedata.h
tinyformat.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
torcontrol.cpp Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
torcontrol.h
txdb.cpp Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
txdb.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
txmempool.cpp
txmempool.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
ui_interface.cpp
ui_interface.h
uint256.cpp
uint256.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
undo.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
util.cpp Merge #10901: Fix constness of ArgsManager methods 2017-08-16 16:09:27 +02:00
util.h Merge #10901: Fix constness of ArgsManager methods 2017-08-16 16:09:27 +02:00
utilmoneystr.cpp
utilmoneystr.h doc: Add comment to use ValueFromAmount/AmountFromValue for JSON, not utilmoneystr 2017-08-07 17:10:42 +02:00
utilstrencodings.cpp scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
utilstrencodings.h scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
utiltime.cpp scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
utiltime.h
validation.cpp Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
validation.h Use nullptr instead of zero (0) as the null pointer constant 2017-08-16 10:24:18 +02:00
validationinterface.cpp Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
validationinterface.h Remove declaration of unused function: void UpdatedTransaction(const uint256 &) 2017-07-15 20:04:04 +02:00
version.h
versionbits.cpp Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
versionbits.h scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL 2017-08-07 07:36:37 +02:00
warnings.cpp scripted-diff: stop using the gArgs wrappers 2017-08-14 17:02:10 +02:00
warnings.h remove some unused functions 2017-07-22 09:55:57 +02:00