Commit graph

12080 commits

Author SHA1 Message Date
MarcoFalke fa5ce27385
ui: Compile boost:signals2 only once 2018-08-07 10:49:10 -04:00
MarcoFalke 1cd5f2cf9a
Merge #13895: Docs: fix GetWarnings docs to reflect behavior
13bb5cae31 Docs: fix GetWarnings docs to reflect behavior (Ben Woosley)

Pull request description:

  In "gui", it returns all warnings, joined by a separator
  In "statusbar", it returns the last warning set which seems notionally to be the most important, though that is debatable

Tree-SHA512: 5fc0dc68d143a040b7b893b7176188e2b064c2cf1d559420906e4de636e16e9ab7451a1b87603020a7a8f66d6b94f4ee6c7da2697efad879f9e6de9c0e0c9ac1
2018-08-07 10:30:31 -04:00
Wladimir J. van der Laan e7ea858729
Merge #13527: policy: Remove promiscuousmempoolflags
faa24441ec policy: Remove promiscuousmempoolflags (MarcoFalke)

Pull request description:

  It seems odd to clutter validation code with features that can only ever be used for testing (testnet or regtest). Removing that test-only code makes the mempool logic less painful to understand and easier to reason about when changed or refactored in the future.

Tree-SHA512: 3b897aa9604ac8d82ebe9573c6efd468c93ddaa08d378ebc902e247b7aa6c68fcde71e5b449c08f17a067146cdc66dc50a67ce06d07607c27e5189a49c3fba3f
2018-08-07 15:45:37 +02:00
Wladimir J. van der Laan 51c693d49e
Merge #13657: wallet: assert to ensure accuracy of CMerkleTx::GetBlocksToMaturity
93de2891fa wallet: assert to ensure accuracy of CMerkleTx::GetBlocksToMaturity (Ben Woosley)

Pull request description:

  According to my understanding, it should not be possible for coinbase
  transactions to be conflicting, thus it should not be possible for
  GetDepthInMainChain to return a negative result. If it did, this would
  also result in innacurate results for GetBlocksToMaturity due to the
  math therein. asserting ensures accuracy.

Tree-SHA512: 8e71c26f09fe457cfb00c362ca27066f7f018ea2af1f395090fdc7fd9f5964b76f4317c23f7a4923776f00087558511da5c1c368095be39fb1bacc614a93c32f
2018-08-07 14:19:50 +02:00
Wladimir J. van der Laan b81a8a5ea9
Merge #13667: wallet: Fix backupwallet for multiwallets
a1a998cf24 wallet: Fix backupwallet for multiwallets (Daniel Kraft)

Pull request description:

  `backupwallet` was broken for multiwallets in their own directories (i.e. something like `DATADIR/wallets/mywallet/wallet.dat`).  In this case, the backup would use `DATADIR/wallets/wallet.dat` as source file and not take the specific wallet's directory into account.

  This led to either an error during the backup (if the wrong source file was not present) or would silently back up the wrong wallet; especially the latter behaviour can be quite bad for users.

Tree-SHA512: 7efe2450ca047e40719fcc7cc211ed94699056020ac737cada7b59e8240298675960570c45079add424d0aab520437d5050d956acd695a9c2452dd4317b4d2c4
2018-08-07 13:31:54 +02:00
Wladimir J. van der Laan 37ab117a87
Merge #13872: [docs] Reformat -help output for help2man
7272fdcfe7 [docs] Reformat -help output for help2man (Tim Ruffing)

Pull request description:

  This commit slightly changes the format of the "Usage" strings in CLI
  `-help` messages to meet the expection of the help2man tool, which we
  use to generate man pages. On the way, we remove a few calls to
  `strprintf()`, which became superficial after commit 32fbfda.

  Before:
  ![screenshot from 2018-08-04 12-11-25](https://user-images.githubusercontent.com/1071625/43675564-6e2e016c-97e2-11e8-8de7-0912a4088efd.png)
  After:
  ![screenshot from 2018-08-04 12-11-46](https://user-images.githubusercontent.com/1071625/43675566-712d7032-97e2-11e8-85a7-5decc6dcb4b2.png)

Tree-SHA512: 9752ee0d0fde0b084e00232609866291ff493f4feb45919279b0f142b04635c049ddd2bf71ff6ad57d4ae1ed37103348640d253bb4f0b3e16b7fd2bb4b2a6fba
2018-08-07 10:32:53 +02:00
practicalswift d56b73f217 Remove redundant extern 2018-08-07 09:34:45 +02:00
practicalswift a9e90e5002 Remove redundant redeclaration of rescanblockchain(...) in same scope 2018-08-06 23:52:35 +02:00
Ben Woosley 13bb5cae31
Docs: fix GetWarnings docs to reflect behavior
In "gui", it returns all warnings, joined by a separator
In "statusbar", it returns just the first warning
2018-08-06 17:16:15 -04:00
MarcoFalke faab63111d
shutdown: Stop threads before resetting ptrs 2018-08-06 16:35:41 -04:00
John Newbery b2f23c4153 [RPC] Remove getinfo deprecation warning 2018-08-06 11:20:27 -04:00
MarcoFalke fa8527ffec
wallet: Catch filesystem_error and raise InitError 2018-08-04 12:04:38 -04:00
Tim Ruffing 7272fdcfe7 [docs] Reformat -help output for help2man
This commit slightly changes the format of the "Usage" strings in CLI
`-help` messages to meet the expection of the help2man tool, which we
use to generate man pages. On the way, we remove a few calls to
`strprintf()`, which became superficial after commit 32fbfda.
2018-08-04 16:17:13 +02:00
Pierre Rochard 3339d84535 [trivial] add doxygen-compatible comments to CAffectedKeysVisitor 2018-08-03 15:30:08 -04:00
Pierre Rochard 909f54c80a [wallet] Add wallet name to log messages
After multiple wallets became supported, wallet-related log messages
became ambiguous as to which wallet they were being emitted by.

fixes #11317
2018-08-02 12:09:39 -04:00
Varunram d5f745a5c7
trivial: correct typos 2018-08-02 21:27:17 +08:00
Wladimir J. van der Laan e577669062
gui: Pull initial 017x translations from transifex
Tree-SHA512: 4372a0602587e2bfceae69e3c90726c5d4a9d34a934dac9d000a9611fa7fca51e9d0fbacaee60decbea09294e53f94259ddcef2b3f876fefa1fd9f8a4dc25188
2018-08-02 13:43:51 +02:00
Wladimir J. van der Laan 2c14c1fa2f
Merge #13791: gui: Reject dialogs if key escape is pressed
7bf22bf0c2 gui: Reject options dialog when key escape is pressed (João Barbosa)
4a43306a4f gui: Reject edit address dialog when key escape is pressed (João Barbosa)
f7a553177d gui: Add GUIUtil::ItemDelegate with keyEscapePressed signal (João Barbosa)

Pull request description:

  Currently `EditAddressDialog` and `OptionsDialog` don't close when the escape key is pressed. The `QDataWidgetMapper` instances prevents closing the dialogs because the escape key is used to reset the widgets values. More details and workarounds in https://stackoverflow.com/a/51487847 and http://qtramblings.blogspot.com/2010/10/qdatawidgetmapper-annoyances.html.

  The adopted solution is different from the above references. It turns out that `QDataWidgetMapper::setItemDelegate` sets the event filter for all mapped widgets. So in this PR the mapper's delegate are changed to a custom `GUIUtil::ItemDelegate` that offers the signal `keyEscapePressed`, which is connected to the `QDialog::reject` slot.

  Note that the installed event filter lets all events pass, so the current behaviour isn't changed, meaning that widgets values are reset in addition to closing the dialog.

Tree-SHA512: 9c961d488480b4ccc3880a11a8f1824b65f77570ee8918c7302c62775a1a73e52ae988a31a55ffff87b4170ddbecf833c2f09b66095c00eb6854a4d43f030f1f
2018-08-02 12:59:39 +02:00
Wladimir J. van der Laan d3325b02e4
Merge #13844: doc: correct the help output for -prune
312ff01ee5 -prune option -help output aligned with code (Hennadii Stepanov)

Pull request description:

  The -help output for -prune is aligned with the code.

  In the code (.../src/init.cpp#L1063):
  ```
          if (nPruneTarget < MIN_DISK_SPACE_FOR_BLOCK_FILES) {
              return InitError(strprintf(_("Prune configured below the minimum of %d MiB.  Please use a higher number."), MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024));
          }
  ```
  So correct value of nPruneTarget is **greater than or equal to** MIN_DISK_SPACE_FOR_BLOCK_FILES.

Tree-SHA512: 8e55aa99c8f5a9d020677b0f1b016215e2dbda5fa4ee7c8504b12a3abef226bc21beca118fa332c0bf206a4aff913a5a717b55bb5b2ecdba38423e9c0161209e
2018-08-02 12:00:57 +02:00
Wladimir J. van der Laan aa30e4bb8f
Merge #13824: doc: Remove outdated net comment
fa365021bb doc: Remove outdated net comment (MarcoFalke)

Pull request description:

  `mapAddresses` and the corresponding "critsect" has been removed in 5fee401fe1 more than 6 years ago. Now is probably a good time to remove this confusing comment.

Tree-SHA512: 498a403d5703da395c18a7ebb776aa6e693e59fe43a839fefd261e0a5af58621763813979d4cfbd8d1728ce73b325b82002e393cde79bdbff33e0fbf68ab6747
2018-08-02 10:07:11 +02:00
Wladimir J. van der Laan c1cba35725
Merge #13835: [trivial,doc] Fix memory consistency model in comment
fe7180c5b2 [trivial,doc] Fix memory consistency model in comment (Jesse Cohen)

Pull request description:

  Updating a comment overlooked during review in #13247

Tree-SHA512: 0bd54ba1c265fdd77fd6e12ad0be46dd422348f7d926ce9abaca53fdb3a3c55c0d1cd90b4382321352076f4a81e2249c0014cd789f47a3637cb93bd983cb4657
2018-08-02 10:05:46 +02:00
Hennadii Stepanov 312ff01ee5
-prune option -help output aligned with code
see: .../src/init.cpp#L1063
2018-08-02 01:16:41 +03:00
Wladimir J. van der Laan f030410e88
Merge #13697: Support output descriptors in scantxoutset
f6b7fc349c Support h instead of ' in hardened descriptor paths (Pieter Wuille)
fddea672eb Add experimental warning to scantxoutset (Jonas Schnelli)
6495849bfd [QA] Extend tests to more combinations (Pieter Wuille)
1af237faef [QA] Add xpub range tests in scantxoutset tests (Jonas Schnelli)
151600bb49 Swap in descriptors support into scantxoutset (Pieter Wuille)
0652c3284f Descriptor tests (Pieter Wuille)
fe8a7dcd78 Output descriptors module (Pieter Wuille)
e54d76044b Add simple FlatSigningProvider (Pieter Wuille)
29943a904a Add more methods to Span class (Pieter Wuille)

Pull request description:

  As promised, here is an implementation of my output descriptor concept (https://gist.github.com/sipa/e3d23d498c430bb601c5bca83523fa82) and integration within the `scantxoutset` RPC that was just added through #12196.

  It changes the RPC to use descriptors for everything; I hope the interface is simple enough to encompass all use cases. It includes support for P2PK, P2PKH, P2WPKH, P2SH, P2WSH, multisig, xpubs, xprvs, and chains of keys - combined in every possible way.

Tree-SHA512: 63b54a96e7a72f5b04a8d645b8517d43ecd6a65a41f9f4e593931ce725a8845ab0baa1e9db6a7243190d8ac841f6e7e2f520d98c539312d78f7fd687d2c7b88f
2018-08-01 20:06:17 +02:00
Jesse Cohen fe7180c5b2 [trivial,doc] Fix memory consistency model in comment 2018-08-01 12:19:45 -04:00
MarcoFalke c88529a178
Merge #13805: [wallet] Correctly limit output group size
a13647b8bd [qa] Add test for too-large wallet output groups (Suhas Daftuar)
57ec1c97b2 [wallet] correctly limit output group size (Suhas Daftuar)

Pull request description:

  Also add a test to ensure that output groups are being limited, even if a wallet has many outputs corresponding to the same scriptPubKey (the test fails without the first commit).

Tree-SHA512: 2aaa82005b0910488f5cbf40690d4c5e2f46949e299ef70b4cb6e440713811443d411dcbc6d71b1701fd82423073125e21747787d70830cd021c841afb732d51
2018-08-01 12:03:20 -04:00
MarcoFalke e83d82a85c
Merge #13247: Add tests to SingleThreadedSchedulerClient() and document the memory model
cbeaa91dbb Update ValidationInterface() documentation to explicitly specify threading and memory model (Jesse Cohen)
b296b425a7 Update documentation for SingleThreadedSchedulerClient() to specify the memory model (Jesse Cohen)
9994d01d8b Add Unit Test for SingleThreadedSchedulerClient (Jesse Cohen)

Pull request description:

  As discussed in #13023 I've split this test out into a separate pr

  This test (and documentation update) makes explicit the guarantee (previously undefined, but implied by the 'SingleThreaded' in `SingleThreadedSchedulerClient()`) - that callbacks pushed to the `SingleThreadedSchedulerClient()` obey the single threaded model for memory and execution - specifically, the callbacks are executed fully and in order, and even in cases where a subsequent callback is executed by a different thread, sequential consistency of memory for all threads executing these callbacks is maintained.

  Maintaining memory consistency should make the api more developer friendly - especially for users of the validationinterface. To the extent that there are performance implications from this decision, these are not currently present in practice because all use of this scheduler happens on a single thread currently, furthermore the lock should guarantee consistency across callback executions even when callbacks are executed by multiple threads (as the test does).

Tree-SHA512: 5d95a7682c402e5ad76b05bc9dfbca99ca64105f62ab9e78f6fc0f6ea8c5277aa399fbb94298e35cc677b0c2181ff17259584bb7ae230e38aa68b85ecbc22856
2018-07-31 20:52:05 -04:00
MarcoFalke fa365021bb
doc: Remove outdated net comment 2018-07-31 17:02:42 -04:00
MarcoFalke 0fb9c87815
Merge #13822: bench: Make CoinSelection output groups pass eligibility filter
494634a052 bench: Make CoinSelection output groups pass eligibility filter (Andrew Chow)

Pull request description:

  Set the depth of the output groups used in the CoinSelection benchmark to be 6 in order to pass the eligibility filter for the benchmark.

  Fixes #13813

Tree-SHA512: 55fc6aeda0127f5e155efb982aec211b70dfd3257808dce627886af6866ffa25de4df3c9b10f8c45b6c298a42542c54654f36e59efb208e9055885361f0e501c
2018-07-31 15:24:33 -04:00
Wladimir J. van der Laan 7d3623794a
Merge #13776: net: Add missing verification of IPv6 address in CNetAddr::GetIn6Addr(...)
2fb0066b99 net: Add missing verification of IPv6 address in CNetAddr::GetIn6Addr(...) (practicalswift)

Pull request description:

  Add missing verification of IPv6 address in `CNetAddr::GetIn6Addr(...)`.

Tree-SHA512: 8b0681252eec9cf293a2043e99fdacec520e321b477d8aca1cbd6327b85bf6c5e8cd820fb914f097c62655947e88745ebccd824a78b995a8186e910e6fe520aa
2018-07-31 20:47:40 +02:00
Andrew Chow 494634a052 bench: Make CoinSelection output groups pass eligibility filter
Set the depth of the output groups used in the CoinSelection benchmark
to be 6 in order to pass the eligibility filter for the benchmark.
2018-07-31 11:31:07 -07:00
MarcoFalke 230652cafc
Merge #13799: Ignore unknown config file options; warn instead of error
247d5740d2 Ignore unknown config file options for now (Pieter Wuille)
04ce0d88ca Report when unknown config file options are ignored (Pieter Wuille)

Pull request description:

  As reported by @satwo on IRC a few days ago, the current mechanism of treating unknown config file options as errors is problematic for options like `-rpcclienttimeout` which aren't defined for `bitcoind`.

  A full solution would be to either make all binaries be aware of each other's options, or to permit config file options that only apply to specific binaries (`bitcoind`, `bitcoin-qt`, `bitcoin-cli`). Both of these seem too invasive to introduce for 0.17.

  As a compromise, this PR makes it ignores those options, but still warn about it in the log file.

Tree-SHA512: dfddc771b91df3031a9c98d9f3292f8f4fcd1b97ebb7317b2f457e12d9f205dc63f42721302e7258dbb53f273d7cc041a65a0a9120972769555784e1f1cc9aef
2018-07-31 12:17:55 -04:00
Wladimir J. van der Laan 8ce55df70d
Merge #13794: chainparams: Update with data from assumed valid chain
fa8f2d826c doc: Fix chainTxData comment (MarcoFalke)
fa6094f152 chainparams: Update with data from assumed valid chain (MarcoFalke)

Pull request description:

  Can be reviewed by using the `getblock` and `getchaintxstats` rpcs of a synced node. Reviewers get extra points when their full node has checkpoints and assumevalid disabled.

Tree-SHA512: cedd61fde129ae4c16fc12275b61e4c5659b6d72dd801c608efc294188561bc986d94652fe9bea71ada48654258e2a074d2d2da78036c69608ccff3a6cc1ccf5
2018-07-31 06:53:09 +02:00
Pieter Wuille 247d5740d2 Ignore unknown config file options for now 2018-07-30 18:01:20 -07:00
Jesse Cohen cbeaa91dbb Update ValidationInterface() documentation to explicitly specify threading and memory model 2018-07-30 19:41:59 -04:00
Jesse Cohen b296b425a7 Update documentation for SingleThreadedSchedulerClient() to specify the memory model 2018-07-30 19:41:59 -04:00
João Barbosa 7bf22bf0c2 gui: Reject options dialog when key escape is pressed 2018-07-30 23:13:04 +01:00
João Barbosa 4a43306a4f gui: Reject edit address dialog when key escape is pressed 2018-07-30 23:13:04 +01:00
João Barbosa f7a553177d gui: Add GUIUtil::ItemDelegate with keyEscapePressed signal 2018-07-30 23:13:04 +01:00
MarcoFalke 84d5a6210c
Merge #13786: refactor: Avoid locking tx pool cs thrice
fa5ed4f8d2 refactor: Avoid locking tx pool cs thrice (MarcoFalke)

Pull request description:

  `addUnchecked` is (outside the tests) only called by ATMP, which already takes the tx pool read lock. So locking it twice more in both `addUnchecked` methods seems redundant.

  Similarly `CalculateMemPoolAncestors` is (beside once in the wallet) only called in contexts, where the tx pool lock is already taken. So remove the lock there as well.

Tree-SHA512: fcf603b570da0fc529fe6db8add218663eae52845510732bee0d4611263d2429d3d3c9c8ae68493d67287d13504500ed51905ccbe711eb15a0af3b019edad543
2018-07-30 16:18:23 -04:00
Karl-Johan Alm 23fbbb100f
wallet: sum ancestors rather than taking max in output groups 2018-07-31 04:54:41 +09:00
MarcoFalke fa8f2d826c
doc: Fix chainTxData comment 2018-07-30 15:49:23 -04:00
James O'Beirne 6f53edb395 Acquire cs_main before ATMP call in block_assemble bench
Otherwise we fail an assert in sync.cpp:AssertLockHeldInternal.
2018-07-30 12:08:22 -04:00
Suhas Daftuar 57ec1c97b2 [wallet] correctly limit output group size 2018-07-30 10:43:16 -04:00
Wladimir J. van der Laan 63d73f5bc8
Merge #13554: Remove unused function arguments
bd9d0690dc Remove unused argument to WitnessSigOps(...) (practicalswift)
d1d7cfebd2 Remove unused argument to DefaultOptions(...) (practicalswift)
05dbb0c042 Remove unused argument to ThreadHTTP(...) (practicalswift)

Pull request description:

  Remove unused function arguments.

Tree-SHA512: 9933b6d34ff00a32d2f06a2e542d1225bdfb2c960599f01a8ff0427324b3529db49f19ffdbf54059acbbef5ca87f4c3169e97082169022022cd1e3afa7aaa56d
2018-07-30 16:30:54 +02:00
Pieter Wuille 04ce0d88ca Report when unknown config file options are ignored 2018-07-30 00:35:44 -07:00
MarcoFalke fa6094f152
chainparams: Update with data from assumed valid chain 2018-07-29 13:30:41 -04:00
MarcoFalke fa5ed4f8d2
refactor: Avoid locking tx pool cs thrice 2018-07-29 08:04:06 -04:00
MarcoFalke ad51e1372b
Merge #13774: Return void instead of bool for functions that cannot fail
d78a8dc3e8 Return void instead of bool for functions that cannot fail (practicalswift)

Pull request description:

  Return `void` instead of `bool` for functions that cannot fail:
  * `CBlockTreeDB::ReadReindexing(...)`
  * `CChainState::ResetBlockFailureFlags(...)`
  * `CTxMemPool::addUnchecked(...)`
  * `CWallet::CommitTransaction(...)`
  * `CWallet::LoadDestData(...)`
  * `CWallet::LoadKeyMetadata(...)`
  * `CWallet::LoadScriptMetadata(...)`
  * `CWallet::LoadToWallet(...)`
  * `CWallet::SetHDChain(...)`
  * `CWallet::SetHDSeed(...)`
  * `PendingWalletTx::commit(...)`
  * `RemoveLocal(...)`
  * `SetMinVersion(...)`
  * `StartHTTPServer(...)`
  * `StartRPC(...)`
  * `TorControlConnection::Disconnect(...)`

  Some of the functions can fail by throwing.

  Found by manually inspecting the following candidate functions:

  ```
  $ git grep -E '(^((static|virtual|inline|friend)[^a-z])*[^a-z]*bool [^=]*\(|return true|return false)' -- "*.cpp" "*.h"
  ```

Tree-SHA512: c0014e045362dbcd1a0cc8f69844e7b8cbae4f538e7632028daeca3a797ac11d8d3d86ebc480bedcb8626df3e96779d592747d52a12556fc49921b114fa0ccc6
2018-07-29 07:56:36 -04:00
Pieter Wuille f6b7fc349c Support h instead of ' in hardened descriptor paths 2018-07-27 12:21:12 -07:00
Jonas Schnelli fddea672eb Add experimental warning to scantxoutset 2018-07-27 11:52:45 -07:00
Pieter Wuille 151600bb49 Swap in descriptors support into scantxoutset 2018-07-27 11:52:45 -07:00
Pieter Wuille 0652c3284f Descriptor tests 2018-07-27 11:52:45 -07:00
Pieter Wuille fe8a7dcd78 Output descriptors module 2018-07-27 11:52:45 -07:00
Pieter Wuille e54d76044b Add simple FlatSigningProvider 2018-07-27 11:52:18 -07:00
Pieter Wuille 29943a904a Add more methods to Span class
This introduces a rudimentary begin(), end(), operator[], and subspan to Span.
2018-07-27 11:52:18 -07:00
MarcoFalke ef4fac0ea5
Merge #13775: doc: Remove newlines from error message
620361fce8 Fix accidental use of the addition assignment operator ("+="). Remove newlines from error message. (practicalswift)

Pull request description:

  Fix accidental use of the addition assignment operator (`+=`).

  _Note to reviewers:_ Perhaps the `\n`:s should be removed too?

Tree-SHA512: 4e8c2dfd6025d78ef9d60522297994829dacc447e6b6782e15c0bdd5dd2daa17ca9a8948bfa9a15be57d9286092356381d7e6747980303852d273eb0df0dd76b
2018-07-27 14:38:46 -04:00
practicalswift 620361fce8 Fix accidental use of the addition assignment operator ("+="). Remove newlines from error message. 2018-07-27 18:47:03 +02:00
MarcoFalke f98d1e0008
Merge #13711: [bench] Add benchmark for unserialize prevector
46340b3337 [bench] Add benchmark for unserialize prevector (Akio Nakamura)

Pull request description:

  This PR adds benchmarks for the unserialization of the prevector.

  Note: Separated from #12324.

Tree-SHA512: c055a283328cc2634c01eb60f26604a8665939bbf77d367b6ba6b4e01e77d4511fab69cc3ddb1e62969adb3c48752ed870f45ceba153eee192302601341e18a7
2018-07-27 11:44:10 -04:00
practicalswift d78a8dc3e8 Return void instead of bool for functions that cannot fail
* CBlockTreeDB::ReadReindexing(...)
* CChainState::ResetBlockFailureFlags(...)
* CTxMemPool::addUnchecked(...)
* CWallet::LoadDestData(...)
* CWallet::LoadKeyMetadata(...)
* CWallet::LoadScriptMetadata(...)
* CWallet::LoadToWallet(...)
* CWallet::SetHDChain(...)
* CWallet::SetHDSeed(...)
* RemoveLocal(...)
* SetMinVersion(...)
* StartHTTPServer(...)
* StartRPC(...)
* TorControlConnection::Disconnect(...)
2018-07-27 13:19:03 +02:00
DrahtBot 3fc20632a3 qt: Set BLOCK_CHAIN_SIZE = 220 2018-07-27 07:15:37 -04:00
DrahtBot eb7daf4d60 Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
practicalswift 2fb0066b99 net: Add missing verification of IPv6 address in CNetAddr::GetIn6Addr(...) 2018-07-27 08:41:20 +02:00
practicalswift aecd615ad7 wallet: Fix accidental use of the comma operator 2018-07-26 23:33:16 +02:00
Jesse Cohen 1e3bcd2517 [net_processing] Add thread safety annotations 2018-07-25 15:23:53 -04:00
Jesse Cohen f393a533be Annotate AssertLockHeld() with ASSERT_CAPABILITY() for thread safety analysis 2018-07-25 10:31:27 -04:00
Wladimir J. van der Laan 2d41af1728
Merge #13658: [moveonly] Extract RescanWallet to handle a simple rescan
3fe836b78d [moveonly] Extract RescanWallet to handle a simple rescan (Ben Woosley)

Pull request description:

  Where the outcome does not depend on the result, apart from a simple
  success check.

Tree-SHA512: e0d29c6fc0c7f99a730289e5a80deb586b2848aead56b5198a71ef01f65374812468dfd57be0b8b076eb9be4090d5101d28d979a1d5c3d2f1caeca77b303e90e
2018-07-25 15:39:04 +02:00
Wladimir J. van der Laan 9f23c16599
Merge #13721: Bugfixes for BIP 174 combining and deserialization
fad231ad41 Fix merging of global unknown data in PSBTs (Andrew Chow)
41df035ee1 Check that PSBT keys are the correct length (Andrew Chow)

Pull request description:

  This PR fixes a few bugs that were found and adds tests checking for these errors.

  Specifically:
  - Single byte keys are checked to actually be one byte.
  - Unknown global data must be merged when combining two PSBTs.

Tree-SHA512: c0e7b4bc607d510cc005aaa7c0813ee58c5467ab7ce4adce485522dfeee92b1af3d29fe89df778b0ea812bb3827e085b30e04d4f4ebcefd8364d809573991332
2018-07-25 15:04:25 +02:00
MarcoFalke a140953907
Merge #13753: scripted-diff: Remove trailing whitespaces
12dd101345 scripted-diff: Remove trailing whitespaces (João Barbosa)

Pull request description:

  The script test/lint/lint-whitespace.sh should prevent new cases.

  This happens in some pulls where the code editor and the author 'git add's them, so this would fix it all.

Tree-SHA512: bcdd3472fcd01a2754e52212c7db1de2fdc422728b06785481954a27162fb72001cb73708329cc56e95bcc5e45c1348ebc4eacc2ccfa6aa12413c7ec450b6a33
2018-07-25 07:09:33 -04:00
fanquake 3828a79711
scripted-diff: prefer MAC_OSX over __APPLE__
-BEGIN VERIFY SCRIPT-
sed -i 's/__APPLE__/MAC_OSX/g' src/compat/byteswap.h src/util.cpp
-END VERIFY SCRIPT-
2018-07-25 07:30:28 +08:00
fanquake fa6e841e89
gui: remove macOS ProgressBar workaround 2018-07-25 07:30:28 +08:00
fanquake 68c272527f
gui: remove SubstituteFonts 2018-07-25 07:30:28 +08:00
João Barbosa 12dd101345 scripted-diff: Remove trailing whitespaces
-BEGIN VERIFY SCRIPT-

sed --in-place'' --regexp-extended 's/[[:space:]]+$//g' $(git grep -I --files-with-matches --extended-regexp '[[:space:]]+$' -- src test  ':!*.svg' ':!src/crypto/sha256_sse4*' ':!src/leveldb' ':!src/qt/locale' ':!src/secp256k1' ':!src/univalue')

-END VERIFY SCRIPT-
2018-07-24 20:46:23 +01:00
MarcoFalke 1211b15bf6
Merge #13656: Remove the boost/algorithm/string/predicate.hpp dependency
e3245f2e7b Removes Boost predicate.hpp dependency (251)

Pull request description:

  This pull request removes the `boost/algorithm/string/predicate.hpp` dependency from the project.

  To replace the the `predicate.hpp` dependency from the project the function calls to `boost::algorithm::starts_with` and `boost::algorithm::ends_with` have been replaced with respectively C++11's `std::basic_string::front` and `std::basic_string::back` function calls.

  Refactors that were not required, but have been done anyways:

  - The Boost function `all` was implicitly made available via the `predicate.hpp` header. Instead of including the appropriate header, function calls to `all` have been replaced with function calls to `std::all_of`.

  - The  `boost::algorithm::is_digit` predicate has been replaced with a custom `IsDigit` function that is locale independent and ASCII deterministic.

Tree-SHA512: 22dda6adfb4d7ac0cabac8cc33e8fb8330c899805acc1ae4ede402c4b11ea75a399414b389dfaa3650d23b47f41351b4650077af9005d598fbe48d5277bdc320
2018-07-24 14:50:05 -04:00
Wladimir J. van der Laan 5f7575e263
Merge #12257: [wallet] Use destination groups instead of coins in coin select
232f96f5c8 doc: Add release notes for -avoidpartialspends (Karl-Johan Alm)
e00b4699cc clean-up: Remove no longer used ivars from CInputCoin (Karl-Johan Alm)
43e04d13b1 wallet: Remove deprecated OutputEligibleForSpending (Karl-Johan Alm)
0128121101 test: Add basic testing for wallet groups (Karl-Johan Alm)
59d6f7b4e2 wallet: Switch to using output groups instead of coins in coin selection (Karl-Johan Alm)
87ebce25d6 wallet: Add output grouping (Karl-Johan Alm)
bb629cb9dc Add -avoidpartialspends and m_avoid_partial_spends (Karl-Johan Alm)
65b3eda458 wallet: Add input bytes to CInputCoin (Karl-Johan Alm)
a443d7a0ca moveonly: CoinElegibilityFilter into coinselection.h (Karl-Johan Alm)
173e18a289 utils: Add insert() convenience templates (Karl-Johan Alm)

Pull request description:

  This PR adds an optional (off by default) `-avoidpartialspends` flag, which changes coin select to use output groups rather than outputs, where each output group corresponds to all outputs with the same destination.

  It is a privacy improvement, as each time you spend some output, any other output that is publicly associated with the destination (address) will also be spent at the same time, at the cost of fee increase for cases where coin select without group restriction would find a more optimal set of coins (see example below).

  For regular use without address reuse, this PR should have no effect on the user experience whatsoever; it only affects users who, for some reason, have multiple outputs with the same destination (i.e. address reuse).

  Nodes with this turned off will still try to avoid partial spending, if the fee of the resulting transaction is not greater than the fee of the original transaction.

  Example: a node has four outputs linked to two addresses `A` and `B`:

  * 1.0 btc to `A`
  * 0.5 btc to `A`
  * 1.0 btc to `B`
  * 0.5 btc to `B`

  The node sends 0.2 btc to `C`. Without `-avoidpartialspends`, the following coin selection will occur:
  * 0.5 btc to `A` or `B` is picked
  * 0.2 btc is output to `C`
  * 0.3 - fee is output to (unique change address)

  With `-avoidpartialspends`, the following will instead happen:
  * Both of (0.5, 1.0) btc to `A` or `B` is picked (one or the other pair)
  * 0.2 btc is output to `C`
  * 1.3 - fee is output to (unique change address)

  As noted, the pro here is that, assuming nobody sends to the address after you spend from it, you will only ever use one address once. The con is that the transaction becomes slightly larger in this case, because it is overpicking outputs to adhere to the no partial spending rule.

  This complements #10386, in particular it addresses @luke-jr and @gmaxwell's concerns in https://github.com/bitcoin/bitcoin/pull/10386#issuecomment-300667926 and https://github.com/bitcoin/bitcoin/pull/10386#issuecomment-302361381.

  Together with `-avoidreuse`, this fully addresses the concerns in #10065 I believe.

Tree-SHA512: 24687a4490ba59cf4198ed90052944ff4996653a4257833bb52ed24d058b3e924800c9b3790aeb6be6385b653b49e304453e5d7ff960e64c682fc23bfc447621
2018-07-24 16:34:03 +02:00
Karl-Johan Alm e00b4699cc
clean-up: Remove no longer used ivars from CInputCoin 2018-07-24 15:05:38 +09:00
Karl-Johan Alm 43e04d13b1
wallet: Remove deprecated OutputEligibleForSpending 2018-07-24 15:05:38 +09:00
Karl-Johan Alm 59d6f7b4e2
wallet: Switch to using output groups instead of coins in coin selection 2018-07-24 15:05:37 +09:00
Karl-Johan Alm 87ebce25d6
wallet: Add output grouping 2018-07-24 15:05:37 +09:00
Karl-Johan Alm bb629cb9dc
Add -avoidpartialspends and m_avoid_partial_spends 2018-07-24 15:05:37 +09:00
Karl-Johan Alm 65b3eda458
wallet: Add input bytes to CInputCoin
With nInputBytes, coin selection can execute without a reference to the COutput
2018-07-24 15:05:36 +09:00
Karl-Johan Alm a443d7a0ca
moveonly: CoinElegibilityFilter into coinselection.h 2018-07-24 15:05:36 +09:00
Karl-Johan Alm 173e18a289
utils: Add insert() convenience templates 2018-07-24 15:05:36 +09:00
Wladimir J. van der Laan 7ebd8c6385
qt: Update translation source messages
Tree-SHA512: f286d4252487863c66e764a780e714739cc4783b6a72ec345973998cf717e5fde69dd960c6df1a4a84247939a159779dc4a9d26e2e0686b782ad5cacf6956caf
2018-07-23 17:23:20 +02:00
Wladimir J. van der Laan c0a47da725
Merge #13719: Avoid creating a temporary vector for size-prefixed elements
84547fa6d4 Avoid creating a temporary vector for size-prefixed elements (Pieter Wuille)

Pull request description:

  This is a simple improvement to the PSBT serialization code, avoiding the need for temporary vectors everywhere.

Tree-SHA512: 9f7243b7169ec8ba00ffad31af03c016ab84e4f76ebac810167f91f5e8008f3827ad59fbcee0cb2bd2334fc26466eb222404af24e7fb6ec040fd78229ebe0fd1
2018-07-23 12:52:53 +02:00
Wladimir J. van der Laan d2186b3db6
Merge #13742: doc: Adjust bitcoincore.org links
fa451511a1 doc: Adjust bitcoincore.org links (MarcoFalke)

Pull request description:

  Minor adjustments to our https://bitcoincore.org/ links:

  Mainly adding links of the Bitcoin Core Github mirror and Bitcoin Core website to the doxygen introduction. (See e.g. current master: https://dev.visucore.com/bitcoin/doxygen/index.html). Also removing the link to bitcoin.org, to not imply there is only one resource that educates about bitcoin.

Tree-SHA512: d4d50f6de4d4b412203934e947889ebc0f564747e26f9190a2cff64234bf9fc3d56b8f056651550ce568170fba448559fa005959ef4e504d990e2fbc96a2ed77
2018-07-23 12:32:58 +02:00
251 e3245f2e7b Removes Boost predicate.hpp dependency
This is a squashed commit that squashes the following commits:

This commit removes the `boost/algorithm/string/predicate.hpp` dependenc
from the project by replacing the function calls to `boost::algorithm::starts_with`
`boost::algorithm::ends_with` and `all` with respectively C++11'
`std::basic_string::front`, `std::basic_string::back`, `std::all_of` function calls

This commit replaces `boost::algorithm::is_digit` with  a locale independent isdigi
function, because the use of the standard library's `isdigit` and `std::isdigit
functions is discoraged in the developer notes
2018-07-22 21:34:45 +02:00
MarcoFalke 0a34593ddb
Merge #13740: trivial: remove unneeded include
0454b56d8a trivial: remove unneeded include (Nikolay Mitev)

Pull request description:

  Remove dead include

Tree-SHA512: 66380fe25259d37a19f955142ad53da24d4927064a84249989f54bebc21d9d688236fb60979acc79f219b05692c4c73b3ebab0872b8d03ab2447b0b44a06c8ed
2018-07-22 11:12:09 -04:00
Wladimir J. van der Laan a6f00ce66f
Merge #13212: Net: Fixed a race condition when disabling the network.
793290f940 Net: Fixed a race condition when disabling the network. (lmanners)

Pull request description:

  This change addresses a race condition where setnetworkactive=false wouldn't always disconnect all peers.

  Before this change, the following could happen:
  1. Thread A -- Begins connecting to a node.
  2. Thread B -- Sets kNetworkActive=false and disconnects connected nodes.
  3. Thread A -- Finishes connecting and adds node to list of connected nodes.

  The node that was connected from Thread A remains connected and active,
  even though kNetworkActive=false.

  To fix the race, disconnections when kNetworkActive=false are now handled in the main network loop.

  fixes #13038

Tree-SHA512: 6d0b7a78ae956358e796efcc034cb532c2e0d824a52ae822a3899eefc7df76327519d1f2d77362c9fddf34ef860abd095d7490d7cc02d0ba7543bf1e8c8f2535
2018-07-22 16:33:00 +02:00
MarcoFalke fa451511a1
doc: Adjust bitcoincore.org links 2018-07-22 10:32:38 -04:00
Wladimir J. van der Laan 6deac922e3
Merge #13633: Drop dead code from Stacks
5617840392 Drop dead code from Stacks (Ben Woosley)

Pull request description:

  Stacks is local to this file, and only used in DataFromTransaction, so
  it's easy to confirm this code is unused.

Tree-SHA512: cc680c99f9b31cb56db70f453087d642f83906ce594c07a6bf3e61427cfbee41441495d440b240419ba3386582cf0670c0999b2f51e7fd56b00e0a0f3f618845
2018-07-22 16:20:07 +02:00
Wladimir J. van der Laan 0d1ebf4d3f
Merge #13733: Utils: Refactor ArgsManager a little
9544a3f3fc tiny refactor for ArgsManager (AtsukiTak)

Pull request description:

  This PR contains some small refactors for `ArgsManager`.

  1. Mark `const` on member function if it possible.
  2. Remove unused `error` argument from `ArgsManager::IsArgKnown`.

  I'm not sure whether these refactors should be separated into another PR. If so, I will do that.

Tree-SHA512: 7df09e7f7c4cdd2e7cd60e34137faa7ca7463be66490f8552fdea3656da6ccc98886e258bdeef21820d197fc2fde06ab2d3405205f5de53f258df7c191d206b0
2018-07-22 16:09:06 +02:00
Nikolay Mitev 0454b56d8a trivial: remove unneeded include 2018-07-22 16:49:14 +03:00
MarcoFalke 05714f96e4
Merge #11762: Avoid locking mutexes that are already held by the same thread
01a06d6686 Avoid locking mutexes that are already held by the same thread (practicalswift)

Pull request description:

  Avoid locking mutexes that are already held by the same thread. These are reentrant mutexes, but still no need to lock them more than once per thread :-)

Tree-SHA512: e2fb85882e8800892fd8e8170f3c13128d6acfeb14d7b69fb9555f2b7ad0884fb201cf945b8144ffaf6fb1253c28af7c8c6c435319a7ae30ca003f28aa645a98
2018-07-22 09:41:36 -04:00
MarcoFalke 10b9a811b6
Merge #12764: doc: Remove field in getblocktemplate help that has never been used.
ac8a1d092e [RPC] Remove field in getblocktemplate help that has never been used (Conor Scott)

Pull request description:

  [BIP 22 - getblocktemplate](https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki#Transactions%20Object%20Format) specifies an optional flag, `required` if the transaction must be in the block.

  Luke's implementation #936 did not include this flag, and it was later added to the help description in #3246 (more than a year later) but the field was still never actually implemented. As far as I can tell, bitcoin core would have never actually included this in a `getblocktemplate` call, so it seems logical to remove it from the help description.

  If I am missing something or this is considered harmless - I can close the PR.

Tree-SHA512: f25dda51cc4e1512aff69309be04e3053bdccc1cf03c8d58e8866aa1fdf9d86cc57df872e85528351fc8a8d6d64a8f46a36c513680834762d854f368fbeb0f44
2018-07-22 09:40:18 -04:00
MarcoFalke 62baa28787
Merge #13691: Remove redundant variables, statements and forward declarations
3dee4cc509 Remove redundant statement (practicalswift)
99be644966 Remove redundant unused variables (practicalswift)
66ed242343 Remove redundant forward declaration (practicalswift)

Pull request description:

  Remove redundant …
  * ~access modifiers,~
  * forward declarations,
  * unused variables,
  * statements, and
  * ~return types from lambdas.~

Tree-SHA512: 328bb7d9c45398e44ecbee32095b6376879470dfddbc2180e037620d8390d524b51d7fda112fd58a078715e04432b24dd6998a2459f3550aa0498aa68de866d4
2018-07-22 09:38:10 -04:00
MarcoFalke 59407fce54
Merge #13722: trivial: Replace CPubKey::operator[] with CPubKey::vch where possible
6755569840 trivial: Replace CPubKey::operator[] with CPubKey::vch where possible (Nikolay Mitev)

Pull request description:

  Use variable name instead of calling operator[] through &(*this)[0]

Tree-SHA512: 7054ffda0fa33fb45d4d9f3b29698643f02fd1421d78d5197a0881f2c368dc410647fd2e1a6feb8048e30f8ab8bc2fa8749bf42b9ccbe42c30de8ff80ac45274
2018-07-22 09:09:07 -04:00
MarcoFalke e8c74348d3
Merge #13683: wallet: Introduce assertion to document the assumption that cache and cache_used are always set in tandem
d06330396f wallet: Avoid potential null pointer dereference in CWalletTx::GetAvailableCredit(...) (practicalswift)

Pull request description:

  Avoid potential null pointer dereference in `CWalletTx::GetAvailableCredit(...)`.

  Introduced in 4279da4785.

Tree-SHA512: 92d1da9682f0bab11f6f96395ca30549331b0a056cbceb7e1a7f98b3d17d10082aaeed0907cafd46f4164b0e0f4b77e01f78bfd7d24e0503a66c6942ae842aa5
2018-07-22 08:34:09 -04:00
MarcoFalke eeae4711f3
Merge #13726: Utils and libraries: Removes the boost/algorithm/string/join dependency
5f019d5354 Removes the boost/algorithm/string/join dependency (251)

Pull request description:

  This commit removes the `boost/algorithm/string/join` dependency from the project by replacing `boost::algorithm::join` with the helper function proposed by @MarcoFalke in https://github.com/bitcoin/bitcoin/pull/13726#discussion_r204159967

Tree-SHA512: d4ba3e7621b76bd5210aec9b8d6c320f7ee963d7f902e6d2d3fc0eadbee1cd77799e5c09be9c11452d2825f25740fc436cdec3a6b6c66ced674d771e4ed306ae
2018-07-21 22:38:31 -04:00
AtsukiTak 9544a3f3fc tiny refactor for ArgsManager
This commit contains 2 refactors.

1. mark "const" on ArgsManager::GetHelpMessage and IsArgKnown.
2. remove unused "error" argument from ArgsManager::IsArgKnown.

Firstly, I mark "const" on where it is possible to. It is mentioned
before (e.g. https://github.com/bitcoin/bitcoin/pull/13190#pullrequestreview-118823133).

And about 2nd change, ArgsManager::IsArgKnown was added at commit #4f8704d which was
merged at PR #13112. But from its beggining, "error" argument never be used.
I think it should be refactored.
2018-07-22 03:16:53 +09:00
practicalswift 01a06d6686 Avoid locking mutexes that are already held by the same thread 2018-07-21 19:46:04 +02:00