Commit graph

16377 commits

Author SHA1 Message Date
Pieter Wuille 172f5fa738 Support deserializing into temporaries
Currently, the READWRITE macro cannot be passed any non-const temporaries, as
the SerReadWrite function only accepts lvalue references.

Deserializing into a temporary is very common, however. See for example
things like 's >> VARINT(n)'. The VARINT macro produces a temporary wrapper
that holds a reference to n.

Fix this by accepting non-const rvalue references instead of lvalue references.
We don't propagate the rvalue-ness down, as there are no useful optimizations
that only apply to temporaries.

Then use this new functionality to get rid of many (but not all) uses of the
'REF' macro (which casts away constness).
2018-03-13 17:04:31 -07:00
Pieter Wuille 2761bca997 Merge READWRITEMANY into READWRITE 2018-03-13 17:04:28 -07:00
MarcoFalke 0630974647
Merge #11772: [tests] Change invalidblockrequest to use BitcoinTestFramework
e97b113b04 [tests] Change invalidblockrequest to use BitcoinTestFramework (John Newbery)
2b7064eda7 [tests] Fix flake8 warnings in invalidblockrequest (John Newbery)
54b8c580b7 [test] Fix nits leftover from 11771 (Conor Scott)

Pull request description:

  Builds on #11771. Please review that PR first

  Next step in #10603.

  - first commit tidies up invalidblockrequest.py
  - second commit removes usage of ComparisonTestFramework

Tree-SHA512: 14b10c09c8c0ebef4a9176eb5b883a275d04c096785ee31b84ef594eed346ec6344d7ed32184c5fb397e744725df3911f45cdfadd0810e5a52eaa256084e3456
2018-03-13 17:11:09 -04:00
Wladimir J. van der Laan d42a4fe5aa
Merge #11041: Add LookupBlockIndex
92fabcd44 Add LookupBlockIndex function (João Barbosa)
43a32b739 Add missing cs_lock in CreateWalletFromFile (João Barbosa)
f814a3e8f Fix cs_main lock in LoadExternalBlockFile (João Barbosa)
c651df8b3 Lock cs_main while loading block index in AppInitMain (João Barbosa)
02de6a6bc Assert cs_main is held when accessing mapBlockIndex (João Barbosa)

Pull request description:

  Replace all `mapBlockIndex` lookups with the new `LookupBlockIndex()`. In some cases it avoids a second lookup.

Tree-SHA512: ca31118f028a19721f2191d86f2dd398144d04df345694575a64aeb293be2f85785201480c3c578a0ec99690516205708558c0fd4168b09313378fd4e60a8412
2018-03-13 19:12:35 +01:00
Wladimir J. van der Laan af88094e4f
Merge #12658: Sanitize some wallet serialization
42343c748 Split up and sanitize CAccountingEntry serialization (Pieter Wuille)
029ecac1b Split up and sanitize CWalletTx serialization (Pieter Wuille)

Pull request description:

  This is a small subset of changes taken from #10785, fixing a few of the craziest constness violations in the serialization code.

  `CWalletTx` currently serializes some of its fields by embedding them in a key-value `mapValue`, which is modified (and then fixed up) even from the `Serialize` method (for which `mapValue` is const). `CAccountingEntry` goes even further in that it stores such a map by appending it into `strComment` after a null char, which is again later fixed up again.

  Fix this by splitting the serialization and deserialization code, and making the serialization act on a copy of `mapValue` / `strComment`.

Tree-SHA512: 487e04996dea6aba5b9b8bdaf2c4e680808f111a15afc557b8d078e14b01e4f40f8ef27588869be62f9a87052117c17e0a0c26c59150f83472a9076936af035e
2018-03-13 18:39:55 +01:00
Wladimir J. van der Laan 702e8b70bd
Merge #11872: [rpc] createrawtransaction: Accept sorted outputs
fac70134a rpc: Update createrawtransaction examples (MarcoFalke)
fa06dfce0 [rpc] createrawtransaction: Accept sorted outputs (MarcoFalke)
8acd25d85 rpc: Allow typeAny in RPCTypeCheck (MarcoFalke)

Pull request description:

  The second parameter of the `createrawtransaction` is a dictionary of the outputs. This comes with at least two drawbacks:

  * In case of duplicate keys, either of them might silently disappear, with no user feedback at all. A user needs to make other mistakes, but this could eventually lead to abnormal tx fees.
  * A dictionary does not guarantee that keys are sorted. Again, a user needs to keep this in mind, as it could eventually lead to excessive tx fees.

  Even though my scenario of loss-of-funds is unlikely to happen, I see it as a inconvenience that should be fixed.

Tree-SHA512: cd562f34f7f9f79c7d3433805971325c388c2035611be283980f4049066a622df4f0afdc11d7ac96662260ec0115147cb65e1ab5268f5a1b063242f3fe425f77
2018-03-13 18:00:06 +01:00
Wladimir J. van der Laan 0f0229d0c3
Merge #12643: [qa] util: Remove unused sync_chain
fa1436c42 [qa] util: Remove unused sync_chain (MarcoFalke)

Pull request description:

  The util function `sync_blocks` already checks for equal chains, so we can remove the unused `sync_chain`.

  Also cleaned up the errors that are printed in case of timeout:

  ```
  AssertionError: Block sync timed out:
    '72a3a3e9dcfd0a09204c3447af0f481d19641eeadbe6a91b8e680ed614bc7712'
    '5032af4ae22ae7a21afdc9d9f516877309c4dd8ef2ecadb9354be7088439b4a6'
    '5032af4ae22ae7a21afdc9d9f516877309c4dd8ef2ecadb9354be7088439b4a6'
  ```
  and
  ```
  AssertionError: Mempool sync timed out:
    {'c2af943d9b321c36e0f5a153a9d3d8b11bdd46ceb28e38f5fd2c722e3edb3563'}
    set()
    set()
  ```

Tree-SHA512: cb4ad30e3e3773072f59afa2c81cfa27bd8f389a93f02acb919990298627fcfbaa53a3d3944d827cc8a5d009871e42a47ea09e9bb93e85c22e3af6a24a574e5d
2018-03-13 17:45:48 +01:00
MarcoFalke 0f58d7f3d6
Merge #12405: travis: Full clone for git subtree check
fa44af5cd2 travis: Full clone for git subtree check (MarcoFalke)

Pull request description:

  Lazy workaround and fix for #12388

Tree-SHA512: ef2843c07bfe00b91a6f7ee551172b54db62a7e0120c734be2fa5e8cb2cb232e34f69239cae3cb319734e321822040ee7dcff00b8f0387a01afa6b3d26cc1ca3
2018-03-13 12:37:49 -04:00
MarcoFalke 3d16f58153
Merge #12659: Improve Fatal LevelDB Log Messages
f4b68b3f8f Log fatal LevelDB errors more verbosely (Evan Klitzke)

Pull request description:

  The `leveldb::Status` class logs the filename of corrupted files, which might be useful when looking at error reports from usres. In theory this is already logged via the `LogPrintf()` statement in `HandleError()`, but that may not always be close to where the final error message is logged, e.g. see https://github.com/bitcoin/bitcoin/issues/11355#issuecomment-340340542 where the log trace provided by the user does not contain that information (and other user comments in the same issue).

  This also adds a log message instructing the user to run the process with `-debug=leveldb`, which provides much more verbose error messages about LevelDB internals. This may not really help much, but improving the error messages here can't hurt.

Tree-SHA512: bbdc52f0ae50e77e4d74060f9f77c6a0b10d5fad1da371eec1ad38a499af5fde3a3b34dd915e721f6bbe779a1f9693ab04fd9cdbcfa95c28f2979b4c0df181c9
2018-03-13 12:16:32 -04:00
Wladimir J. van der Laan ae5bcc7abb
Merge #10694: Remove redundant code in MutateTxSign(CMutableTransaction&, const std::string&)
b1149ee4c Remove redundant code in MutateTxSign(CMutableTransaction&, const std::string&) (practicalswift)

Pull request description:

  Remove redundant code in `MutateTxSign(CMutableTransaction&, const std::string&)`.

Tree-SHA512: 0f0aba4def18b9a4ca73f2bd676881bc05d852d1d34b564416b2b979056263e5471c5d8ce743af44ef6bce11d77b74d18151c983b735cdf47c36f6591ab4b3fb
2018-03-13 16:59:50 +01:00
MarcoFalke 66e91420ab
Merge #12545: test: Use wait_until to ensure ping goes out
0eb84f30d8 test: Use wait_until to ensure ping goes out (Ben Woosley)

Pull request description:

  Intermittent failure evident here:
  https://travis-ci.org/bitcoin/bitcoin/jobs/344021180

Tree-SHA512: 8d3cbc55563160390d3918eb0b22348990cd81ad35c0563033f19142cb43b86a150fecc7df2196209ba00aaa805c67285451e582f387f8dac22d5e44d54e8a0d
2018-03-12 20:52:32 -04:00
MarcoFalke fa1436c429
[qa] util: Remove unused sync_chain 2018-03-12 20:32:04 -04:00
MarcoFalke d8d9162f5b
Merge #12572: [script] lint-whitespace: find errors more easily
0fbed98e42 [script] lint-whitespace: improve print linenumber (Akio Nakamura)

Pull request description:

  Before this PR, the linenumber infomaition is output if trailing-space or tab code was found, but the output occurence is only per a file.
  This PR separates the output timing of file name and line number.
  As a result, users will find where they need to fix more easily.

  example:

  0) git diff
  ```
  diff --git a/dummy.txt b/dummy.txt
  index c0ce4d776..aebbdb88d 100644
  --- a/dummy.txt
  +++ b/dummy.txt
  @@ -1,2 +1,2 @@
  -1
  -2
  +1
  +       2
  @@ -8,2 +8,2 @@
  -8
  -9
  +       8
  +9
  ```

  1) before this PR - Is there "9 " in second line? It may lead to be misunderstood.
  ```
  This diff appears to have added new lines with trailing whitespace.
  The following changes were suspected:

  diff --git a/dummy.txt b/dummy.txt
  @@ -1,2 +1,2 @@
  +1
  +9
  ```

  2) after this PR
  ```
  This diff appears to have added new lines with trailing whitespace.
  The following changes were suspected:

  diff --git a/dummy.txt b/dummy.txt
  @@ -1,2 +1,2 @@
  +1
  @@ -8,2 +8,2 @@
  +9
  ```

Tree-SHA512: 2fd52e3c982786f86cfe10aa2578589bc9c502bcad9b85111467840d726143330c23968cde5483ee0f563893c8381044b80e8c22a7c8eca56fc73c548b9a9496
2018-03-11 17:30:04 -04:00
MarcoFalke fac70134a9
rpc: Update createrawtransaction examples 2018-03-11 16:48:19 -04:00
Pieter Wuille 42343c748c Split up and sanitize CAccountingEntry serialization 2018-03-11 10:56:31 -07:00
Wladimir J. van der Laan bb98aec674
Merge #12567: util: Print timestamp strings in logs using ISO 8601 formatting
a7324bd79 Format timestamps using ISO 8601 formatting (e.g. "2018-02-28T12:34:56Z") (practicalswift)

Pull request description:

  Print timestamp strings in logs using [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) formatting (e.g. `2018-02-28T12:34:56Z`):
  * `Z` is the zone designator for the zero [UTC](https://en.wikipedia.org/wiki/Coordinated_Universal_Time) offset.
  * `T` is the delimiter used to separate date and time.

  This makes it clear for the end-user that the date/time logged is specified in UTC and not in the local time zone.

  Before this patch:

  ```
  2018-02-28 12:34:56 New outbound peer connected: version: 70015, blocks=1286123, peer=0
  ```

  After this patch:

  ```
  2018-02-28T12:34:56Z New outbound peer connected: version: 70015, blocks=1286123, peer=0
  ```

Tree-SHA512: 52b53c3d3d11ddf4af521a3b5f90a79f6e6539ee5955ec56a5aa2c6a5cf29cecf166d8cb43277c62553c3325a31bcea83691acbb4e86429c523f8aff8d7b210a
2018-03-10 17:15:00 +01:00
Evan Klitzke f4b68b3f8f Log fatal LevelDB errors more verbosely 2018-03-09 22:51:10 -08:00
Pieter Wuille 029ecac1bc Split up and sanitize CWalletTx serialization 2018-03-09 17:04:31 -08:00
practicalswift a7324bd799 Format timestamps using ISO 8601 formatting (e.g. "2018-02-28T12:34:56Z")
* Z is the zone designator for the zero UTC offset.
* T is the delimiter used to separate date and time.

This makes it clear for the end-user that the date/time logged is
specified in UTC and not in the local time zone.
2018-03-09 15:02:01 +01:00
MarcoFalke 29fad97c32
Merge #12607: depends: Remove ccache
cc879675e1 depends: Remove ccache (fanquake)

Pull request description:

  After discussion with @theuni, we can possibly just remove ccache from depends entirely.

  Related to #12606

Tree-SHA512: ae0a60c8d97467fa41d617daa48ed22159cf32613808634a983304901dd5ed27124e77868d2314004e5144f7b35ba1333f720bb12daec4c5ca03aaf29d593ef2
2018-03-07 21:12:47 -05:00
MarcoFalke fa06dfce0f
[rpc] createrawtransaction: Accept sorted outputs 2018-03-07 12:58:14 -05:00
Wladimir J. van der Laan a34ac6ae07
Merge #9598: Improve readability by removing redundant casts to same type (on all platforms)
06edc23f7 Improve readability by removing redundant casts to same type (on all platforms) (practicalswift)

Pull request description:

  Same binaries check under Linux:

  ```
  $ ../bitcoin-maintainer-tools/build-for-compare.py 874f13821f4193bd037cd37d005ee76b5a849398 82274c02ed --executables "src/bitcoind,src/bitcoin-cli,src/bitcoin-tx"

  $ sha256sum /tmp/compare/*.stripped
  1fe1a8827474f7f24475ce3dc851e7ac658d4ed0ae38d11e67f5a810671eaa15  /tmp/compare/bitcoin-cli.82274c02ed2d82537dc55f008a29edb1bc09bbc4.stripped
  1fe1a8827474f7f24475ce3dc851e7ac658d4ed0ae38d11e67f5a810671eaa15  /tmp/compare/bitcoin-cli.874f13821f4193bd037cd37d005ee76b5a849398.stripped
  342c2ed0e60b60990a58cbf5845b256a4f9e3baff9db074baba5e34a620a60ea  /tmp/compare/bitcoind.82274c02ed2d82537dc55f008a29edb1bc09bbc4.stripped
  342c2ed0e60b60990a58cbf5845b256a4f9e3baff9db074baba5e34a620a60ea  /tmp/compare/bitcoind.874f13821f4193bd037cd37d005ee76b5a849398.stripped
  e4b2a80b2361d5cefd67a47eeb9298b8b712c26c7779d979348be8b2c7e3ec93  /tmp/compare/bitcoin-tx.82274c02ed2d82537dc55f008a29edb1bc09bbc4.stripped
  e4b2a80b2361d5cefd67a47eeb9298b8b712c26c7779d979348be8b2c7e3ec93  /tmp/compare/bitcoin-tx.874f13821f4193bd037cd37d005ee76b5a849398.stripped

  $ git diff -W --word-diff /tmp/compare/874f13821f4193bd037cd37d005ee76b5a849398 /tmp/compare/82274c02ed2d82537dc55f008a29edb1bc09bbc4

  $
  ```

Tree-SHA512: 13ca5862fbb03771682b04a7523e581a7fe62e73620fa0e141cf1bc0a3b3f4e2e66bf14b46d1228e2b11b4960153545e7476f3295713a69b5cf5a28a7c2b358d
2018-03-07 17:47:46 +01:00
Wladimir J. van der Laan efa18a230d
Merge #12626: Limit the number of IPs addrman learns from each DNS seeder
46e7f800b Limit the number of IPs we use from each DNS seeder (e0)

Pull request description:

  A risk exists where a malicious DNS seeder eclipses a node by returning an enormous number of IP addresses. In this commit we mitigate this risk by limiting the number of IP addresses addrman learns to 256 per DNS seeder.

  As discussed with @theuni

Tree-SHA512: 949e870765b1470200f2c650341d9e3308a973a7d1a6e557b944b0a2b8ccda49226fc8c4ff7d2a05e5854c4014ec0b67e37a3f2287556fe7dfa2048ede1f2e6f
2018-03-07 17:43:35 +01:00
Wladimir J. van der Laan 842f61a675
Merge #11900: [script] simplify CheckMinimalPush checks, add safety assert
0749808a7 CheckMinimalPush comments are prescriptive (Gregory Sanders)
176db6147 simplify CheckMinimalPush checks, add safety assert (Gregory Sanders)

Pull request description:

  the two conditions could simply never be hit as `true`, as those opcodes have a push payload of size 0 in `data`.

  Added the assert for clarity for future readers(matching the gating in the interpreter) and safety for future use.

  This effects policy only.

Tree-SHA512: f49028a1d5e907ef697b9bf5104c81ba8f6a331dbe5d60d8d8515ac17d2d6bfdc9dcc856a7e3dbd54814871b7d0695584d28da6553e2d9d7715430223f0b3690
2018-03-07 17:18:14 +01:00
Wladimir J. van der Laan 98bc27fb59
Merge #11687: External wallet files
be8ab7d08 Create new wallet databases as directories rather than files (Russell Yanofsky)
26c06f24e Allow wallet files not in -walletdir directory (Russell Yanofsky)
d8a99f65e Allow wallet files in multiple directories (Russell Yanofsky)

Pull request description:

  This change consists of three commits:

  * The first commit is a pure refactoring that removes the restriction that two wallets can only be opened at the same time if they are contained in the same directory.
  * The second commit removes the restriction that `-wallet` filenames can only refer to files in the `-walletdir` directory.
  * The third commit makes second commit a little safer by changing bitcoin to create wallet databases as directories rather than files, so they can be safely backed up.

  All three commits should be straightforward:

  *  The first commit adds around 20 lines of new code and then updates a bunch of function signatures (generally updating them to take plain fs::path parameters, instead of combinations of strings, fs::paths, and objects like CDBEnv and CWalletDBWrapper).
  * The second commit removes two `-wallet` filename checks and adds some test cases to the multiwallet unit test.
  * The third commit just changes the mapping from specified wallet paths to bdb environment & data paths.

    ---

  **Note:** For anybody looking at this PR for the first time, I think you can skip the comments before _20 Nov_ and start reading at https://github.com/bitcoin/bitcoin/pull/11687#issuecomment-345625565. Comments before  _20 Nov_ were about an earlier version of the PR that didn't include the third commit, and then confusion from not seeing the first commit.

Tree-SHA512: 00bbb120fe0df847cf57014f75f1f7f1f58b0b62fa0b3adab4560163ebdfe06ccdfff33b4231693f03c5dc23601cb41954a07bcea9a4919c8d42f7d62bcf6024
2018-03-07 17:11:54 +01:00
Gregory Sanders 0749808a7f CheckMinimalPush comments are prescriptive 2018-03-07 10:57:00 -05:00
Wladimir J. van der Laan 8a43bdcffd
Merge #12620: Remove TransactionTableModel::TxIDRole
3b26b6af7 qt: Remove TransactionTableModel::TxIDRole (João Barbosa)

Pull request description:

  The role `TxIDRole` is a duplicate of `TxHashRole`. This change favours `TxHashRole`.

Tree-SHA512: ad35933eae1cb6b242b25b8940d662c2c79c766732d76fdd410c80230ec084969294a8e5a126794707992a566076ef4452b592050f7af6c4fa7742891090803d
2018-03-07 16:49:59 +01:00
MarcoFalke 791c3ea61b
Merge #12627: qa: Fix some tests to work on native windows
fa3528a85b qa: Fix some tests to work on native windows (MarcoFalke)

Pull request description:

  This allows some more tests to be run natively on Windows

Tree-SHA512: 8097a82dc046be9f6bb0da634758c9afef7836960ca7a1f88f9acab9512dbf7bc26525b515faae407edab4620846cce2b427940298f822e250f23f924b4c7591
2018-03-07 10:30:04 -05:00
Wladimir J. van der Laan da9a2f5cd9
Merge #11630: Simplify Base32 and Base64 conversions
b3ea8ccb7 Simplify Base32 and Base64 conversions (Pieter Wuille)
3296a3bb7 Generalize ConvertBits (Pieter Wuille)

Pull request description:

  Generalize `ConvertBits` a bit to also be usable for the existing Base32 and Base64 convertions (rather than just for Bech32).

Tree-SHA512: 3858247f9b14ca4766c08ea040a09b1d6d70caaccc75c2436a54102d6d526f499ec07f5bdfcbbe16cbde5aae521cd16e9aa693e688a97e6c5e74b8e58ee55a13
2018-03-07 16:28:53 +01:00
MarcoFalke a312e201ba
Merge #12631: [gitian] Alphabetize signing keys & add kallewoof key
e690cf4b86 [gitian] Add kallewoof key for signing (Karl-Johan Alm)
92fa6d2232 [gitian] Re-order keys by owner first name alphabetic order (Karl-Johan Alm)

Pull request description:

  The docs require 2 sigs before merging, but I'm making the PR now so I don't forget about it.

Tree-SHA512: d8d1199e730cb4b4be83893e0134cd92b22c531a93824d8af5ab72acfcfae404c82e58eb4624e2963cab9e9aac4c9b7874b0224c4a2c02682199de61fc8e00bc
2018-03-07 10:25:50 -05:00
Wladimir J. van der Laan 4ca7c1e4ac
Merge #9991: listreceivedbyaddress Filter Address
f08761371 Add tests of listreceivedbyaddress address filtering (Jeremy Rubin)
8ee08120d Add address filtering to listreceivedbyaddress (Jeremy Rubin)

Pull request description:

  Supersede https://github.com/bitcoin/bitcoin/pull/9503 created by @JeremyRubin , I will maintain it.

Tree-SHA512: 2accaed493b7e1c2eb5cb5270180f100f8c718b6585b9574f294191c318dc622a79e42ac185300f291f82d3b2a6f1c00850b6b17e4ff2dbab94d71df695acbfe
2018-03-07 16:07:37 +01:00
Pieter Wuille b3ea8ccb7a Simplify Base32 and Base64 conversions 2018-03-07 07:04:07 -08:00
Wladimir J. van der Laan 3fa24bb217
Merge #12204: Fix overly eager BIP30 bypass
5b8b38775 Fix overly eager BIP30 bypass (Alex Morcos)

Pull request description:

  In #6931 we introduced a possible consensus breaking change by misunderstanding how completely BIP 34 obviated the need for BIP 30.  Unfixed, this could break consensus after block height about 1.9M.  Explained in code comment.

  h/t @sdaftuar

Tree-SHA512: 8f798c3f203432fd4ae1c1c08bd6967b4a5ec2064ed5f6a7dcf3bff34ea830952838dd4ff70d70b5080cf4644f601e5526b60456c08f43789e4aae05621d9d6b
2018-03-07 16:00:46 +01:00
Karl-Johan Alm e690cf4b86
[gitian] Add kallewoof key for signing 2018-03-07 09:57:57 -05:00
Karl-Johan Alm 92fa6d2232
[gitian] Re-order keys by owner first name alphabetic order 2018-03-07 09:57:44 -05:00
Wladimir J. van der Laan 0f7167989d
Merge #12482: [tests] bind functional test nodes to 127.0.0.1
b156ff7c3 [tests] bind functional test nodes to 127.0.0.1 (Sjors Provoost)

Pull request description:

  Replaces #12200 which broke `rpc_bind.py`.

  Prevents OSX firewall allow-this-application-to-accept-inbound-connections permission popups and is generally safer.

  To prevent binding to `127.0.0.1`, set `self.bind_to_localhost_only = False`.

  cc @jnewbery

Tree-SHA512: 5e700124c91bd0cbdee83ca44910071d71d61d8842334755b685d14fbff6454d75de1ea7de67340370386f58b41361e80e90bb4dca5c4d5992f9d2b27985f999
2018-03-07 14:52:42 +01:00
Wladimir J. van der Laan 8a709fba9b
Merge #12619: doc: Give hint about gitian not able to download
08e0855b9 Give hint about gitian not able to download (kallewoof)

Pull request description:

  Gitian fails to perform downloads right now on my set up. This can be circumvented by first checking out the tag being built and then doing the depends download step before running `gbuild`.

  This should of course be fixed in gitian, but having this note until it's fixed is definitely useful.

Tree-SHA512: ae9d0eb44ecfdae44d35aecc6e5fd6db7d9e95b8e0badc76a1d9aaf8fe70bc00a2914dfcb4f516d030560835af411515ca13736ebf8b49b7040b340457882779
2018-03-07 14:36:24 +01:00
Jeremy Rubin f087613719 Add tests of listreceivedbyaddress address filtering 2018-03-07 08:31:31 -05:00
Jeremy Rubin 8ee08120de Add address filtering to listreceivedbyaddress 2018-03-07 08:31:30 -05:00
João Barbosa 3b26b6af72 qt: Remove TransactionTableModel::TxIDRole 2018-03-07 13:08:20 +00:00
Pieter Wuille 3296a3bb7f Generalize ConvertBits 2018-03-06 20:28:08 -08:00
MarcoFalke fa3528a85b
qa: Fix some tests to work on native windows 2018-03-06 18:42:19 -05:00
e0 46e7f800bd Limit the number of IPs we use from each DNS seeder
A risk exists where a malicious DNS seeder eclipses a node by returning an enormous number of IP addresses. In this commit we mitigate this risk by limiting the number of IP addresses addrman learns to 256 per DNS seeder.
2018-03-06 18:26:29 -05:00
Wladimir J. van der Laan b225010a80
Merge #11372: Address encoding cleanup
92f1f8b31 Split off key_io_tests from base58_tests (Pieter Wuille)
119b0f85e Split key_io (address/key encodings) off from base58 (Pieter Wuille)
ebfe217b1 Stop using CBase58Data for ext keys (Pieter Wuille)
32e69fa0d Replace CBitcoinSecret with {Encode,Decode}Secret (Pieter Wuille)

Pull request description:

  This PR contains some of the changes left as TODO in #11167 (and built on top of that PR). They are not intended for backporting.

  This removes the `CBase58`, `CBitcoinSecret`, `CBitcoinExtKey`, and `CBitcoinExtPubKey` classes, in favor of simple `Encode`/`Decode` functions. Furthermore, all Bitcoin-specific logic (addresses, WIF, BIP32) is moved to `key_io.{h,cpp}`, leaving `base58.{h,cpp}` as a pure utility that implements the base58 encoding/decoding logic.

Tree-SHA512: a5962c0ed27ad53cbe00f22af432cf11aa530e3efc9798e25c004bc9ed1b5673db5df3956e398ee2c085e3a136ac8da69fe7a7d97a05fb2eb3be0b60d0479655
2018-03-07 00:09:48 +01:00
Wladimir J. van der Laan 29088b14ee
Merge #12600: Add a test for large tx output scripts with segwit input.
5f8cc0df1 Add a test for large tx output scripts with segwit input. (Richard Kiss)

Pull request description:

  This test failed in pycoin but passed in bitcoin, so I thought I'd share it.

Tree-SHA512: 95dff4e03afea4d93ff5e99aa06004446c3df022c2e8a191cac8981107135a5ac2bd3ba1c3a9c4eda9f8f63f584cc1700b7ef57ee6ec2c66a72c699b51bdb61a
2018-03-06 23:57:43 +01:00
Wladimir J. van der Laan 17c44b208f
Merge #12098: [scripts] lint-whitespace: add param to check last N commits
8dbf740f8 [scripts] lint-whitespace: check last N commits or unstaged changes (Sjors Provoost)

Pull request description:

  E.g. before you push three commits to Github and upset Travis, check if you didn't make any whitespace mistakes:
  ```sh
  contrib/devtools/lint-whitespace.sh 3
  ```

  This is slightly more convenient than doing:
  ```sh
  TRAVIS_COMMIT_RANGE=HEAD~3...HEAD contrib/devtools/lint-whitespace.sh
  ```

Tree-SHA512: 5d9c1ae978ccbe59477e8cf53391e9bd697d2da87f417a2519264af560d4768138e0b2d320dd497a1f1e704e18ab279d724f523b57c17a80ccd753133a5445bf
2018-03-06 23:17:26 +01:00
kallewoof 08e0855b96
Give hint about gitian not able to download
Gitian fails to perform downloads right now on my set up. This can be circumvented by first checking out the tag being built and then doing the depends download step before running `gbuild`.
2018-03-06 17:14:29 -05:00
Wladimir J. van der Laan 14475e2dcd
Merge #12097: [scripts] lint-whitespace: use perl instead of grep -P
40b17f5f9 [scripts] lint-whitespace: use perl instead of grep -P (Sjors Provoost)

Pull request description:

  MacOS does not support `grep -P` out of the box. This change makes
  it easier for developers to check for whitespace problems locally.

  Based on [this](https://stackoverflow.com/a/16658690) and [this](https://serverfault.com/a/504387) Stack Exchange answer.

  Tested with:
  ```sh
  export TRAVIS_COMMIT_RANGE='fe78c9a...62e0453'
  contrib/devtools/lint-whitespace.sh
  This diff appears to have added new lines with tab characters instead of spaces.
  The following changes were suspected:

  diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp
  @@ -0,0 +1,110 @@
  +	num.setint64(n);
  ```

Tree-SHA512: 37c342a0ca2580289cf326a278a051a7c21ba918d6b2143fd9987f159fab85f1de3d770fcf532a642cd5d1957afc8595678128196e102dc473924758f133db7f
2018-03-06 23:09:40 +01:00
Sjors Provoost b156ff7c30
[tests] bind functional test nodes to 127.0.0.1
Prevents OSX firewall allow-this-application-to-accept-inbound-connections
permission popups and is generally safer.

To prevent binding to 127.0.0.1, set self.bind_to_localhost_only = False.
2018-03-06 16:48:15 -05:00
Wladimir J. van der Laan 9fb3898c3f
Merge #12432: [qt] send: Clear All also resets coin control options
f506c0a7f [qt] send: Clear All also resets coin control options (Sjors Provoost)

Pull request description:

  This change makes it so that a custom change address and manual input selection are removed if the user clicks Clear All in the send screen.

Tree-SHA512: 78746043a74c9c26ef476eb0df7ce95411683749d9f6b2747222eaac751e241ea7d4d7ce9e4e69ed0b19fa76754d8584e5bef5bba1ad6598f8e39c784b4264d2
2018-03-06 22:35:55 +01:00