Commit graph

10209 commits

Author SHA1 Message Date
Lucas Betschart 7b137acedd [Qt] Add delay before filtering transactions
Fixes 3141
2017-09-18 10:54:26 +02:00
Pieter Wuille b9bceaf1c0
Merge #11252: [P2P] When clearing addrman clear mapInfo and mapAddr.
b86a42077 when clearing addrman clear mapInfo and mapAddr (Gregory Sanders)

Pull request description:

  Power failure on my machine resulted in a corrupted addrman that would hit bad assertions when trying to serialize the "cleared" addrman to disk: 6866b4912b/src/addrman.h (L320)

Tree-SHA512: 07ca8b6cbd88407e5f3f0dccb346ae31bd1392f4210b2d5c5647c853986bfec95cf70240b92bafdc61b90e452a5d8315962738d10c10c2b53fdabff10503d05a
2017-09-11 15:33:20 -07:00
Matt Corallo 3dc263c9b9 Use a sensible default for blockmaxweight
No sensible user will ever keep the default settings here, so not
having sensible defaults only serves to screw users who are
paying less attention, which makes for terrible defaults.
2017-09-11 15:51:26 -04:00
Matt Corallo ba206d2c63 Deprecate confusing blockmaxsize, fix getmininginfo output
* This removes block-size-limiting code in favor of GBT clients
  doing the limiting themselves (if at all).
* -blockmaxsize is deprecated and only used to calculate an implied
  blockmaxweight, addressing confusion from multiple users.
* getmininginfo's currentblocksize return value was returning
  garbage values, and has been removed, also removing a
  GetSerializeSize call in some block generation inner loops and
  potentially addressing some performance edge cases.
2017-09-11 15:51:25 -04:00
Wladimir J. van der Laan 31e72b284e
Merge #11268: [macOS] remove Growl support, remove unused code
f151f5f50 [macOS] remove Growl support, remove unused code (Jonas Schnelli)

Pull request description:

  There is no longer a reason to support Growl.
  A) It went to pay-ware since a couple of years
  B) Since OSX 10.8, the operating system has its own modal notification options (Notification Center).

  This PR removes support for Growl.
  OSX notification centre is still supported after this PR.

Tree-SHA512: eee18098d7354c4e98f927bca9963d4843ff6bceee74795f73a66c27eed33efaac00ec2cabde8807efcbc936b16ab712249006fa13f5a3f55e4d44d163f5f9a0
2017-09-11 21:42:43 +02:00
Wladimir J. van der Laan c22a53cd63
Merge #11250: Bump wallet version to 159900 and remove the usehd option
713a92073 Remove usehd option and warn when it is used (Andrew Chow)
d4c18f733 Bump wallet version number to 159900 (Andrew Chow)

Pull request description:

  Bump the wallet version number to 159900 so that new wallets made without a default key will no longer work on previous versions at all. Also remove the `usehd` option to avoid weird interaction with wallet version numbers and HD-ness of wallets.

Tree-SHA512: dd7965505bfad6a926c79afd423236f509229a398a8398076f8d57d90a5974243f9459a61225c4daee560c796f427445c9e55a3ad528a3a97a9123ca6a1269ab
2017-09-08 02:28:12 +02:00
Andrew Chow 713a92073b Remove usehd option and warn when it is used
Removed the -usehd option so wallets cannot be made to be non-hd
anymore. A warning will be displayed when the option is set.
2017-09-07 16:37:44 -07:00
Andrew Chow d4c18f7330 Bump wallet version number to 159900 2017-09-07 16:37:07 -07:00
MarcoFalke 791a0e6dda
Merge #10767: [wallet] Clarify wallet initialization / destruction interface
5d2a3995e [trivial] fixup comment for VerifyWallets() (John Newbery)
43b0e81d0 [wallet] Add StartWallets() function to wallet/init.cpp (John Newbery)
290f3c56d [wallet] Add RegisterWalletRPC() function to wallet/init.cpp (John Newbery)
062d63102 [wallet] Add CloseWallets() function to wallet/init.cpp (John Newbery)
77fe07c15 [wallet] Add StopWallets() function to wallet/init.cpp (John Newbery)
2da5eafa4 [wallet] Add FlushWallets() function to wallet/init.cpp (John Newbery)
1b9cee66e [wallet] Rename WalletVerify() to VerifyWallets() (John Newbery)
9c76ba18c [wallet] Rename InitLoadWallet() to OpenWallets() (John Newbery)

Pull request description:

  Apologies for the mostly code move only PR. This is a pre-req for both #10740 and #10762

  All wallet component initialization/destruction functions are now in their own `wallet/init.cpp` translation unit and are no longer static functions on the CWallet class. The bitcoin_server also no longer has any knowledge that there are multiple wallets in vpwallet.

  There should be no changes in behavior from this PR.

Tree-SHA512: 7c260eb094f2fa1a88d803769ba60935810968a7309f731135e4b17623b97f18c03bbcd293c942093d1efce62c6c978f9ff484d54dc9a60bc2fcb5af2d160fcd
2017-09-07 16:35:52 -07:00
John Newbery 5d2a3995e7 [trivial] fixup comment for VerifyWallets() 2017-09-07 16:22:11 -07:00
John Newbery 43b0e81d0f [wallet] Add StartWallets() function to wallet/init.cpp 2017-09-07 16:21:26 -07:00
John Newbery 290f3c56d9 [wallet] Add RegisterWalletRPC() function to wallet/init.cpp 2017-09-07 16:21:26 -07:00
John Newbery 062d63102e [wallet] Add CloseWallets() function to wallet/init.cpp 2017-09-07 16:21:26 -07:00
John Newbery 77fe07c159 [wallet] Add StopWallets() function to wallet/init.cpp 2017-09-07 16:21:26 -07:00
John Newbery 2da5eafa47 [wallet] Add FlushWallets() function to wallet/init.cpp 2017-09-07 16:21:26 -07:00
John Newbery 1b9cee66e1 [wallet] Rename WalletVerify() to VerifyWallets()
This function can now verify multiple wallets.
2017-09-07 16:21:09 -07:00
John Newbery 9c76ba18cd [wallet] Rename InitLoadWallet() to OpenWallets()
Rationale:
- this init function can now open multiple wallets (hence
  Wallet->Wallets)
- This is named as the antonym to CloseWallets(), which carries out the
  opposite action.
2017-09-07 16:19:17 -07:00
Wladimir J. van der Laan efb4383ef6
Merge #10793: Changing &var[0] to var.data()
592404f03 Changing &vec[0] to vec.data(), what 9804 missed (MeshCollider)

Pull request description:

  This just continues the work of https://github.com/bitcoin/bitcoin/pull/9804

  Modifies a lot of `&vector[]`'s to `vector.data()`'s across all the files including tests, just the stuff that 9804 missed

Tree-SHA512: dd1a9dffb999dea4fba78dcc91fe02f90250db86f5c74948e1ff3e8b4036b2154b600555eaa04dece5368920aae3513bc36425dc96e4319ca1041b0928a6b656
2017-09-08 01:16:54 +02:00
Wladimir J. van der Laan 723e580657
Merge #10756: net processing: swap out signals for an interface class
2525b972a net: stop both net/net_processing before destroying them (Cory Fields)
80e2e9d0c net: drop unused connman param (Cory Fields)
8ad663c1f net: use an interface class rather than signals for message processing (Cory Fields)
28f11e940 net: pass CConnman via pointer rather than reference (Cory Fields)

Pull request description:

  See individual commits.
  Benefits:
  - Allows us to begin moving stuff out of CNode and into CNodeState (after #10652 and follow-ups)
  - Drops boost dependency and overhead
  - Drops global signal registration
  - Friendlier backtraces

Tree-SHA512: af2038c959dbec25f0c90c74c88dc6a630e6b9e984adf52aceadd6954aa463b6aadfccf979c2459a9f3354326b5077ee02048128eda2a649236fadb595b66ee3
2017-09-08 01:01:12 +02:00
MeshCollider 592404f03f Changing &vec[0] to vec.data(), what 9804 missed 2017-09-08 10:36:26 +12:00
Wladimir J. van der Laan e6ab88a452
Merge #10916: add missing lock to crypter GetKeys()
fe09b0197 add missing lock to crypter GetKeys() (Marko Bencun)
5cb3da04b keystore GetKeys(): return result instead of writing to reference (Marko Bencun)

Pull request description:

  Issue: #10905

  First commit makes GetKeys() return the result instead of writing to a reference to remove some useless lines.

Tree-SHA512: bb51255b5a6cf5488c3d5dee89f539d41f0717f018441d120047f877e0a705a133fb3b7a97d1cf8f73b5d2ed93dd2dbdfcd6f394e40105af2a12e01d397cb402
2017-09-07 22:04:18 +02:00
Wladimir J. van der Laan 2f0d3e604a
Merge #11232: Ensure that data types are consistent
061297f0a Ensure that data types are consistent (jjz)

Pull request description:

  1. nStatus of CBlockIndex  is consistent with the definition of Enum(BlockStatus)
  2. The BlockHeader is consistent with the type of variable defined in CBlockHeader

Tree-SHA512: 3d4a55c62d3e17b9c83807eae153db4fcfcd8477c9413a45dedfa157563e77b775a66974648d28c9d44ac45a5705eef83b31a8a3b44316dc9814b85526a9d034
2017-09-07 21:09:00 +02:00
Wladimir J. van der Laan e7f125562f
Merge #11237: qt: Fixing division by zero in time remaining
c8d38abd6 Refactor tipUpdate as per style guide (MeshCollider)
3b69a08c5 Fix division by zero in time remaining (MeshCollider)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/issues/10291, https://github.com/bitcoin/bitcoin/issues/11265

  progressDelta may be 0 (or even negative according to 11265), this checks for that and prints unknown if it is, because we cannot calculate an estimate for the time remaining (would be infinite or negative).

Tree-SHA512: bc5708e5ed6e4670d008219558c5fbb25709bd99a32c98ec39bb74f94a0b7fa058f3d03389ccdd39e6723e6b5b48e34b13ceee7c051c2db631e51d8ec3e1d68c
2017-09-07 21:05:47 +02:00
Cory Fields 2525b972af net: stop both net/net_processing before destroying them
This should avoid either attempting to use an invalid reference/pointer to the
other.
2017-09-07 14:26:23 -04:00
Jonas Schnelli f151f5f50f
[macOS] remove Growl support, remove unused code 2017-09-07 10:11:44 -07:00
Jonas Schnelli a3624ddb1a
Merge #11156: Fix memory leaks in qt/guiutil.cpp
9b348ff9e Fix memory leaks in qt/guiutil.cpp (Dan Raviv)

Pull request description:

  on macOS:
  `listSnapshot` was leaking in `findStartupItemInList()`
  `bitcoinAppUrl` was leaking in `[Get|Set]StartOnSystemStartup()`

Tree-SHA512: dd49e1166336cf4f20035d21930f2f99f21f1d9f91a1101b1434a23dd0b92d402ac7efb177473c758d8af1dbab8d8750485583231c5b5854203d2493f0b43e73
2017-09-07 10:02:27 -07:00
Jonas Schnelli ea729d55b4
Merge #10770: Drop upgrade-cancel callback registration for a generic "cancelable"
ee4d1493e Drop upgrade-cancel callback registration for a generic "resumeable" (Matt Corallo)

Pull request description:

  Instead of passing a StartShutdown reference all the way up from
  txdb, give ShowProgress a "cancelable" boolean, as StartShutdown
  is pretty much always what you'll want to use to cancel. Use the
  same boolean to allow cancel during initial block verification.

Tree-SHA512: 515817aaa4b9e3e856200e00be9c2d44ecfa2d4f288fe3e02116105fe85de2650c13076ee7e45396ec1ce6ab45e53b0477cddda7cfdee5b3bd0589cb81a4c346
2017-09-07 09:21:04 -07:00
Jonas Schnelli 9c8f3655cc
Merge #10911: [qt] Fix typo and access key in optionsdialog.ui
d2be7b25b Typo in optionsdialog.ui Tooltip displayed ampersand incorrectly, & should be in text. (James Evans)

Pull request description:

  Tooltip displayed ampersand incorrectly, & should be in text property rather than tooltip so that access key is correctly displayed for accessibility.

Tree-SHA512: 331848207317d37d4d9db40119d0b7ae9a276d06cd1b057cd0e87d508e1aa769b785246ca30ca9156db632798ec9f68ba8bf78cf42904267b4187bd27cfced35
2017-09-07 09:01:23 -07:00
James Evans d2be7b25b5
Typo in optionsdialog.ui
Tooltip displayed ampersand incorrectly, & should be in text.
2017-09-07 08:55:58 -07:00
jjz 061297f0ac Ensure that data types are consistent
1. nStatus of CBlockIndex  is consistent with the definition of Enum(BlockStatus)

2. The BlockHeader is consistent with the type of variable defined in CBlockHeader
2017-09-07 11:17:35 +08:00
MarcoFalke 2a56baf395
Merge #10682: Trivial: Move the AreInputsStandard documentation next to its implementation
ca67ddf0b Move the AreInputsStandard documentation next to its implementation (esneider)

Pull request description:

  The documentation (and rationale) for `AreInputsStandard` somehow got separated from its implementation, and creates a bit of confusion: it's in the middle of the file, next to the implementation of `IsStandard`, which actually checks the "standardness" of outputs, not inputs.

Tree-SHA512: 71281cbcbc5a5701cc11e812a3e90669dda3d92dc2176b512b7832d79b08b34307999c984516bb0c56b01db9b03a12ee4755f662efc1158f4e126de5ca421999
2017-09-06 18:12:53 -07:00
João Barbosa 7696841329 Fix style in -stdin and -stdinrpcpass handling 2017-09-07 00:35:28 +01:00
Cory Fields 80e2e9d0ce net: drop unused connman param
The copy in PeerLogicValidation can be used instead.
2017-09-06 19:32:04 -04:00
Cory Fields 8ad663c1fa net: use an interface class rather than signals for message processing
Drop boost signals in favor of a stateful class. This will allow the message
processing loop to actually move to net_processing in a future step.
2017-09-06 19:32:04 -04:00
Wladimir J. van der Laan 66a5b419ef
Merge #10838: (finally) remove getinfo
aece8a463 (finally) remove getinfo in favor of more module-specific infos (Matt Corallo)

Pull request description:

  I see no reason not to have done this in 0.13, let alone for 0.15.

Tree-SHA512: ed3e36f99e9cb90304089e5957ddfbf74141e3e77d850e498e9e45dd8bc1deb9fe36b3fec4c43243023268670a45808de3c23d660df76fa27db6688814c464a5
2017-09-07 01:31:52 +02:00
Matt Corallo aece8a4637 (finally) remove getinfo in favor of more module-specific infos 2017-09-06 16:10:04 -07:00
Cory Fields 28f11e9406 net: pass CConnman via pointer rather than reference
There are a few too many edge-cases here to make this a scripted diff.

The following commits will move a few functions into PeerLogicValidation, where
the local connman instance can be used. This change prepares for that usage.
2017-09-06 19:03:39 -04:00
João Barbosa 86e6dd4b63 Remove duplicate destination decoding 2017-09-06 23:48:35 +01:00
João Barbosa 8d0041e607 Remove unused GetKeyID and IsScript methods from CBitcoinAddress 2017-09-06 23:48:35 +01:00
Wladimir J. van der Laan bcc8a620ea
Merge #11219: [docs] explain how to recompile a modified unit test
478d4fb79 [docs] explain how to recompile only what bitcoind tests need (Sjors Provoost)

Pull request description:

  It was not obvious to me to run `make` inside the test directory, especially because `make src/test` and `make src/test/test_bitcoin` result in `make: Nothing to be done for ...`.

Tree-SHA512: 5fe66c45c50af42d4fed42e3008b1dc4de7ea448f5265a34f4b2f355aa4a48a8187918a49fc9f82e8dd9706bc72c59d0fd67d86057fd816eb317832e46ada7ba
2017-09-07 00:44:20 +02:00
Wladimir J. van der Laan 6acdb1fab7
Merge #11238: Add assertions before potential null deferences
c00199244 Fix potential null dereferences (MeshCollider)

Pull request description:

  Picked up by the static analyzer [Facebook Infer](http://fbinfer.com/) which I was playing around with for another research project. Just adding some asserts before dereferencing potentially null pointers.

Tree-SHA512: 9c01dab2d21bce75c7c7ef867236654ab538318a1fb39f96f09cdd2382a05be1a6b2db0a1169a94168864e82ffeae0686a383db6eba799742bdd89c37ac74397
2017-09-06 23:54:06 +02:00
MarcoFalke bc561b4b7d
Merge #11099: [RPC][mempool]: Add savemempool RPC
1aa97ee08 Add savemempool RPC (Lawrence Nahum)
467cbbcbf Add return value to DumpMempool (Lawrence Nahum)

Pull request description:

  Adds a simple parameterless rpc command to dump the mempool.

  Rationale:

  Sometimes there can be a crash for whatever reason (bug, power loss, etc) causing the mempool.dat file to not be saved.

  This change allows to script/cron the rpc call to have more regular saves to the file as well as cli/ad-hoc.

  This should solve issue https://github.com/bitcoin/bitcoin/issues/11086

Tree-SHA512: e856ae9777425a4521279c9b58e69285d8e374790bebefd3284cf91931eac0e456f86224f427a087a01bf70440bf6e439fa02c8a34940eb1046ae473e98b6aaa
2017-09-06 13:49:25 -07:00
Wladimir J. van der Laan 961901f77e
Merge #11117: Prepare for non-Base58 addresses
864cd2787 Move CBitcoinAddress to base58.cpp (Pieter Wuille)
5c8ff0d44 Introduce wrappers around CBitcoinAddress (Pieter Wuille)

Pull request description:

  This patch removes the need for the intermediary Base58 type `CBitcoinAddress`, by providing {`Encode`,`Decode`,`IsValid`}`Destination` functions that directly operate on the conversion between `std::string`s and `CTxDestination`.

  As a side, it also fixes a number of indentation issues, and removes probably several unnecessary implicit `CTxDestination`<->`CBitcoinAddress` conversions.

  This change is far from complete. In follow-ups I'd like to:
  * Split off the specific address and key encoding logic from base58.h, and move it to a address.h or so.
  * Replace `CTxDestination` with a non-`boost::variant` version (which can be more efficient as `boost::variant` allocates everything on the heap, and remove the need for `boost::get<...>` and `IsValidDestination` calls everywhere).
  * Do the same for `CBitcoinSecret`, `CBitcoinExtKey`, and `CBitcoinExtPubKey`.

  However, I've tried to keep this patch to be minimally invasive, but still enough to support non-Base58 addresses. Perhaps a smaller patch is possible to hack Bech32 support into `CBitcoinAddress`, but I would consider that a move in the wrong direction.

Tree-SHA512: c2c77ffb57caeadf2429b1c2562ce60e8c7be8aa9f8e51b591f354b6b441162625b2efe14c023a1ae485cf2ed417263afa35c892891dfaa7844e7fbabccab85e
2017-09-06 22:31:02 +02:00
Pieter Wuille 864cd27874 Move CBitcoinAddress to base58.cpp 2017-09-06 13:07:45 -07:00
Pieter Wuille 5c8ff0d448 Introduce wrappers around CBitcoinAddress
This patch removes the need for the intermediary Base58 type
CBitcoinAddress, by providing {Encode,Decode,IsValid}Destination
function that directly operate on the conversion between strings
and CTxDestination.
2017-09-06 13:07:45 -07:00
Wladimir J. van der Laan 39ae41389a
Merge #10845: Remove unreachable code
41bf1598f Remove unreachable code (practicalswift)

Pull request description:

  Remove unreachable code.

Tree-SHA512: 2ae94035f693b1ac73b1587eafcc646602a185f6d2b8a24a05939b43235b331c9e6f369ad2e8208624a47c920e989413c6a89ab9b608add5b7be4ebefae2a796
2017-09-06 21:44:18 +02:00
Wladimir J. van der Laan d745b4cf7b
Merge #11203: rpc: add wtxid to mempool entry output
617c459c6 qa: rpc test for wtxid in mempool entry (Suhas Daftuar)
7e5d5965d RPC: add wtxid to mempool entry output (Suhas Daftuar)

Pull request description:

  We already cache this information in the mempool, so including it in the output of rpc calls is basically free.

Tree-SHA512: 2757e1bfca028103937e4b76ce1a5d805846bad5d3d9dd631dcc5f87721bcc0e9d19e437e02053ef1dd3b38b503f0fca8c0b8492cac37dfbd70256a3665f704c
2017-09-06 20:57:18 +02:00
Wladimir J. van der Laan 59e17899a7
Merge #8330: Structure Packing Optimizations in C{,Mutable}Transaction
37495e0d8 Reorder C{,Mutable}Transaction for better packing (Jeremy Rubin)

Pull request description:

  These commits revise the layout of a few key classes to eliminate padding, eliminating useless memory overhead.

  -This reduces CTransaction from 96 bytes to 88 bytes

Tree-SHA512: 91d1fec363edebbb1f1a5b98142c767511e99d3be857148a76e31cc512c9ab3d153083fa6b46b6407974d3b88de984b436c33e8606fbb2b273d74c825195aa17
2017-09-06 20:14:52 +02:00
Wladimir J. van der Laan 5368614aa1
Merge #11210: Stop test_bitcoin-qt touching ~/.bitcoin
dea086f49 Stop test_bitcoin-qt touching ~/.bitcoin (MeshCollider)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/issues/11192

  The directory remains unused, but this stops the tests touching ~/.bitcoin at all (namely creating it if it doesn't exist)

Tree-SHA512: e59ad6b83dbc5ea2fb2761994c09933721d29668b0eef09b9d938a4ee1c67871c5125c57483ee0ea25f2385e308d275d86bcb9087dd4d502923013b4f3dbac82
2017-09-06 19:19:01 +02:00
Wladimir J. van der Laan 815fe62421
Merge #10357: Allow setting nMinimumChainWork on command line
eac64bb7a [qa] Test nMinimumChainWork (Suhas Daftuar)
0311836f6 Allow setting nMinimumChainWork on command line (Suhas Daftuar)

Pull request description:

  As discussed briefly here: https://botbot.me/freenode/bitcoin-core-dev/2017-02-28/?msg=81712308&page=4

  This adds a hidden command line option for setting `nMinimumChainWork`, which allows us to test this parameter in our functional tests, as well as allowing for niche use cases like syncing nodes that are otherwise disconnected from the network.

  See also #10345, which proposes a new use of `nMinimumChainWork`.

Tree-SHA512: fe4d8f4f289697615c98d8760f1cc74c076110310ea0b5b875fcab78c127da9195b4eb84148aebacc7606c246e5773d3f13bd5d9559d0a8bffac20a3a28c62df
2017-09-06 19:00:57 +02:00