aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-08-07scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal ↵practicalswift
instead of the macro NULL -BEGIN VERIFY SCRIPT- sed -i 's/\<NULL\>/nullptr/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h src/qt/*/*.cpp src/qt/*/*.h src/wallet/*/*.cpp src/wallet/*/*.h src/support/allocators/*.h sed -i 's/Prefer nullptr, otherwise SAFECOOKIE./Prefer NULL, otherwise SAFECOOKIE./g' src/torcontrol.cpp sed -i 's/tor: Using nullptr authentication/tor: Using NULL authentication/g' src/torcontrol.cpp sed -i 's/METHODS=nullptr/METHODS=NULL/g' src/test/torcontrol_tests.cpp src/torcontrol.cpp sed -i 's/nullptr certificates/NULL certificates/g' src/qt/paymentserver.cpp sed -i 's/"nullptr"/"NULL"/g' src/torcontrol.cpp src/test/torcontrol_tests.cpp -END VERIFY SCRIPT-
2017-08-05Merge #10988: qt: Increase BLOCK_CHAIN_SIZE constantsWladimir J. van der Laan
1967d2a qt: Increase BLOCK_CHAIN_SIZE constants (Wladimir J. van der Laan) Pull request description: - Increase `BLOCK_CHAIN_SIZE` from 120GB to 150GB - Increase `CHAIN_STATE_SIZE` from 2GB to 4GB I took the local sizes of the blocks and chainstate directory, and added a bit extra to accomodate the near future (15GB for the chain and 1GB for the chainstate). Tree-SHA512: 76ec7770bd3a30380b0224a0f307cdad14c8227ef726dd55738cebe9d894430865aff11e05a793fd3e60d8fe019dbb392f574c1fb63ec746618b4460ed64bd0c
2017-08-05Merge #10977: [net] Fix use of uninitialized value in getnetworkinfo(const ↵Wladimir J. van der Laan
JSONRPCRequest&) 11dd29b [net] Fix use of uninitialized value in getnetworkinfo(const JSONRPCRequest& request) (practicalswift) Pull request description: When running `test_bitcoin` under Valgrind I found the following issue: ``` $ valgrind src/test/test_bitcoin ... ==10465== Use of uninitialised value of size 8 ==10465== at 0x6D09B61: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21) ==10465== by 0x6D0B1BB: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_int<unsigned long>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, unsigned long) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21) ==10465== by 0x6D0B36C: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, unsigned long) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21) ==10465== by 0x6D17699: std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21) ==10465== by 0x4CAAD7: operator<< (ostream:171) ==10465== by 0x4CAAD7: formatValue<ServiceFlags> (tinyformat.h:345) ==10465== by 0x4CAAD7: void tinyformat::detail::FormatArg::formatImpl<ServiceFlags>(std::ostream&, char const*, char const*, int, void const*) (tinyformat.h:523) ==10465== by 0x1924D4: format (tinyformat.h:510) ==10465== by 0x1924D4: tinyformat::detail::formatImpl(std::ostream&, char const*, tinyformat::detail::FormatArg const*, int) (tinyformat.h:803) ==10465== by 0x553A55: vformat (tinyformat.h:947) ==10465== by 0x553A55: format<ServiceFlags> (tinyformat.h:957) ==10465== by 0x553A55: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > tinyformat::format<ServiceFlags>(char const*, ServiceFlags const&) (tinyformat.h:966) ==10465== by 0x54C952: getnetworkinfo(JSONRPCRequest const&) (net.cpp:462) ==10465== by 0x28EDB5: CallRPC(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (rpc_tests.cpp:31) ==10465== by 0x293947: rpc_tests::rpc_togglenetwork::test_method() (rpc_tests.cpp:88) ==10465== by 0x2950E5: rpc_tests::rpc_togglenetwork_invoker() (rpc_tests.cpp:84) ==10465== by 0x182496: invoke<void (*)()> (callback.hpp:56) ==10465== by 0x182496: boost::unit_test::ut_detail::callback0_impl_t<boost::unit_test::ut_detail::unused, void (*)()>::invoke() (callback.hpp:89) ... ``` The read of the uninitialized variable `nLocalServices` is triggered by `g_connman->GetLocalServices()` in `getnetworkinfo(const JSONRPCRequest& request)` (`net.cpp:462`): ```c++ UniValue getnetworkinfo(const JSONRPCRequest& request) { ... if(g_connman) obj.push_back(Pair("localservices", strprintf("%016x", g_connman->GetLocalServices()))); ... } ``` The reason for the uninitialized `nLocalServices` is that `CConnman::Start(...)` is not called by the tests, and hence the initialization normally performed by `CConnman::Start(...)` is not done. This commit adds a method `Init(const Options& connOptions)` which is called by both the constructor and `CConnman::Start(...)`. This method initializes `nLocalServices` and the other relevant values from the supplied `Options` object. Tree-SHA512: d8742363acffd03b2ee081cc56840275569e17edc6fa4bb1dee4a5971ffe4b8ab1d2fe7b68f98a086bf133b7ec46f4e471243ca08b45bf82356e8c831a5a5f21
2017-08-05Merge #10971: build: fix missing sse42 in depends buildsWladimir J. van der Laan
9baca41 build: always attempt to enable targeted sse42 cxxflags (Cory Fields) Pull request description: For depends builds without this, configure thinks that the user has overridden CXXFLAGS manually, when really they've just been set by the config.site. The effect is that warnings and extra cxxflags (sse4.2 for example) were not being added. Tree-SHA512: 9fd615ad0e926bd9d6b541ffcf7fc555e2147e8761f57ff3b5fb5d196c9cef0f26aa99681ff72db8c83c0f9a7ed91f4253f46bab09f2c835044b68047358fa47
2017-08-05Merge #10986: Update chain transaction statisticsWladimir J. van der Laan
b1973d6 Update chain transaction statistics (Pieter Wuille) Pull request description: Tree-SHA512: f906173f4d602210f4a3e3d33eb2551158e353089a3d0b46dba93e6c6fbcb8bc785839be2917a60abe288e5728949e24bca355cbbe7600dc5a7ed30a873fff5a
2017-08-05Merge #10985: Add undocumented -forcecompactdb to force LevelDB compactionsWladimir J. van der Laan
8842d1a Add undocumented -forcecompactdb to force LevelDB compactions (Pieter Wuille) Pull request description: Tree-SHA512: de91f3f574f75248fa6e5091089c840957fae5a972ebcd2b89493f7d777d4658560a6f5a3b43ab0c9b2c333ad98f9f185ae224c9caffc1a5e8df369cc414f123
2017-08-05qt: Increase BLOCK_CHAIN_SIZE constantsWladimir J. van der Laan
- Increase `BLOCK_CHAIN_SIZE` from 120GB to 150GB - Increase `CHAIN_STATE_SIZE` from 2GB to 4GB I took the local sizes of the blocks and chainstate directory, and added a bit extra to accomodate the near future (15GB for the chain and 1GB for the chainstate).
2017-08-04build: always attempt to enable targeted sse42 cxxflagsCory Fields
This avoids a counter-intuitive drop in performance when manually adjusting the flags.
2017-08-03Add undocumented -forcecompactdb to force LevelDB compactionsPieter Wuille
2017-08-03Update chain transaction statisticsPieter Wuille
2017-08-03Merge #10851: depends: fix fontconfig with newer glibcWladimir J. van der Laan
3498a8d depends: fix fontconfig with newer glibc (Cory Fields) Pull request description: Fixes build with newer gcc. Without this, depends builds fail with gcc7, maybe gcc6. Tree-SHA512: 3cfcebdb137c3e368c69d25012ceb32809890e67521aaa8b074f2092f847e3e7ae82ac9050b4600ba18f443d2a8fe1f8523c808d77642a1e7782d558cbad4a74
2017-08-03Merge #10942: Eliminate fee overpaying edge case when subtracting fee from ↵Wladimir J. van der Laan
recipients 49d903e Eliminate fee overpaying edge case when subtracting fee from recipients (Alex Morcos) Pull request description: I'm not sure if this is the cause of the issue in #10034 , but this was a known edge case. I just didn't realize how simple the fix is. Could use a couple more eyes to make sure nothing silly can go wrong here, but if we all agree it's this simple, we can add this as another 0.15 bug fix. Tree-SHA512: db1dd1e83363a3c231267b626d3a388893ee70ba1972056fe2c339c5c9e4fbfd30f7fe837c30cc7be884d454797fd4c619b9d631a8d5eeb55cdb07402a83acb3
2017-08-02depends: fix fontconfig with newer glibcCory Fields
See comment for more detail
2017-08-02[net] Fix use of uninitialized value in getnetworkinfo(const JSONRPCRequest& ↵practicalswift
request) When running test_bitcoin under Valgrind I found the following issue: ``` $ valgrind src/test/test_bitcoin ... ==10465== Use of uninitialised value of size 8 ==10465== at 0x6D09B61: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21) ==10465== by 0x6D0B1BB: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_int<unsigned long>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, unsigned long) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21) ==10465== by 0x6D0B36C: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, unsigned long) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21) ==10465== by 0x6D17699: std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21) ==10465== by 0x4CAAD7: operator<< (ostream:171) ==10465== by 0x4CAAD7: formatValue<ServiceFlags> (tinyformat.h:345) ==10465== by 0x4CAAD7: void tinyformat::detail::FormatArg::formatImpl<ServiceFlags>(std::ostream&, char const*, char const*, int, void const*) (tinyformat.h:523) ==10465== by 0x1924D4: format (tinyformat.h:510) ==10465== by 0x1924D4: tinyformat::detail::formatImpl(std::ostream&, char const*, tinyformat::detail::FormatArg const*, int) (tinyformat.h:803) ==10465== by 0x553A55: vformat (tinyformat.h:947) ==10465== by 0x553A55: format<ServiceFlags> (tinyformat.h:957) ==10465== by 0x553A55: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > tinyformat::format<ServiceFlags>(char const*, ServiceFlags const&) (tinyformat.h:966) ==10465== by 0x54C952: getnetworkinfo(JSONRPCRequest const&) (net.cpp:462) ==10465== by 0x28EDB5: CallRPC(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (rpc_tests.cpp:31) ==10465== by 0x293947: rpc_tests::rpc_togglenetwork::test_method() (rpc_tests.cpp:88) ==10465== by 0x2950E5: rpc_tests::rpc_togglenetwork_invoker() (rpc_tests.cpp:84) ==10465== by 0x182496: invoke<void (*)()> (callback.hpp:56) ==10465== by 0x182496: boost::unit_test::ut_detail::callback0_impl_t<boost::unit_test::ut_detail::unused, void (*)()>::invoke() (callback.hpp:89) ... ``` The read of the uninitialized variable nLocalServices is triggered by g_connman->GetLocalServices() in getnetworkinfo(const JSONRPCRequest& request) (net.cpp:462): ```c++ UniValue getnetworkinfo(const JSONRPCRequest& request) { ... if(g_connman) obj.push_back(Pair("localservices", strprintf("%016x", g_connman->GetLocalServices()))); ... } ``` The reason for the uninitialized nLocalServices is that CConnman::Start(...) is not called by the tests, and hence the initialization normally performed by CConnman::Start(...) is not done. This commit adds a method Init(const Options& connOptions) which is called by both the constructor and CConnman::Start(...). This method initializes nLocalServices and the other relevant values from the supplied Options object.
2017-08-02Merge #10958: Update to latest Bitcoin patches for LevelDBWladimir J. van der Laan
b13a68e Squashed 'src/leveldb/' changes from 196962ff0..c521b3ac6 (Pieter Wuille) Pull request description: Includes: * https://github.com/bitcoin-core/leveldb/pull/2: Prefer std::atomic over MemoryBarrier (Pieter Wuille) * https://github.com/bitcoin-core/leveldb/pull/5: Move helper functions out of sse4.2 object (Cory Fields) * https://github.com/bitcoin-core/leveldb/pull/6: Fixes typo (Dimitris Tsapakidis) * https://github.com/bitcoin-core/leveldb/pull/10: Clean up compile-time warnings (gcc 7.1) (Matt Corallo) * https://github.com/bitcoin-core/leveldb/pull/11: fixup define checks. Cleans up some oopses from #5 (Cory Fields) Tree-SHA512: 2b88a99a86ed8c74c860de13a123ea7f5424d35d314be564820cf83aaae8308383403f7cd56f17c241cfee4885699796141fed666559c21044eaabaeea073315
2017-08-02Merge #10974: Fix typo in sendcoinsdialog.Wladimir J. van der Laan
7f121a0 Fix typo in sendcoinsdialog. (Masahiko Hyuga) Pull request description: Tree-SHA512: 7b3ea344a8a432b6e3835b6870ccfaa197df43f812fea506259b644a44442e36ee39967eed246d9b4b5334528b63f41d7e8af9fd2267e51bcf7557ed652452e4
2017-08-02Fix typo in sendcoinsdialog.Masahiko Hyuga
2017-08-01Update LevelDB with latest Bitcoin-specific patchesPieter Wuille
2017-08-01Squashed 'src/leveldb/' changes from 196962ff0..c521b3ac6Pieter Wuille
c521b3ac6 Merge #11: fixup define checks. Cleans up some oopses from #5. 8b1cd3753 fixup define checks. Cleans up some oopses from #5. 6b1508d6d Merge #6: Fixes typo fceb80542 Merge #10: Clean up compile-time warnings (gcc 7.1) 0ec2a343f Clean up compile-time warnings (gcc 7.1) d4c268a35 Merge #5: Move helper functions out of sse4.2 object 8d4eb0847 Add HasAcceleratedCRC32C to port_win.h 77cfbfd25 crc32: move helper functions out of port_posix_sse.cc 4c1e9e016 silence compiler warnings about uninitialized variables 495316485 Merge #2: Prefer std::atomic over MemoryBarrier 2953978ef Fixes typo f134284a1 Merge #1: Merge upstream LevelDB 1.20 ba8a445fd Prefer std::atomic over MemoryBarrier git-subtree-dir: src/leveldb git-subtree-split: c521b3ac654cfbe009c575eacf7e5a6e189bb5bb
2017-08-01Merge #10788: [RPC] Fix addwitnessaddress by replacing ismine with ↵Wladimir J. van der Laan
producesignature e222dc2 Replace ismine with producesignature check in witnessifier (Andrew Chow) Pull request description: Instead of using ismine to check whether an address can be spent by us, make the witness version of the script or address first and then use ProduceSignature with the DummySignatureCreator to check if we can solve for the script. This is to fix cases where we don't have all of the private keys (for something like a multisig address) but have the redeemscript so we can witnessify it. Tree-SHA512: 371777aee839cceb41f099109a13689120d35cf3880cde39216596cc2aac5cc1096af7d9cf07ad9306c3b05c073897f4518a7e97f0b88642f1e3b80b799f481e
2017-08-01Merge #10526: Force on-the-fly compaction during pertxout upgradeWladimir J. van der Laan
efeb273 Force on-the-fly compaction during pertxout upgrade (Pieter Wuille) Pull request description: It seems that LevelDB tends to leave the old "per txid" UTXO entries in the database lying around for a significant amount of time during and after the per-txout upgrade. This introduces a `CompactRange` function in the database wrapper, and invokes it after every batch of updates in `CCoinsViewDB::Upgrade()`. This lowers temporary disk usage during and after the upgrade. Tree-SHA512: fbf964c0a33f4e73709c999c8a2bfdef974779c15820907398a2f8828f5fa3e4e153ddd9031d6fc5083be81e22b999b9bd826fd063ad8b88f55c5e8342503290
2017-08-01Merge #10758: Fix some chainstate-init-order bugs.Wladimir J. van der Laan
c0025d0 Fix segfault when shutting down before fully loading (Matt Corallo) 1385697 Order chainstate init more logically. (Matt Corallo) ff3a219 Call RewindBlockIndex even if we're about to run -reindex-chainstate (Matt Corallo) b0f3249 More user-friendly error message if UTXO DB runs ahead of block DB (Matt Corallo) eda888e Fix some LoadChainTip-related init-order bugs. (Matt Corallo) Pull request description: This does a number of things to clean up chainstate init order, fixing some issues as it goes: * Order chainstate init more logically - first all of the blocktree-related loading, then coinsdb, then pcoinsTip/chainActive. Only create objects as needed. * More clearly document exactly what is and isn't called in -reindex and -reindex-chainstate both with comments noting calls as no-ops and by adding if guards. * Move the writing of fTxIndex to LoadBlockIndex - this fixes a bug introduced in d6af06d68aae985436cbc942f0d11078041d121b where InitBlockIndex was writing to fTxIndex which had not yet been checked (because LoadChainTip hadn't yet initialized the chainActive, which would otherwise have resulted in InitBlockIndex being a NOP), allowing you to modify -txindex without reindex, potentially corrupting your chainstate! * Rename InitBlockIndex to LoadGenesisBlock, which is now a more natural name for it. Also check mapBlockIndex instead of chainActive, fixing a bug where we'd write the genesis block out on every start. * Move LoadGenesisBlock further down in init. This is a more logical location for it, as it is after all of the blockindex-related loading and checking, but before any of the UTXO-related loading and checking. * Give LoadChainTip a return value - allowing it to indicate that the UTXO DB ran ahead of the block DB. This just provides a nicer error message instead of the previous mysterious assert(!setBlockIndexCandidates.empty()) error. * Calls ActivateBestChain in case we just loaded the genesis block in LoadChainTip, avoiding relying on the ActivateBestChain in ThreadImport before continuing init process. * Move all of the VerifyDB()-related stuff into a -reindex + -reindex-chainstate if guard. It couldn't do anything useful as chainActive.Tip() would be null at this point anyway. Tree-SHA512: 3c96ee7ed44f4130bee3479a40c5cd99a619fda5e309c26d60b54feab9f6ec60fabab8cf47a049c9cf15e88999b2edb7f16cbe6819e97273560b201a89d90762
2017-07-31qt: Periodic translations updateWladimir J. van der Laan
Tree-SHA512: 08b255a0f90eac4a68dbcd7f8cb497c8f0c70a9248ba29f460b31fd4dafcdf14589cbd4518ba803233349643749a03c7fbd3829caf6dc2cdadac8737f3440819
2017-07-31Merge #10949: Clarify help message for -discardfeeWladimir J. van der Laan
bdd5543 Clarify help message for -discardfee (Alex Morcos) Pull request description: Tree-SHA512: 7c2f644d1c18e18f11fd85a7b6ca38c480e1ee3932daa4bb19a3965b88146dda899ead0f34d8da02db640598197167bcf69d511501b729e3a8b5b7b6adf08d4e
2017-07-31Merge #10948: p2p: Hardcoded seeds update pre-0.15 branchWladimir J. van der Laan
f0acedd p2p: Hardcoded seeds update pre-0.15 branch (Wladimir J. van der Laan) Pull request description: Just the usual ```bash curl -s http://bitcoin.sipa.be/seeds.txt.gz | gzip -dc > seeds_main.txt python3 makeseeds.py < seeds_main.txt > nodes_main.txt python3 generate-seeds.py . > ../../src/chainparamsseeds.h ``` Tree-SHA512: d73bbdca7de9cf9dd674abb402d6389ac961cb3daf7e3f32534524f6584cdb99b269320b8ab8f42f5d461f611948c6b80ae51ffe3a1312e8fc5e5266bd98be72
2017-07-31Merge #10945: Update defaultAssumeValid according to release-process.md.Wladimir J. van der Laan
9a8b054 Update defaultAssumeValid according to release-process.md. (Gregory Maxwell) Pull request description: Updated for block 477890. Tree-SHA512: 70bca3d81ac170506fba984a97cd44fccaae7da2e709925747fed0e3f763a799b0e89f0b9ed8869b1a55892580594be7b648d3b3635faaee6d85ef6db468dee5
2017-07-30p2p: Hardcoded seeds update pre-0.15 branchWladimir J. van der Laan
2017-07-28Clarify help message for -discardfeeAlex Morcos
2017-07-28Merge #10885: Reject invalid walletsWladimir J. van der Laan
d84e78e [wallet] Specify wallet name in wallet loading errors (John Newbery) a6da027 Reject invalid wallet files (João Barbosa) 3ef77a0 Reject duplicate wallet filenames (João Barbosa) Pull request description: This PR prevents loading the same wallet more than once in a multi wallet scenario. It also prevents loading with invalid files: non regular files or symlinks. Tree-SHA512: 45bf814096bb788db1c76ff334e679a10686cee7d9c8cd48fe5d924031353ace271f6fb0d4af49a34246d336945515c176920a552be7b9fbe07ab8e00e5f6e5e
2017-07-28[wallet] Specify wallet name in wallet loading errorsJohn Newbery
2017-07-28Reject invalid wallet filesJoão Barbosa
2017-07-28Reject duplicate wallet filenamesJoão Barbosa
2017-07-27Force on-the-fly compaction during pertxout upgradePieter Wuille
2017-07-27Eliminate fee overpaying edge case when subtracting fee from recipientsAlex Morcos
2017-07-28Update defaultAssumeValid according to release-process.md.Gregory Maxwell
Updated for block 477890.
2017-07-27Replace ismine with producesignature check in witnessifierAndrew Chow
Instead of using ismine to check whether an address can be spent by us, make the witness version of the script or address first and then use ProduceSignature with the DummySignatureCreator to check if we can solve for the script. Also fixes test cases to reflect this change.
2017-07-27Fix segfault when shutting down before fully loadingMatt Corallo
This was introduced by 3192975f1d177aa9f0bbd823c6387cfbfa943610. It can be triggered easily when canceling DB upgrade from pre-per-utxo.
2017-07-27Order chainstate init more logically.Matt Corallo
* Order chainstate init more logically - first all of the blocktree-related loading, then coinsdb, then pcoinsTip/chainActive. Only create objects as needed. * More clearly document exactly what is and isn't called in -reindex and -reindex-chainstate both with comments noting calls as no-ops and by adding if guards. * Move LoadGenesisBlock further down in init. This is a more logical location for it, as it is after all of the blockindex-related loading and checking, but before any of the UTXO-related loading and checking. * Move all of the VerifyDB()-related stuff into a -reindex + -reindex-chainstate if guard. It couldn't do anything useful as chainActive.Tip() would be null at this point anyway.
2017-07-27Call RewindBlockIndex even if we're about to run -reindex-chainstateMatt Corallo
RewindBlockIndex works over both chainActive - disconnecting blocks from the tip that need witness verification - and mapBlockIndex - requiring redownload of blocks missing witness data. It should never have been the case that the second half is skipped if we're about to run -reindex-chainstate.
2017-07-27More user-friendly error message if UTXO DB runs ahead of block DBMatt Corallo
This gives LoadChainTip a return value - allowing it to indicate that the UTXO DB ran ahead of the block DB. This just provides a nicer error message instead of the previous mysterious assert(!setBlockIndexCandidates.empty()) error. This also calls ActivateBestChain in case we just loaded the genesis block in LoadChainTip, avoiding relying on the ActivateBestChain in ThreadImport before continuing init process.
2017-07-27Fix some LoadChainTip-related init-order bugs.Matt Corallo
* Move the writing of fTxIndex to LoadBlockIndex - this fixes a bug introduced in d6af06d68aae985436cbc942f0d11078041d121b where InitBlockIndex was writing to fTxIndex which had not yet been checked (because LoadChainTip hadn't yet initialized the chainActive, which would otherwise have resulted in InitBlockIndex being a NOP), allowing you to modify -txindex without reindex, potentially corrupting your chainstate! * Rename InitBlockIndex to LoadGenesisBlock, which is now a more natural name for it. Also check mapBlockIndex instead of chainActive, fixing a bug where we'd write the genesis block out on every start.
2017-07-27Merge #10931: Fix misleading "Method not found" multiwallet errorsWladimir J. van der Laan
df389bc Change wallet method disabled error text (Russell Yanofsky) e526b3d Fix misleading "Method not found" multiwallet errors (Russell Yanofsky) Pull request description: Raise RPC_WALLET_NOT_SPECIFIED instead of RPC_METHOD_NOT_FOUND when a required wallet filename was not specified in an RPC call. Also raise more specific RPC_WALLET_NOT_FOUND error instead of RPC_INVALID_PARAMETER in case an invalid wallet was specified, for consistency. Tree-SHA512: 6a8d885283f69bcfc28f2e08ac03eff02f9f8160a312ce2a90d868aa52533434fc0b4c4ab86547c2f09392338956df915637eaf7136a4fc105e6c8179f2d0ac8
2017-07-27Merge #10892: Replace traditional for with ranged for in block and ↵Wladimir J. van der Laan
transaction primitives 72f0060 Replace traditional for with ranged for in primitives (Dag Robole) Pull request description: Replace traditional for with ranged for in block and transaction primitives to improve readability Tree-SHA512: c0fff603d2939149ca48b6aa72b59738a3658d49bd58b2d4ffbc85bdb774d8d5bb808fe526fe22bb9eb214de632834d373e2aab44f6019a83c0b09440cea6528
2017-07-27Merge #10501: remove some unused functionsWladimir J. van der Laan
f228b8e remove some unused functions (Marko Bencun) Pull request description: Identified with `cppcheck --enable=unusedFunction .`. - GetSendBufferSize()'s last use removed in 991955e - SetPort()'s last use removed in 7e195e8 - GetfLargeWorkInvalidChainFound() was introduced in e3ba0ef and never used Tree-SHA512: ea8e5498bec981e42e1342c171c37723c2f5e575c7d6c1a524d9c6cd9b332bdd0d84fddf9e14ca011bb49fb82bd037386382c9afc546b3c2231ae548358bd4f4
2017-07-26Change wallet method disabled error textRussell Yanofsky
Not strictly backwards compatible because the error is not new in this release.
2017-07-26Merge #10912: [tests] Fix incorrect memory_cleanse(…) call in crypto_tests.cppWladimir J. van der Laan
065039d [tests] Fix incorrect memory_cleanse(…) call in crypto_tests.cpp (practicalswift) Pull request description: `chKey` and `chIV` are pointers, not arrays :-) Probably the result of copy-pasting of old code where the code was operating on arrays instead of pointers. If I'm reading the code correctly the absence/presence of these `memory_cleanse(…)` calls won't alter the outcome of the test in question (`TestPassphraseSingle`) even if fixed. Therefore removing. Tree-SHA512: a053b2817bedf6ef889744e546ce9a0f165dee94aef6850d9d6a6bb05b0018789597371ecf154a4aec8588c0ef5626ef08c23c35e35927f6b0497b5f086146fe
2017-07-26Merge #10824: Avoid unnecessary work in SetNetworkActiveWladimir J. van der Laan
a2420ae Avoid unnecessary work in SetNetworkActive (João Barbosa) Pull request description: This PR adds an early return to avoid unnecessary notifications when the status doesn't change. Tree-SHA512: 85d05ca6fa36cb581f94bc154d08bd72cd53f6a857173c6fb2f184058f9c0208c4cf5e5d196825a78339902d8f256688eb6793f99abc7be9c7cfac85136180d9
2017-07-26Merge #10917: developer-notes: add reference to snake_case and PascalCaseWladimir J. van der Laan
4a7a4ff developer-notes: add reference to snake_case and PascalCase (Marko Bencun) Pull request description: CamelCase is ambiguous as it refers to both lowerCamelCase and UpperCamelCase, whereas PascalCase is only UpperCamelCase. Tree-SHA512: 8eebc42931f10ed8fd314c6b8a2a936aa18fce358a50bb8ae580404fb06a97b8fece12c0398170a9a8ddce250d1e79ece3774cf8a36ac604d67b2797b54aa005
2017-07-26Fix misleading "Method not found" multiwallet errorsRussell Yanofsky
Raise RPC_WALLET_NOT_SPECIFIED instead of RPC_METHOD_NOT_FOUND when a required wallet filename was not specified in an RPC call. Also raise more specific RPC_WALLET_NOT_FOUND error instead of RPC_INVALID_PARAMETER in case an invalid wallet was specified, for consistency.
2017-07-26Merge #10854: Avoid using sizes on non-fixed-width types to derive protocol ↵Wladimir J. van der Laan
constants. 095b917 Avoid using sizes on non-fixed-width types to derive protocol constants. (Gregory Maxwell) Pull request description: Thanks to awemany for pointing this out. This replaces #10172 which appears to be abandoned, but uses the constants as requested on that PR. Tree-SHA512: 032c0d75b3aaf807a7d0c7fb8ff5515acc45ad58bd00fe81413f900fe02bad900534a970403b9bb568e132c9eddea6043e958daf625e8acc84375bd41ee2e2ef