Commit graph

12963 commits

Author SHA1 Message Date
Matt Corallo
22b4966a29 Move [clean|str]SubVer writes/copyStats into a lock 2017-02-10 11:32:41 -05:00
Matt Corallo
0f31872615 Make nServices atomic 2017-02-10 11:32:41 -05:00
Matt Corallo
96f42d8a12 Make nStartingHeight atomic 2017-02-10 11:32:40 -05:00
Matt Corallo
512731bed0 Access fRelayTxes with cs_filter lock in copyStats 2017-02-10 11:32:40 -05:00
Matt Corallo
ae683c1b19 Avoid copying CNodeStats to make helgrind OK with buggy std::string 2017-02-10 11:32:40 -05:00
Matt Corallo
644f1234e2 Make nTimeConnected const in CNode 2017-02-10 11:32:40 -05:00
Cory Fields
321d0fc6b6 net: fix a few races. Credit @TheBlueMatt
These are (afaik) all long-standing races or concurrent accesses. Going
forward, we can clean these up so that they're not all individual atomic
accesses.

- Reintroduce cs_vRecv to guard receive-specific vars
- Lock vRecv/vSend for CNodeStats
- Make some vars atomic.
- Only set the connection time in CNode's constructor so that it doesn't change
2017-02-10 11:32:39 -05:00
Wladimir J. van der Laan
2447c1024e
Merge #9698: net: fix socket close race
9a0b784 net: add a lock around hSocket (Cory Fields)
45e2e08 net: rearrange so that socket accesses can be grouped together (Cory Fields)
2017-02-10 12:42:53 +01:00
Wladimir J. van der Laan
a60677e394 Pre-0.14.0 hardcoded seeds update 2017-02-10 11:04:34 +01:00
Wladimir J. van der Laan
bfa9393c06 contrib/seeds: Update PATTERN_AGENT
gmaxwell: Adds the newest versions, drops everything multiple softforks ago.
2017-02-10 11:04:33 +01:00
Wladimir J. van der Laan
4dfac2c950 Update seeds tooling to Python 3
All the other tooling scripts require Python 3, it makes sense to do so
here too.

Also document the dependency on python3-dnspython.
2017-02-10 10:29:09 +01:00
Wladimir J. van der Laan
7179e7ca0d qt: Periodic translations update 2017-02-10 08:56:36 +00:00
Wladimir J. van der Laan
5e903a5ed9 devtools: Handle Qt formatting characters edge-case in update-translations.py
If both numeric format specifiers and "others" are used, assume we're
dealing with a Qt-formatted message. In the case of Qt formatting (see
https://doc.qt.io/qt-5/qstring.html#arg) only numeric formats are
replaced at all. This means "(percentage: %1%)" is valid (which was
introduced in #9461), without needing any kind of escaping that would be
necessary for strprintf.  Without this, this function would wrongly
detect '%)' as a printf format specifier.
2017-02-10 08:56:27 +00:00
Jonas Schnelli
33f3b21407
Merge #9730: Remove bitseed.xf2.org form the dns seed list
ca9955e Remove bitseed.xf2.org form the dns seed list (Jonas Schnelli)
2017-02-10 09:14:21 +01:00
Matt Corallo
66f861ade9 Add a test for P2P inactivity timeouts 2017-02-09 17:34:03 -05:00
Jonas Schnelli
ca9955e706
Remove bitseed.xf2.org form the dns seed list 2017-02-09 11:28:01 +01:00
Wladimir J. van der Laan
36f9d3ae6d
Merge #9718: Qt/Intro: Various fixes
a9baa6d Bugfix: Qt/Intro: Pruned nodes never require *more* space (Luke Dashjr)
93ffba7 Bugfix: Qt/Intro: Chain state needs to be stored even with the full blockchain (Luke Dashjr)
c8cee26 Qt/Intro: Update block chain size (Luke Dashjr)
2017-02-09 07:30:10 +01:00
Koki Takahashi
36164faa33 Fix typo and spelling inconsistency in CONTRIBUTING.md
Fix spellings of GitHub

Remove unnecessary changes

Fix GitHub spelling on doc/translation_process.md
2017-02-09 11:56:44 +09:00
Luke Dashjr
a9baa6d742 Bugfix: Qt/Intro: Pruned nodes never require *more* space 2017-02-08 19:16:00 +00:00
Luke Dashjr
93ffba7163 Bugfix: Qt/Intro: Chain state needs to be stored even with the full blockchain 2017-02-08 18:51:05 +00:00
Luke Dashjr
c8cee26100 Qt/Intro: Update block chain size 2017-02-08 18:51:05 +00:00
Matt Corallo
b436f92f72 qa: Expose on-connection to mininode listeners 2017-02-08 12:05:13 -05:00
Matt Corallo
8aaba7a6b7 qa: mininode learns when a socket connects, not its first action 2017-02-08 12:05:13 -05:00
John Newbery
9db8eecac1 Fix RPC failure testing
Make sure that RPC tests are actually checking failures correctly by:

- Catching JSON RPC exceptions and verifying the error codes and messages.
- Failing the test case if the JSON RPC exception isn't raised.
2017-02-08 10:24:02 -05:00
Wladimir J. van der Laan
dd163f5788
Merge #9674: Always enforce strict lock ordering (try or not)
618ee92 Further-enforce lockordering by enforcing directly after TRY_LOCKs (Matt Corallo)
2a962d4 Fixup style a bit by moving { to the same line as if statements (Matt Corallo)
8465631 Always enforce lock strict lock ordering (try or not) (Matt Corallo)
fd13eca Lock cs_vSend and cs_inventory in a consistent order even in TRY (Matt Corallo)
2017-02-08 14:46:43 +01:00
Wladimir J. van der Laan
6a55515a9b
Merge #9705: build: Add options to override BDB cflags/libs
5cc2ebb Update OpenBSD and FreeBSD build steps (Wladimir J. van der Laan)
8713de8 build: Add options to override BDB cflags/libs (Wladimir J. van der Laan)
2017-02-08 14:38:28 +01:00
MarcoFalke
d304fef374
Merge #9712: bench: Fix initialization order in registration
29c5328 bench: Fix initialization order in registration (Wladimir J. van der Laan)
2017-02-08 04:43:13 +01:00
Matt Corallo
2cbd1196b7 Disconnect peers which we do not receive VERACKs from within 60 sec 2017-02-07 17:44:46 -05:00
Matt Corallo
618ee9249b Further-enforce lockordering by enforcing directly after TRY_LOCKs 2017-02-07 14:15:28 -05:00
Wladimir J. van der Laan
29c53289a9 bench: Fix initialization order in registration
The initialization order of global data structures in different
implementation units is undefined. Making use of this is essentially
gambling on what the linker does, the so-called [Static initialization
order fiasco](https://isocpp.org/wiki/faq/ctors#static-init-order).

In this case it apparently worked on Linux but failed on OpenBSD and
FreeBSD.

To create it on first use, make the registration structure local to
a function.

Fixes #8910.
2017-02-07 19:07:29 +01:00
practicalswift
a47da4b6fe Use z = std::max(x - y, 0); instead of z = x - y; if (z < 0) z = 0; 2017-02-07 15:46:38 +01:00
Wladimir J. van der Laan
b709fe7ffc
Merge #9532: Remove unused variables
90fd29b Remove unused int64_t nSinceLastSeen (practicalswift)
ac4a095 Remove unused Python variables (practicalswift)
2017-02-07 15:28:50 +01:00
Wladimir J. van der Laan
729de15b63
Merge #9604: [Trivial] add comment about setting peer as HB peer.
dd5b011 [Trivial] add comment about setting peer as HB peer. (John Newbery)
2017-02-07 13:03:57 +01:00
Wladimir J. van der Laan
5cc2ebb619 Update OpenBSD and FreeBSD build steps
Re-try with most recent versions, and use BDB_CFLAGS/BDB_LIBS to
directly point at BerkeleyDB instead of CPPFLAGS hacks.
2017-02-07 13:01:41 +01:00
Wladimir J. van der Laan
8713de83a0 build: Add options to override BDB cflags/libs
Add environment settings to specify the CFLAGS and LIBS to be used for
BerkeleyDB directly. These will completely by-pass autodetection in the
same way as other similar flags.

```
BDB_CFLAGS  C compiler flags for BerkeleyDB, bypasses autodetection
BDB_LIBS    Linker flags for BerkeleyDB, bypasses autodetection
```

Implements #3921.
2017-02-07 13:01:41 +01:00
Cory Fields
9a0b784dea net: add a lock around hSocket 2017-02-06 14:48:50 -05:00
Cory Fields
45e2e08561 net: rearrange so that socket accesses can be grouped together 2017-02-06 14:48:50 -05:00
Wladimir J. van der Laan
02464da5e4
Merge #9227: Make nWalletDBUpdated atomic to avoid a potential race.
d63ff62 Make nWalletDBUpdated atomic to avoid a potential race. (Patrick Strateman)
2017-02-06 16:14:17 +01:00
Wladimir J. van der Laan
870cd2b58a
Merge #9378: [trivial] Add documentation for CWalletTx::fFromMe member.
39c77b0 Add documentation for CWalletTx::fFromMe member. (Russell Yanofsky)
2017-02-06 14:58:02 +01:00
Wladimir J. van der Laan
40f7e27d25
Merge #9650: Better handle invalid parameters to signrawtransaction
6dbfe08 [qa] test signrawtransaction merge with missing inputs (Matt Corallo)
ec4f7e4 [qa] Add second input to signrawtransaction test case (Matt Corallo)
691710a [qa] Test that decoderawtransaction throws with extra data appended (Matt Corallo)
922bea9 Better handle invalid parameters to signrawtransaction (Matt Corallo)
7ea0ad5 Fail in DecodeHexTx if there is extra data at the end (Matt Corallo)
2017-02-06 14:51:00 +01:00
Wladimir J. van der Laan
09e0c28f85
Merge #9659: Net: Turn some methods and params/variables const
0729102 Net: pass interruptMsgProc as const where possible (Jorge Timón)
fc7f2ff Net: Make CNetMsgMaker more const (Jorge Timón)
d45955f Net: CConnman: Make some methods const (Jorge Timón)
2017-02-06 14:34:53 +01:00
Wladimir J. van der Laan
986ba005ed
Merge #9651: Fix typos
5f62e3e Fix typos (practicalswift)
2017-02-06 14:20:05 +01:00
Wladimir J. van der Laan
8d6447ecf7
Merge #9673: Set correct metadata on bumpfee wallet transactions
4ec057d [wallet] Set correct metadata on bumpfee wallet transactions (Russell Yanofsky)
2017-02-06 12:48:55 +01:00
Wladimir J. van der Laan
fc67cd22f8
Merge #9691: Init ECC context for test_bitcoin_fuzzy.
ac719c9 Init ECC context for test_bitcoin_fuzzy. (Gregory Maxwell)
2017-02-06 09:22:14 +01:00
Pieter Wuille
923dc447ea
Merge #9578: Add missing mempool lock for CalculateMemPoolAncestors
003cd60 Add missing mempool lock for CalculateMemPoolAncestors (Matt Corallo)
2017-02-05 12:08:08 -08:00
Gregory Maxwell
ac719c936d Init ECC context for test_bitcoin_fuzzy.
This avoids calling things like pubkey_parse with a null context argument.
2017-02-05 17:37:13 +00:00
Matt Corallo
2a962d4540 Fixup style a bit by moving { to the same line as if statements 2017-02-04 16:44:05 -05:00
Wladimir J. van der Laan
7821db30e1
Merge #9671: Fix super-unlikely race introduced in 236618061a
885cfdd Fix super-unlikely race introduced in 236618061a (Matt Corallo)
2017-02-04 11:39:17 +01:00
Wladimir J. van der Laan
496691741d
Merge #9609: net: fix remaining net assertions
08bb6f4 net: log an error rather than asserting if send version is misused (Cory Fields)
7a8c251 net: Disallow sending messages until the version handshake is complete (Cory Fields)
12752af net: don't run callbacks on nodes that haven't completed the version handshake (Cory Fields)
2046617 net: deserialize the entire version message locally (Cory Fields)
80ff034 Dont deserialize nVersion into CNode, should fix #9212 (Matt Corallo)
2017-02-04 11:38:02 +01:00
Wladimir J. van der Laan
a3511628d0
Merge #9679: Access WorkQueue::running only within the cs lock
7b2d96b Access WorkQueue::running only within the cs lock. (Matt Corallo)
2017-02-04 11:37:26 +01:00