Commit graph

8013 commits

Author SHA1 Message Date
Wladimir J. van der Laan
e44753c067
Merge #8949: Be more agressive in getting connections to peers with relevant services.
4630479 Make dnsseed's definition of acute need include relevant services. (Gregory Maxwell)
9583477 Be more aggressive in connecting to peers with relevant services. (Gregory Maxwell)
2016-10-19 10:43:54 +02:00
Wladimir J. van der Laan
1230890a6d
Merge #8936: Report NodeId in misbehaving debug
a1919ad Report NodeId in misbehaving debug (R E Broadley)
2016-10-19 10:35:44 +02:00
Gregory Maxwell
4630479135 Make dnsseed's definition of acute need include relevant services.
We normally prefer to connect to peers offering the relevant services.

If we're not connected to enough peers with relevant services, we
 probably don't know about them and could use dnsseed's help.
2016-10-19 08:07:02 +00:00
Wladimir J. van der Laan
05998da5a7
Merge #8865: Decouple peer-processing-logic from block-connection-logic
a9aec5c Use BlockChecked signal to send reject messages from mapBlockSource (Matt Corallo)
7565e03 Remove SyncWithWallets wrapper function (Matt Corallo)
12ee1fe Always call UpdatedBlockTip, even if blocks were only disconnected (Matt Corallo)
f5efa28 Remove CConnman parameter from ProcessNewBlock/ActivateBestChain (Matt Corallo)
fef1010 Use CValidationInterface from chain logic to notify peer logic (Matt Corallo)
aefcb7b Move net-processing logic definitions together in main.h (Matt Corallo)
0278fb5 Remove duplicate nBlocksEstimate cmp (we already checked IsIBD()) (Matt Corallo)
87e7d72 Make validationinterface.UpdatedBlockTip more verbose (Matt Corallo)
2016-10-18 22:48:51 +02:00
Wladimir J. van der Laan
74dc388ab5
Merge #8873: Add microbenchmarks to profile more code paths.
18dacf9 Add microbenchmarks to profile more code paths. (Russell Yanofsky)
2016-10-18 22:03:52 +02:00
Russell Yanofsky
18dacf9bd2 Add microbenchmarks to profile more code paths.
The new benchmarks exercise script validation, CCoinsDBView caching,
mempool eviction, and wallet coin selection code.

All of the benchmarks added here are extremely simple and don't
necessarily mirror common real world conditions or interesting
performance edge cases. Details about how specific benchmarks can be
improved are noted in comments.

Github-Issue: #7883
2016-10-18 21:59:05 +02:00
Wladimir J. van der Laan
7f71a3c591
Merge #6996: Add preciousblock RPC
5805ac8 Add preciousblock tests (Pieter Wuille)
5127c4f Add preciousblock RPC (Pieter Wuille)
2016-10-18 21:36:38 +02:00
Matt Corallo
72ca7d924e Don't hold cs_main when calling ProcessNewBlock from a cmpctblock 2016-10-18 15:24:59 -04:00
Wladimir J. van der Laan
0b5a997acf
Merge #8637: Compact Block Tweaks (rebase of #8235)
3ac6de0 Align constant names for maximum compact block / blocktxn depth (Pieter Wuille)
b2e93a3 Add cmpctblock to debug help list (instagibbs)
fe998e9 More agressively filter compact block requests (Matt Corallo)
02a337d Dont remove a "preferred" cmpctblock peer if they provide a block (Matt Corallo)
2016-10-18 21:19:54 +02:00
Wladimir J. van der Laan
744d2652dd
Merge #8223: [c++11] Use std::unique_ptr for block creation.
9fce062 [c++11] Use std::unique_ptr for block creation. (Daniel Kraft)
2016-10-18 21:16:08 +02:00
Wladimir J. van der Laan
e10af96cf4
Merge #8287: [wallet] Set fLimitFree = true
fa8b02d [rpc] rawtx: Prepare fLimitFree to make it an option (MarcoFalke)
fa28bfa [wallet] Set fLimitFree = true (MarcoFalke)
2016-10-18 21:05:07 +02:00
Wladimir J. van der Laan
cdfb7755a6
Merge #8914: Kill insecure_random and associated global state
5eaaa83 Kill insecure_random and associated global state (Wladimir J. van der Laan)
2016-10-18 15:44:57 +02:00
Wladimir J. van der Laan
f628d9a29a
Merge #8925: qt: Display minimum ping in debug window.
1724a40 Display minimum ping in debug window. (R E Broadley)
2016-10-18 15:16:39 +02:00
Wladimir J. van der Laan
6e094e54f7
Merge #8845: Don't return the address of a P2SH of a P2SH
d51f182 Don't return the address of a P2SH of a P2SH. (jnewbery)
2016-10-18 14:33:26 +02:00
Wladimir J. van der Laan
dd07c6b2cc
Merge #8921: RPC: Chainparams: Remove Chainparams::fTestnetToBeDeprecatedFieldRPC
b26a7b5 RPC: Chainparams: Remove Chainparams::fTestnetToBeDeprecatedFieldRPC (Jorge Timón)
2016-10-18 13:31:59 +02:00
Jorge Timón
b26a7b5377
RPC: Chainparams: Remove Chainparams::fTestnetToBeDeprecatedFieldRPC 2016-10-18 13:17:38 +02:00
Wladimir J. van der Laan
614d522c3e
Merge #8932: Allow bitcoin-tx to create v2 transactions
b0aea80 Sync bitcoin-tx with tx version policy (BtcDrak)
2016-10-18 11:45:07 +02:00
Wladimir J. van der Laan
cd761fb85a
Merge #8944: Remove bogus assert on number of oubound connections.
1ab21cf Remove bogus assert on number of oubound connections. (Matt Corallo)
2016-10-18 10:43:52 +02:00
Wladimir J. van der Laan
47ace4240a
Merge #8918: Qt: Add "Copy URI" to payment request context menu
21f5a63 Qt: Add "Copy URI" to payment request context menu (Luke Dashjr)
2016-10-18 10:37:17 +02:00
R E Broadley
a1919adab0 Report NodeId in misbehaving debug 2016-10-18 07:17:09 +07:00
Gregory Maxwell
9583477288 Be more aggressive in connecting to peers with relevant services.
Only allow skipping relevant services until there are four outbound
 connections up.

This avoids quickly filling up with peers lacking the relevant
 services when addrman has few or none of them.
2016-10-17 23:08:52 +00:00
Matt Corallo
1ab21cf344 Remove bogus assert on number of oubound connections.
This value can be significantly higher if the users uses addnode
2016-10-17 16:29:03 -04:00
Christian Decker
2449e12681 My DNS seed supports filtering
Currently supports filtering by any combination of the 4 least
significant bits.
2016-10-17 13:33:53 -04:00
Matt Corallo
ffb4713920 Add x9 service bit support to dnsseed.bluematt.me 2016-10-17 13:33:52 -04:00
Matt Corallo
504c72ad34 Comment that most dnsseeds only support some service bits combos 2016-10-17 13:33:25 -04:00
Wladimir J. van der Laan
c6b959efcf
Merge #8937: Define start and end time for segwit deployment
f9c23de Define start and end time for segwit deployment (Pieter Wuille)
2016-10-17 16:49:12 +02:00
Pieter Wuille
3ac6de0a04 Align constant names for maximum compact block / blocktxn depth 2016-10-17 16:46:30 +02:00
instagibbs
b2e93a343e Add cmpctblock to debug help list 2016-10-17 16:44:57 +02:00
Matt Corallo
fe998e962d More agressively filter compact block requests
Unit test adaptations by Pieter Wuille.
2016-10-17 16:44:57 +02:00
Matt Corallo
02a337defd Dont remove a "preferred" cmpctblock peer if they provide a block 2016-10-17 16:44:57 +02:00
Pieter Wuille
f9c23dea97 Define start and end time for segwit deployment 2016-10-17 14:15:57 +02:00
Wladimir J. van der Laan
53133c1c04
Merge #8499: Add several policy limits and disable uncompressed keys for segwit scripts
67d6ee1 remove redundant tests in p2p-segwit.py (Johnson Lau)
9260085 test segwit uncompressed key fixes (Johnson Lau)
248f3a7 Fix ismine and addwitnessaddress: no uncompressed keys in segwit (Pieter Wuille)
b811124 [qa] Add tests for uncompressed pubkeys in segwit (Suhas Daftuar)
9f0397a Make test framework produce lowS signatures (Johnson Lau)
4c0c25a Require compressed keys in segwit as policy and disable signing with uncompressed keys for segwit scripts (Johnson Lau)
3ade2f6 Add standard limits for P2WSH with tests (Johnson Lau)
2016-10-17 13:27:05 +02:00
Wladimir J. van der Laan
5eaaa83ac1 Kill insecure_random and associated global state
There are only a few uses of `insecure_random` outside the tests.
This PR replaces uses of insecure_random (and its accompanying global
state) in the core code with an FastRandomContext that is automatically
seeded on creation.

This is meant to be used for inner loops. The FastRandomContext
can be in the outer scope, or the class itself, then rand32() is used
inside the loop. Useful e.g. for pushing addresses in CNode or the fee
rounding, or randomization for coin selection.

As a context is created per purpose, thus it gets rid of
cross-thread unprotected shared usage of a single set of globals, this
should also get rid of the potential race conditions.

- I'd say TxMempool::check is not called enough to warrant using a special
  fast random context, this is switched to GetRand() (open for
  discussion...)

- The use of `insecure_rand` in ConnectThroughProxy has been replaced by
  an atomic integer counter. The only goal here is to have a different
  credentials pair for each connection to go on a different Tor circuit,
  it does not need to be random nor unpredictable.

- To avoid having a FastRandomContext on every CNode, the context is
  passed into PushAddress as appropriate.

There remains an insecure_random for test usage in `test_random.h`.
2016-10-17 13:08:35 +02:00
BtcDrak
b0aea80579
Sync bitcoin-tx with tx version policy 2016-10-16 23:22:15 +01:00
Johnson Lau
9260085377 test segwit uncompressed key fixes 2016-10-17 00:34:37 +08:00
Pieter Wuille
248f3a76a8 Fix ismine and addwitnessaddress: no uncompressed keys in segwit 2016-10-17 00:34:37 +08:00
Johnson Lau
4c0c25a604 Require compressed keys in segwit as policy and disable signing with uncompressed keys for segwit scripts 2016-10-16 23:53:35 +08:00
Johnson Lau
3ade2f64cf Add standard limits for P2WSH with tests 2016-10-16 23:53:35 +08:00
Matt Corallo
37aefff5fc Fix init segfault where InitLoadWallet() calls ATMP before genesis 2016-10-15 13:19:16 -04:00
Johnson Lau
acf853df91 Add script tests for FindAndDelete in pre-segwit and segwit scripts 2016-10-16 00:30:50 +08:00
R E Broadley
1724a405c9 Display minimum ping in debug window. 2016-10-15 20:43:11 +07:00
Wladimir J. van der Laan
49c5910372
Merge #8880: protocol.h: Move MESSAGE_START_SIZE into CMessageHeader
1df3111 protocol.h: Make enums in GetDataMsg concrete values (Wladimir J. van der Laan)
2c09a52 protocol.h: Move MESSAGE_START_SIZE into CMessageHeader (Wladimir J. van der Laan)
f9bd92d version.h: s/shord/short/ in comment (Wladimir J. van der Laan)
2016-10-15 10:27:46 +02:00
Wladimir J. van der Laan
088d1f4413
Merge #8906: [qt] sync-overlay: Don't show progress twice
fafeec3 [qt] sync-overlay: Don't show progress twice (MarcoFalke)
2016-10-15 09:44:20 +02:00
Luke Dashjr
21f5a6364d Qt: Add "Copy URI" to payment request context menu 2016-10-13 23:27:43 +00:00
Wladimir J. van der Laan
e2b8c394d6
Merge #8817: update bitcoin-tx to output witness data
4408558 Update bitcoin-tx to output witness data. (jonnynewbs)
2016-10-13 18:56:43 +02:00
Wladimir J. van der Laan
8d46429c83
Merge #8911: qt: Translate all files, even if wallet disabled
8aed5f6 qt: Translate all files, even if wallet disabled (Wladimir J. van der Laan)
2016-10-13 10:30:38 +02:00
Wladimir J. van der Laan
8aed5f6c23 qt: Translate all files, even if wallet disabled
This passes all QT cpp files to the lupdate executable which extracts
translations, no matter what conditional functionality is enabled.
2016-10-11 17:46:46 +02:00
MarcoFalke
fafeec3cf2 [qt] sync-overlay: Don't show progress twice
* Don't show integer progress in progress bar. (Already shown in front
  of progress bar)

* Also, use non-static method to get current msecs
2016-10-10 17:07:43 +02:00
Jonas Schnelli
bf8e68aba6
Merge #8821: [qt] sync-overlay: Don't block during reindex
fa85e86 [qt] sync-overlay: Don't show estimated number of headers left (MarcoFalke)
faa4de2 [qt] sync-overlay: Don't block during reindex (MarcoFalke)
2016-10-10 16:52:44 +02:00
Pieter Wuille
6429cfa8a7
Merge #8393: Support for compact blocks together with segwit
27acfc1 [qa] Update p2p-compactblocks.py for compactblocks v2 (Suhas Daftuar)
422fac6 [qa] Add support for compactblocks v2 to mininode (Suhas Daftuar)
f5b9b8f [qa] Fix bug in mininode witness deserialization (Suhas Daftuar)
6aa28ab Use cmpctblock type 2 for segwit-enabled transfer (Pieter Wuille)
be7555f Fix overly-prescriptive p2p-segwit test for new fetch logic (Matt Corallo)
06128da Make GetFetchFlags always request witness objects from witness peers (Matt Corallo)
2016-10-10 13:16:40 +02:00
MarcoFalke
e66cc1d58e
Merge #8881: Add some verbose logging to bitcoin-util-test.py
621441a add verbose mode to bitcoin-util-test.py (jnewbery)
2016-10-08 21:23:42 +02:00
Jonas Schnelli
b2fec4e9a1
Merge #8885: gui: fix ban from qt console
cb78c60 gui: fix ban from qt console (Cory Fields)
2016-10-08 16:43:15 +02:00
jnewbery
621441a7a7 add verbose mode to bitcoin-util-test.py 2016-10-05 09:16:08 -04:00
jonnynewbs
4408558843 Update bitcoin-tx to output witness data. 2016-10-05 09:00:34 -04:00
jnewbery
d51f182461 Don't return the address of a P2SH of a P2SH. 2016-10-05 08:58:18 -04:00
Wladimir J. van der Laan
223f4c2dd5
Merge #8884: Bugfix: Trivial: RPC: getblockchaininfo help: pruneheight is the lowest, not highest, block
a78e542 Bugfix: Trivial: RPC: getblockchaininfo help: pruneheight is the lowest, not highest, block (Luke Dashjr)
2016-10-05 14:44:07 +02:00
Wladimir J. van der Laan
1df311118d protocol.h: Make enums in GetDataMsg concrete values
This concretizes the numbers and adds a comment to make it clear that
these numbers are fixed by the protocol, and may avoid people forgetting
to claim numbers in the future (e.g. issue #8500).

Also gets rid of a weird unused `MSG_TYPE_MAX` in the middle of the
enumeration (thanks @paveljanik for noticing).
2016-10-05 13:32:20 +02:00
Wladimir J. van der Laan
f92805025d
Merge #8879: [doc] Rework docs
eeeebdd [doc] Rework docs (MarcoFalke)
2016-10-05 05:07:19 +02:00
Cory Fields
cb78c60534 gui: fix ban from qt console
Rather than doing a circle and re-resolving the node's IP, just use the one
from nodestats directly.

This requires syncing the addr field from CNode.
2016-10-04 19:43:53 -04:00
Luke Dashjr
a78e5428ac Bugfix: Trivial: RPC: getblockchaininfo help: pruneheight is the lowest, not highest, block 2016-10-04 22:22:07 +00:00
Luke Dashjr
178cd887ec Qt/splash: Specifically keep track of which wallet(s) we are connected to for later disconnecting 2016-10-04 20:30:10 +00:00
Luke Dashjr
1880aeb033 Qt: Get the private key for signing messages via WalletModel 2016-10-04 20:30:10 +00:00
Matt Corallo
a9aec5c24d Use BlockChecked signal to send reject messages from mapBlockSource 2016-10-04 13:54:29 -04:00
Matt Corallo
7565e03b96 Remove SyncWithWallets wrapper function 2016-10-04 13:53:04 -04:00
Matt Corallo
12ee1fe018 Always call UpdatedBlockTip, even if blocks were only disconnected 2016-10-04 13:52:57 -04:00
Matt Corallo
f5efa28393 Remove CConnman parameter from ProcessNewBlock/ActivateBestChain 2016-10-04 13:51:32 -04:00
Matt Corallo
fef1010199 Use CValidationInterface from chain logic to notify peer logic
This adds a new CValidationInterface subclass, defined in main.h,
to receive notifications of UpdatedBlockTip and use that to push
blocks to peers, instead of doing it directly from
ActivateBestChain.
2016-10-04 13:49:44 -04:00
Matt Corallo
aefcb7b70c Move net-processing logic definitions together in main.h 2016-10-04 13:36:11 -04:00
Pieter Wuille
6aa28abf53 Use cmpctblock type 2 for segwit-enabled transfer
Contains version negotiation logic by Matt Corallo and bugfixes by
Suhas Daftuar.
2016-10-04 19:10:41 +02:00
Matt Corallo
0278fb5f48 Remove duplicate nBlocksEstimate cmp (we already checked IsIBD()) 2016-10-04 12:35:07 -04:00
Matt Corallo
87e7d72807 Make validationinterface.UpdatedBlockTip more verbose
In anticipation of making all the callbacks out of block processing
flow through it. Note that vHashes will always have something in it
since pindexFork != pindexNewTip.
2016-10-04 12:35:07 -04:00
Matt Corallo
06128da751 Make GetFetchFlags always request witness objects from witness peers
This fixes a bug where we might (in exceedingly rare circumstances)
accidentally ban a node for sending us the first (potentially few)
segwit blocks in non-segwit mode.
2016-10-04 18:24:10 +02:00
MarcoFalke
eeeebdd3cb [doc] Rework docs
* Minor formatting such as adjusting links
* Move sections of `doc/multiwallet-qt.md` to the source code and delete
  the file, as it is outdated
* Fix typo in the release notes
* Amend release process to mention update of BLOCK_CHAIN_SIZE
2016-10-04 13:27:38 +02:00
Wladimir J. van der Laan
2c09a5209a protocol.h: Move MESSAGE_START_SIZE into CMessageHeader
Also move the enum to the top, and remove a deceptive TODO
comment.
2016-10-04 11:12:55 +00:00
Wladimir J. van der Laan
f9bd92d235 version.h: s/shord/short/ in comment 2016-10-04 11:11:21 +00:00
Wladimir J. van der Laan
d7615af34e
Merge #8848: Add NULLDUMMY verify flag in bitcoinconsensus.h
2fa0063 Add NULLDUMMY verify flag in bitcoinconsensus.h (Johnson Lau)
2016-10-04 12:18:16 +02:00
Wladimir J. van der Laan
d93f0c6184
Merge #8862: Fix a few cases where messages were sent after requested disconnect
905bc68 net: fix a few cases where messages were sent rather than dropped upon disconnection (Cory Fields)
2016-10-04 12:13:50 +02:00
Wladimir J. van der Laan
7dce175f5d
Merge #8850: Implement (begin|end)_ptr in C++11 and add deprecation comment
f00705a serialize: Deprecate `begin_ptr` / `end_ptr` (Wladimir J. van der Laan)
47314e6 prevector: add C++11-like data() method (Wladimir J. van der Laan)
2016-10-04 11:08:06 +02:00
Wladimir J. van der Laan
a7e5cbb209
Merge #8856: Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgs
3450c18 Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgs (Jorge Timón)
2016-10-03 15:25:09 +02:00
Wladimir J. van der Laan
eafc5f4fae
Merge #8863: univalue: Pull subtree
2ca7faa Squashed 'src/univalue/' changes from daf1285..16a1f7f (MarcoFalke)
2016-10-03 08:45:13 +02:00
Wladimir J. van der Laan
f00705ae7f
serialize: Deprecate begin_ptr / end_ptr
Implement `begin_ptr` and `end_ptr` in terms of C++11 code,
and add a comment that they are deprecated.

Follow-up to developer notes update in 654a211622.
2016-10-02 09:50:25 +02:00
Cory Fields
905bc68d05 net: fix a few cases where messages were sent rather than dropped upon disconnection
75ead758 turned these into crashes in the event of a handshake failure, most
notably when a peer does not offer the expected services.

There are likely other cases that these assertions will find as well.
2016-10-01 19:13:10 -04:00
Wladimir J. van der Laan
1c80386bce rpc: Generate auth cookie in hex instead of base64
Base64 contains '/', and the '/' character in credentials is problematic
for AuthServiceProxy which represents the RPC endpoint as an URI with
user and password embedded.

Closes #8399.
2016-10-01 16:57:25 +02:00
Jorge Timón
3450c18a12
Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgs 2016-10-01 08:12:19 +02:00
MarcoFalke
e757115164 Merge commit '2ca7faab4205822b06dc2ab2bbda0a9a70fce7e0' into HEAD 2016-09-30 19:58:11 +02:00
Wladimir J. van der Laan
940748b4b0
Merge #8851: [wallet] Move key derivation logic from GenerateNewKey to DeriveNewChildKey (pstratem)
e198c52 Move key derivation logic from GenerateNewKey to DeriveNewChildKey (Patrick Strateman)
2016-09-30 19:56:03 +02:00
Patrick Strateman
e198c521d3 Move key derivation logic from GenerateNewKey to DeriveNewChildKey 2016-09-30 19:11:00 +02:00
Wladimir J. van der Laan
fb24d7eeb4
Merge #8813: bitcoind: Daemonize using daemon(3)
a92bf4a bitcoind: Daemonize using daemon(3) (Matthew King)
2016-09-30 18:19:31 +02:00
Wladimir J. van der Laan
47314e6daa prevector: add C++11-like data() method
This returns a pointer to the beginning of the vector's data.
2016-09-30 17:19:51 +02:00
Wladimir J. van der Laan
9bc6a6bd7b
Merge #8822: net: Consistent checksum handling
305087b net: Hardcode protocol sizes and use fixed-size types (Wladimir J. van der Laan)
41e58fa net: Consistent checksum handling (Wladimir J. van der Laan)
2016-09-30 17:10:58 +02:00
Johnson Lau
2fa0063c26 Add NULLDUMMY verify flag in bitcoinconsensus.h 2016-09-30 23:09:19 +08:00
Wladimir J. van der Laan
ef0801bd13
Merge #8830: [test] Add option to run bitcoin-util-test.py manually
b82f493 Add option to run bitcoin-util-test.py manually (jnewbery)
2016-09-30 17:03:21 +02:00
Wladimir J. van der Laan
90adfabd5d
Merge #8836: bitcoin-util-test.py should fail if the output file is empty
da94697 bitcoin-util-test.py should fail if the output file is empty (jnewbery)
2016-09-30 12:36:02 +02:00
Wladimir J. van der Laan
f560d9564f
Merge #8826: Do not include env_win.cc on non-Windows systems
7e5fd71 Do not include env_win.cc on non-Windows systems (Pavel Janík)
2016-09-29 17:27:28 +02:00
jnewbery
da94697708 bitcoin-util-test.py should fail if the output file is empty 2016-09-29 10:16:56 -04:00
Wladimir J. van der Laan
9b94cca41f
Merge #8658: Remove unused statements in serialization
64d9507 [WIP] Remove unused statement in serialization (Pavel Janík)
2016-09-29 15:00:22 +02:00
jnewbery
b82f493938 Add option to run bitcoin-util-test.py manually 2016-09-29 08:54:56 -04:00
MarcoFalke
fa85e860a9 [qt] sync-overlay: Don't show estimated number of headers left 2016-09-29 13:24:29 +02:00
MarcoFalke
8ca69a2a88
Merge #8829: Add bitcoin-tx JSON tests
54e5d7c Add bitcoin-tx JSON tests (jnewbery)
2016-09-29 10:50:05 +02:00
Wladimir J. van der Laan
7d563cc16d
Merge #8832: [rpc] throw JSONRPCError when utxo set can not be read
fa05cfd [rpc] throw JSONRPCError when utxo set can not be read (MarcoFalke)
2016-09-29 08:12:55 +02:00