Commit graph

9577 commits

Author SHA1 Message Date
Wladimir J. van der Laan
a8d0407c4f Move recentRejects initialization to top of InitBlockIndex
This avoids that premature return in the condition that a new chain is initialized
results in NULL pointer errors due to recentReject not being constructed.

Also add assertions where it is used.
2015-07-31 17:58:12 +02:00
Pavol Rusnak
557f8eac7a implement uacomment config parameter
which can add comments to user agent as per BIP-0014
2015-07-31 16:19:23 +02:00
Wladimir J. van der Laan
86cfd23f68
Merge pull request #6473
5fb5c9b Clean up chainparams some more. (Daniel Kraft)
2015-07-31 10:10:55 +02:00
Wladimir J. van der Laan
9848d4297b
Merge pull request #6487
eec7757 qt: Introduce PlatformStyle (Wladimir J. van der Laan)
2015-07-31 10:06:49 +02:00
Wladimir J. van der Laan
eec7757445 qt: Introduce PlatformStyle
Introduce a PlatformStyle to handle platform-specific customization of
the UI.

This replaces 'scicon', as well as #ifdefs to determine whether to place
icons on buttons.

The selected PlatformStyle defaults to the platform that the application
was compiled on, but can be overridden from the command line with
`-uiplatform=<x>`.

Also fixes the warning from #6328.
2015-07-31 09:35:18 +02:00
mruddy
af3208bfa6 Resolve issue 3166.
These changes decode valid SIGHASH types on signatures in assembly (asm) representations of scriptSig scripts.
This squashed commit incorporates substantial helpful feedback from jtimon, laanwj, and sipa.
2015-07-30 19:56:00 -04:00
Daniel Kraft
5fb5c9b213 Clean up chainparams some more.
Clean up the code in chainparams a bit more after the recent
refactorings.  In particular, make sure the structure of the "RegTest"
params matches the structure of the other classes.  This makes the code
clearer to read.

Also remove redundant values of the genesis block in always-specified
optional arguments and mark variable/argument as "const".
2015-07-29 21:13:36 +02:00
Wladimir J. van der Laan
675d2feffa
Merge pull request #6224
59b49cd Eliminate signed/unsigned comparison warning (Suhas Daftuar)
04b5d23 Replace sleep with syncing using pings (Suhas Daftuar)
6b1066f Ignore whitelisting during IBD for unrequested blocks. (Suhas Daftuar)
bfc30b3 Ignore unrequested blocks too far ahead of tip (Suhas Daftuar)
2015-07-29 20:04:15 +02:00
Adam Weiss
f0cba6f8eb Delay initial pruning until after wallet init
Don't prune until any wallet rescanning has taken place to avoid
potentially pruning blocks that the wallet rescan may need.
2015-07-29 14:00:25 -04:00
Wladimir J. van der Laan
7cbed7fa28
Merge pull request #6488
17ac0f4 Avoid leaking file descriptors in RegisterLoad (Casey Rodarmor)
2015-07-29 18:59:23 +02:00
Peter Todd
0847d9cb5f
Keep track of recently rejected transactions
Nodes can have divergent policies on which transactions they will accept
and relay.  This can cause you to repeatedly request and reject the same
tx after its inved to you from various peers which have accepted it.
Here we add rolling bloom filter to keep track of such rejections,
clearing the filter every time the chain tip changes.

Credit goes to Alex Morcos, who created the patch that this code is
based on.

Original code by Peter Todd. Refactored to not construct the
filter at startup time by Pieter Wuille.
2015-07-28 15:50:13 -04:00
Cory Fields
17221bf77e chainparams: don't use std namespace 2015-07-28 15:33:33 -04:00
Cory Fields
f0deec572b chainparams: move CCheckpointData into chainparams.h
This unties CChainParams from its dependency on checkpoints. Instead, now it
only depends on the raw checkpoint data.
2015-07-28 15:26:50 -04:00
Pieter Wuille
eddaba7b56
Revert "Cache transaction validation successes"
This reverts commit 17b11428c1.
2015-07-28 20:15:00 +02:00
Casey Rodarmor
17ac0f4025 Avoid leaking file descriptors in RegisterLoad
This is pretty trivial, but if there's an error here we'll leak a file
descriptor. Changed it to always close the file.
2015-07-28 14:01:00 -04:00
Wladimir J. van der Laan
1369d699b6
Merge pull request #6484
5e56ef5 qt: use CHashWriter also in SignVerifyMessageDialog (Pavel Vasin)
2015-07-28 11:05:32 +02:00
Pavel Vasin
5e56ef5152 qt: use CHashWriter also in SignVerifyMessageDialog
This eliminates unnecessary copying of data being hashed.
2015-07-28 10:59:16 +03:00
Pieter Wuille
d741371d7d Only use randomly created nonces in CRollingBloomFilter. 2015-07-27 19:09:39 +02:00
Peter Todd
d2d7ee0e86 Make CRollingBloomFilter set nTweak for you
While CBloomFilter is usually used with an explicitly set nTweak,
CRollingBloomFilter is only used internally. Requiring every caller to
set nTweak is error-prone and redundant; better to have the class handle
that for you with a high-quality randomness source.

Additionally when clearing the filter it makes sense to change nTweak as
well to recover from a bad setting, e.g. due to insufficient randomness
at initialization, so the clear() method is replaced by a reset() method
that sets a new, random, nTweak value.
2015-07-27 18:38:49 +02:00
Pieter Wuille
a3d65fedaa Reuse vector hashing code for uint256 2015-07-27 18:38:45 +02:00
Peter Todd
bbe41088c6 Add uint256 support to CRollingBloomFilter 2015-07-27 18:37:18 +02:00
Wladimir J. van der Laan
08e9c57ba2
Merge pull request #6077
517e6dd Unit test doublespends in new blocks (Gavin Andresen)
17b1142 Cache transaction validation successes (Pieter Wuille)
2015-07-27 16:31:07 +02:00
Gavin Andresen
517e6dd256 Unit test doublespends in new blocks
As suggested by Greg Maxwell-- unit test to make sure a block
with a double-spend in it doesn't pass validation if half of
the double-spend is already in the memory pool (so full-blown
transaction validation is skipped) when the block is received.
2015-07-27 15:50:21 +02:00
Pieter Wuille
17b11428c1 Cache transaction validation successes 2015-07-27 15:28:43 +02:00
Wladimir J. van der Laan
c6455c77ab doc: mention change to option parsing behavior in release notes 2015-07-27 14:55:15 +02:00
Wladimir J. van der Laan
c38c49d0b7 Fix argument parsing oddity with -noX
`bitcoind -X -noX` ends up, unintuitively, with `X` set.
(for all boolean options X)

This result is due to the odd two-pass processing of arguments. This
patch fixes this oddity and simplifies the code at the same time.
2015-07-27 14:47:54 +02:00
Wladimir J. van der Laan
ca37e0f339
Merge pull request #5697
60c8bac Includes: Cleanup around net main and wallet (Jorge Timón)
9dd793f TRIVIAL: Missing includes (Jorge Timón)
2015-07-27 14:40:29 +02:00
Wladimir J. van der Laan
240b30eaf0
Merge pull request #6380
9127e97 doc: Mention RPC strings for monetary amounts in release notes (Wladimir J. van der Laan)
7d226b7 [QA] add testcases for parsing strings as values (Jonas Schnelli)
614601b rpc: Accept strings in AmountFromValue (Wladimir J. van der Laan)
2015-07-27 14:22:42 +02:00
Wladimir J. van der Laan
9127e9766a doc: Mention RPC strings for monetary amounts in release notes
Add a section "low level RPC API changes" so that the changes with
regard to error codes can be added later.
2015-07-27 13:57:24 +02:00
Jonas Schnelli
7d226b7ca0 [QA] add testcases for parsing strings as values 2015-07-27 13:55:46 +02:00
Wladimir J. van der Laan
614601be8f rpc: Accept strings in AmountFromValue
Accept strings containing decimal values, in addition to bare values.

Useful from JSON-RPC implementations where it's not possible to have
direct control over the text of numbers (e.g. where numbers are always
doubles), and it's still desired to send an exact value.

This would allow users to post JSON content with numbers encoded like
`{"value": "0.00000001"}` instead of `{"value": 0.00000001}` which some
php/python encoders wrap into 1e-8, or worse.
2015-07-27 13:55:46 +02:00
Wladimir J. van der Laan
d43297c5ba
Merge pull request #6468
6f8b6d3 don't try to decode invalid encoded ext keys (Jonas Schnelli)
8d2af54 extend bip32 tests to cover Base58c/CExtKey decode (Jonas Schnelli)
7cb1f9f fix and extend CBitcoinExtKeyBase template (Jonas Schnelli)
2015-07-27 13:20:54 +02:00
Wladimir J. van der Laan
f6850d58f7
Merge pull request #6471
060b3d3 fixup: qt 5.5 snuck in another module that needs path hand-holding (Cory Fields)
ecd6a89 depends: make more qt flags explicit (Cory Fields)
ab67dd7 depends: bump to qt 5.5 (Cory Fields)
5189fe3 depends: split qt config options to separate lines (Jacob Welsh)
fe997df build: fix building against qt5.4/5.5 (Cory Fields)
2015-07-27 12:28:42 +02:00
Cory Fields
060b3d377b fixup: qt 5.5 snuck in another module that needs path hand-holding 2015-07-27 12:25:28 +02:00
Cory Fields
ecd6a89381 depends: make more qt flags explicit 2015-07-27 12:25:28 +02:00
Jonas Schnelli
6f8b6d339b don't try to decode invalid encoded ext keys 2015-07-25 09:51:52 +02:00
Philip Kaufmann
ed166dfa82 [Qt] allow users to set -onion via GUI
- also allow users to see, if the default proxy (-proxy) is used for
  reaching peers via IPv6 or Tor
2015-07-24 12:28:06 +02:00
Wladimir J. van der Laan
bfd807ff32
Merge pull request #6456
ec249d4 util: use locale-independent parsing in ParseDouble (Wladimir J. van der Laan)
7650449 univalue: Avoid unnecessary roundtrip through double for numbers (Wladimir J. van der Laan)
e061e27 rpc: Make ValueFromAmount always return 8 decimals (Wladimir J. van der Laan)
2015-07-24 11:08:52 +02:00
Wladimir J. van der Laan
410fd7448a
Merge pull request #6465
56b28fc Don't share objects between TestInstances (Casey Rodarmor)
2015-07-24 10:59:45 +02:00
Cory Fields
ab67dd7818 depends: bump to qt 5.5 2015-07-23 21:10:35 -04:00
Jacob Welsh
5189fe3d88 depends: split qt config options to separate lines
Helps ease of reading and comparison. Removed some duplicates.
2015-07-23 21:10:35 -04:00
Cory Fields
fe997dfd12 build: fix building against qt5.4/5.5 2015-07-23 21:10:35 -04:00
Jorge Timón
60c8bac77c Includes: Cleanup around net main and wallet
-Move from .h to .cpp: in main, net and wallet
-Remove unnecessary #include "main.h"
-Cleanup some wallet files includes
2015-07-23 21:10:26 +02:00
Jorge Timón
9dd793f499 TRIVIAL: Missing includes 2015-07-23 21:10:22 +02:00
Wladimir J. van der Laan
d2464dfee9
Merge pull request #6287
a794284 locking: add a quick example of GUARDED_BY (Cory Fields)
2b890dd locking: fix a few small issues uncovered by -Wthread-safety (Cory Fields)
cd27bba locking: teach Clang's -Wthread-safety to cope with our scoped lock macros (Cory Fields)
2015-07-23 18:45:26 +02:00
Wladimir J. van der Laan
d946e9a848
Merge pull request #5515
0fcc4e1 Assert on probable deadlocks if the second lock isnt try_lock (Matt Corallo)
2015-07-23 18:34:35 +02:00
Jonas Schnelli
8d2af54ecc extend bip32 tests to cover Base58c/CExtKey decode 2015-07-23 16:32:31 +02:00
Jonas Schnelli
7cb1f9f7eb fix and extend CBitcoinExtKeyBase template
- fix Decode call (req. only one param)
- add constructor for base58c->CExtKey
2015-07-23 16:32:21 +02:00
Matt Corallo
0fcc4e1e04 Assert on probable deadlocks if the second lock isnt try_lock 2015-07-22 16:49:54 -07:00
Ross Nicoll
c433828df9 Handle no chain tip available in InvalidChainFound()
Handle the case where no chain tip is available, in InvalidChainFound(). This fixes a null pointer deference when running unit tests, if the genesis block or block validation code is broken.
2015-07-22 21:10:09 +00:00