Commit Graph

7650 Commits

Author SHA1 Message Date
Masahiko Hyuga f82c81b177 fix getnettotals RPC description about timemillis.
Github-Pull: #9122
Rebased-From: a79f864945
2016-12-02 07:41:11 +00:00
Cory Fields 6fe3981ac8 net: don't send feefilter messages before the version handshake is complete
Github-Pull: #9117
Rebased-From: 46625538d6
2016-12-02 07:41:11 +00:00
Wladimir J. van der Laan 5f3a12c97c qt: Use correct conversion function for boost::path datadir
Fixes #9089.

Github-Pull: #9094
Rebased-From: e760b307f6
2016-12-02 07:41:11 +00:00
UdjinM6 08d1c90113 Missed one "return false" in recent refactoring in #9067
Github-Pull: #9120
Rebased-From: 45d372f889
2016-12-02 07:41:11 +00:00
UdjinM6 f27596a7ec Every main()/exit() should return/use one of EXIT_ codes instead of magic numbers
Github-Pull: #9067
Rebased-From: 4441018d08
2016-12-02 07:41:11 +00:00
UdjinM6 f85ee01303 Fix exit codes:
- `--help`, `--version` etc should exit with `0` i.e. no error ("not enough args" case should still trigger an error)
- error reading config file should exit with `1`

Slightly refactor AppInitRPC/AppInitRawTx to return standard exit codes (EXIT_FAILURE/EXIT_SUCCESS) or CONTINUE_EXECUTION (-1)

Github-Pull: #9067
Rebased-From: bd0de1386e
2016-12-02 07:41:11 +00:00
MarcoFalke 5bcb05d4e1 [rpc] ParseHash: Fail when length is not 64
Github-Pull: #9042
Rebased-From: fa326193ad
2016-12-02 07:41:11 +00:00
Pavel Janík 973ca1e491 Fix doxygen comment: the transaction is returned in txOut
Github-Pull: #8993
Rebased-From: 1d8e12ba48
2016-12-02 07:41:11 +00:00
Jonas Schnelli 6f86b53643 [Qt] make warnings label selectable
Github-Pull: #8972
Rebased-From: ef0c9ee296
2016-12-02 07:41:11 +00:00
BtcDrak 106da691a5 Sync bitcoin-tx with tx version policy
Github-Pull: #8932
Rebased-From: b0aea80579
2016-12-02 07:41:11 +00:00
Gregory Maxwell 3a3bcbf775 Use RelevantServices instead of node_network in AttemptToEvict.
Use of node_network here is really meant to be a proxy of "likely to
 send us blocks in the future".  RelevantServices is the right criteria
 now.

Github-Pull: #9052
Rebased-From: d32036a47d
2016-12-02 07:41:11 +00:00
Gregory Maxwell ca1fd7521e Make orphan parent fetching ask for witnesses.
In 0.13 orphan transactions began being treated as implicit
 INVs for their parents.  But the resulting getdata were
 not getting the witness flag.

This fixes issue #9182 reported by chjj and roasbeef on IRC.

Github-Pull: #9188
Rebased-From: 5b0150a060
2016-12-02 08:38:02 +01:00
Pieter Wuille 99477c71c4 Always add default_witness_commitment with GBT client support
Github-Pull: #9189
Rebased-From: ad04d1cb35
2016-12-02 08:38:02 +01:00
Gregory Maxwell da5a16b11d Always drop the least preferred HB peer when adding a new one.
When a BIP152 HB-mode peer is in the least preferred position and
 disconnects, they will not be by ForNode on the next loop. They
 will continue to sit in that position and prevent deactivating
 HB mode for peers that are still connected.

There is no reason for them to stay in the list if already gone,
 so drop the first element unconditionally if there are too many.

Fixes issue #9163.

Github-Pull: #9199
Rebased-From: ca8549d2bd
2016-12-02 08:38:02 +01:00
jnewbery 094848baf0 log block size and weight correctly.
Github-Pull: #8838
Rebased-From: 5f274a1749
2016-12-02 08:38:02 +01:00
Wladimir J. van der Laan 29435db6a4
Merge #9191: [qa] 0.13.2 Backports
e846166 Modify getblocktxn handler not to drop requests for old blocks (Russell Yanofsky)
2cad5db Align constant names for maximum compact block / blocktxn depth (Pieter Wuille)
3d23a0e Add cmpctblock to debug help list (instagibbs)
76ba1c9 More agressively filter compact block requests (Matt Corallo)
36e3b95 Dont remove a "preferred" cmpctblock peer if they provide a block (Matt Corallo)
286e548 [qa] Fix stale data bug in test_compactblocks_not_at_tip (Russell Yanofsky)
2ba5d78 [qa] Fix bug in compactblocks v2 merge (Russell Yanofsky)
eca9b46 [qa] Wait for specific block announcement in p2p-compactblocks (Russell Yanofsky)
dccdc3a test: Fix use-after-free in scheduler tests (Wladimir J. van der Laan)
da4926b [qa] Add more helpful RPC timeout message (Russell Yanofsky)
1d4c884 [qa] Increase wallet-dump RPC timeout (Russell Yanofsky)
3107280 [qa] add assert_raises_message to check specific error message (mrbandrews)
2016-12-02 08:16:50 +01:00
Matt Corallo b172377857
Revert "Use async name resolving to improve net thread responsiveness"
This reverts commit caf6150e97.

getaddrinfo_a has a nasty tendency to segfault internally in its
background thread, on every version of glibc I tested, especially
under helgrind.

See https://sourceware.org/bugzilla/show_bug.cgi?id=20874

Github-Pull: #9229
Rebased-From: 10ae7a7b23
2016-12-02 05:50:58 +01:00
Wladimir J. van der Laan 94531b5350
torcontrol: Explicitly request RSA1024 private key
When generating a new service key, explicitly request a RSA1024 one.

The bitcoin P2P protocol has no support for the longer hidden service names
that will come with ed25519 keys, until it does, we depend on the old
hidden service type so make this explicit.

See #9214.

Rebased-From: 7d3b627395
Github-Pull: #9234
2016-11-30 12:51:06 +01:00
Russell Yanofsky e8461666ec Modify getblocktxn handler not to drop requests for old blocks
The current getblocktxn implementation drops and ignores requests for old
blocks, which causes occasional sync_block timeouts during the
p2p-compactblocks.py test as reported in
https://github.com/bitcoin/bitcoin/issues/8842.

The p2p-compactblocks.py test setup creates many new blocks in a short
period of time, which can lead to getblocktxn requests for blocks below the
hardcoded depth limit of 10 blocks. This commit changes the getblocktxn
handler not to ignore these requests, so the peer nodes in the test setup
will reliably be able to sync.

The protocol change is documented in BIP-152 update "Allow block responses
to getblocktxn requests" at https://github.com/bitcoin/bips/pull/469.

The protocol change is not expected to affect nodes running outside the test
environment, because there shouldn't normally be lots of new blocks being
rapidly added that need to be synced.

Github-Pull: #9058
Rebased-From: dac53b58b5
Github-Pull: #9160
Rebased-From: ec34648766
2016-11-20 15:25:34 +01:00
Pieter Wuille 2cad5db6f7 Align constant names for maximum compact block / blocktxn depth
Github-Pull: #8637
Rebased-From: 3ac6de0a04
2016-11-20 15:08:16 +01:00
instagibbs 3d23a0eaa3 Add cmpctblock to debug help list
Github-Pull: #8637
Rebased-From: b2e93a343e
2016-11-20 15:08:03 +01:00
Matt Corallo 76ba1c9739 More agressively filter compact block requests
Unit test adaptations by Pieter Wuille.

Github-Pull: #8637
Rebased-From: fe998e962d
2016-11-20 15:07:53 +01:00
Matt Corallo 36e3b95103 Dont remove a "preferred" cmpctblock peer if they provide a block
Github-Pull: #8637
Rebased-From: 02a337defd
2016-11-20 15:07:39 +01:00
Wladimir J. van der Laan dccdc3aa34 test: Fix use-after-free in scheduler tests
Make a copy of the boost time-point to wait for, otherwise the head of
the queue may be deleted by another thread while this one is waiting,
while the boost function still has a reference to it.

Although this problem is in non-test code, this is not an actual problem
outside of the tests because we use the thread scheduler with only one
service thread, so there will never be threads fighting at the head of
the queue.

The old boost fallback escapes this problem because it passes a scalar
value to wait_until instead of a const object reference.

Found by running the tests in LLVM-4.0-master asan.

Github-Pull: #9186
Rebased-From: 12519bf62b
2016-11-19 23:24:35 +01:00
Wladimir J. van der Laan 9460771a60
Merge #9048: [0.13 backport] Fix handling of invalid compact blocks
e8ef50b Bump the protocol version to distinguish new banning behavior. (Suhas Daftuar)
015865e Fix compact block handling to not ban if block is invalid (Suhas Daftuar)
8290506 [qa] Test that invalid compactblocks don't result in ban (Suhas Daftuar)
2016-11-09 22:11:47 +01:00
Suhas Daftuar e8ef50ba51 Bump the protocol version to distinguish new banning behavior.
This allows future software that would relay compact blocks before
full validation to announce only to peers that will not ban if the
block turns out to be invalid.
2016-11-01 15:27:20 -04:00
Suhas Daftuar 015865ee9e Fix compact block handling to not ban if block is invalid 2016-11-01 13:20:21 -04:00
Luke Dashjr 6d05fe115b Add MIT license to Makefiles
Github-Pull: #8784
Rebased-From: f4dffdd6bf
2016-10-27 14:47:22 +02:00
jnewbery 1d048b917b Don't return the address of a P2SH of a P2SH.
Github-Pull: #8845
Rebased-From: d51f182461
2016-10-27 14:47:22 +02:00
maiiz ce0d817b9b Fix relaypriority calculation error
Github-Pull: #8357
Rebased-From: 94a34a5d95
2016-10-27 14:47:22 +02:00
Matt Corallo 9ef38758a6 Add missing cs_main lock to ::GETBLOCKTXN processing
Note that this is not a major issue as, in order for the missing
lock to cause issues, you have to receive a GETBLOCKTXN message
while reindexing, adding a block header via RPC, etc, which results
in either a table rehash or an insert into the bucket which you are
currently looking at.

Github-Pull: #8995
Rebased-From: dfe79060a6
2016-10-27 14:47:22 +02:00
MarcoFalke 58d4fa7da3
[net] Remove assert(nMaxInbound > 0)
nMaxInbound might very well be 0 or -1, if the user prefers to keep
a small number of maxconnections.

Note: nMaxInbound of -1 means that the user set maxconnections
to 8 or less, but we still want to keep an additional slot for
the feeler connection.

Github-Pull: #9008
Rebased-From: fa1c3c2eb0
2016-10-25 19:29:23 +02:00
Wladimir J. van der Laan 0dbc48a5bd
nMaxOutbound is MAX_OUTBOUND_CONNECTIONS on 0.13
Github-Pull: #8949
2016-10-19 11:50:15 +02:00
Wladimir J. van der Laan 53e6196a90
qt: pre-rc2 translations update 2016-10-19 11:48:12 +02:00
Luke Dashjr 7c2bf4b175
RPC/Mining: getblocktemplate: Update and fix formatting of help
Github-Pull: #8951
Rebased-From: 59daa58d6a
2016-10-19 11:24:22 +02:00
Gregory Maxwell 91ae0b06b9
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.

Github-Pull: #8949
Rebased-From: 4630479135
2016-10-19 11:24:12 +02:00
Gregory Maxwell 33cd5539b2
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.

Github-Pull: #8949
Rebased-From: 9583477288
2016-10-19 11:23:53 +02:00
Matt Corallo 685e4c78f8
Remove bogus assert on number of oubound connections.
This value can be significantly higher if the users uses addnode

Github-Pull: #8944
Rebased-From: 1ab21cf344
2016-10-18 14:41:42 +02:00
Wladimir J. van der Laan 3f508edcfb
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.

Github-Pull: #8858
Rebased-From: 1c80386bce
2016-10-18 14:41:17 +02:00
Wladimir J. van der Laan a5cef7b077
Bump version to 0.13.1 2016-10-18 00:15:59 +02:00
Christian Decker 5b4192bc4c
My DNS seed supports filtering
Currently supports filtering by any combination of the 4 least
significant bits.

Github-Pull: #8940
Rebased-From: 2449e12681
2016-10-17 19:43:40 +02:00
Matt Corallo 3d770a88d3
Add x9 service bit support to dnsseed.bluematt.me
Github-Pull: #8940
Rebased-From: ffb4713920
2016-10-17 19:43:11 +02:00
Matt Corallo 9aa0c15972
Comment that most dnsseeds only support some service bits combos
Github-Pull: #8940
Rebased-From: 504c72ad34
2016-10-17 19:42:58 +02:00
Pieter Wuille 8b66659921
Define start and end time for segwit deployment
Github-Pull: #8937
Rebased-From: f9c23dea97
2016-10-17 16:52:31 +02:00
Wladimir J. van der Laan cb8887e87d
qt: periodic translation update 2016-10-17 16:16:20 +02:00
Johnson Lau fef7b46841 test segwit uncompressed key fixes
Github-Pull: #8499
Rebased-From: 9260085377
2016-10-17 14:16:08 +02:00
Pieter Wuille 4ec21e8a64 Fix ismine and addwitnessaddress: no uncompressed keys in segwit
Github-Pull: #8499
Rebased-From: 248f3a76a8
2016-10-17 14:10:59 +02:00
Johnson Lau 821f3e6751 Require compressed keys in segwit as policy and disable signing with uncompressed keys for segwit scripts
Github-Pull: #8499
Rebased-From: 4c0c25a604
2016-10-17 14:10:58 +02:00
Johnson Lau 540413d995 Add standard limits for P2WSH with tests
Github-Pull: #8499
Rebased-From: 3ade2f64cf
2016-10-17 14:10:58 +02:00
jonnynewbs bcf3806f4c Update bitcoin-tx to output witness data.
Github-Pull: #8817
Rebased-From: 4408558843
2016-10-13 20:35:33 +02:00