Commit Graph

5147 Commits

Author SHA1 Message Date
Gregory Maxwell
186a517692
Restore RPC HTTP keepalives to default.
This avoids a regression for issues like #334 where high speed
 repeated connections eventually run the HTTP client out of
 sockets because all of theirs end up in time_wait.

Maybe the trade-off here is suboptimal, but if both choices will
 fail then we prefer fewer changes until the root cause is solved.

Rebased-From: 1a25a7edf8 7d2cb48511
Github-Pull: #5674
2015-01-19 12:16:17 +01:00
Gregory Maxwell
aaf55d25c6
Add a -rpckeepalive and disable RPC use of HTTP persistent connections.
It turns out that some miners have been staying with old versions of
 Bitcoin Core because their software  behaves poorly with persistent
 connections and the Bitcoin Core thread and connection limits.

What happens is that underlying  HTTP libraries leave connections open
 invisibly to their users and then the user runs into the default four
 thread limit.  This looks like Bitcoin Core is unresponsive to RPC.

There are many things that should be improved in Bitcoin Core's behavior
 here, e.g. supporting more concurrent connections, not tying up threads
 for idle connections, disconnecting kept-alive  connections when limits
 are reached, etc. All are fairly big, risky changes.

Disabling keep-alive is a simple workaround. It's often not easy to turn
 off the keep-alive support in the client where it may be buried in some
 platform library.

If you are one of the few who really needs persistent connections you
 probably know that you want them and can find a switch; while if you
 don't and the misbehavior is hitting you it is hard to discover the
 source of your problems is keepalive related.  Given that it is best
 to default to off until they're handled better.

Github-Merge: #5655
Rebased-From: 16a5c18cea 56c1093dae 1dd8ee72af
2015-01-15 09:38:24 +01:00
Pieter Wuille
4e7c219122
Catch UTXO set read errors and shutdown
Github-Pull: #5619
Rebased-From: 13cdce4336
2015-01-12 11:28:39 +01:00
Pieter Wuille
a3a73170a9
Introduce 10 minute block download timeout
This will disconnect peers that do not transfer a block in 10 minutes, plus
5 minutes for every previously queued block with validated headers
(accomodating downstream bandwidth down to a few kilobytes per second - below
that the node would have trouble staying synchronized anyway).

Github-Pull: #5608
Rebased-From: 916130348c
2015-01-12 11:28:23 +01:00
Wladimir J. van der Laan
12b7c444f0
Improve robustness of DER recoding code
Add some defensive programming on top of #5634.

This copies the respective OpenSSL code in ECDSA_verify in
OpenSSL pre-1.0.1k (e.g. https://github.com/openssl/openssl/blob/OpenSSL_1_0_1j/crypto/ecdsa/ecs_vrf.c#L89)
more closely.

As reported by @sergiodemianlerner.

Github-Pull: #5640
Rebased-From: c6b7b29f23
2015-01-12 09:12:12 +01:00
Cory Fields
76ce5c8de3
fail immediately on an empty signature
Github-Pull: #5634
Rebased-From: 8dccba6a45
2015-01-10 08:10:38 +01:00
Cory Fields
ace39db764
consensus: guard against openssl's new strict DER checks
New versions of OpenSSL will reject non-canonical DER signatures. However,
it'll happily decode them. Decode then re-encode before verification in order
to ensure that it is properly consumed.

Github-Pull: #5634
Rebased-From: 488ed32f2a
2015-01-10 08:10:29 +01:00
Cory Fields
263b65ebf0
tests: run sanity checks in tests too
If these are going to fail in bitcoind, they should fail in the tests as well.

Github-Pull: #5604
Rebased-From: d58c5d6f21
2015-01-08 12:08:14 +01:00
Wladimir J. van der Laan
7fdbedcaf8
Merge pull request #5542
2ecd294 Bugfix: configure: Correctly detect "nothing to build" condition (Luke Dashjr)
b7a4ecc Bugfix: Only check for boost when building code that requires it (Luke Dashjr)
a19eeac Bugfix: configure: Check for openssl/ec.h (Luke Dashjr)
fe925e2 Use EXTRA_LIBRARIES instead of noinst_LIBRARIES so we can avoid building unused code (Cory Fields)
2015-01-08 09:34:11 +01:00
Pieter Wuille
867c600c29
Catch LevelDB errors during flush
Rebased-From: e41345790f
Github-Pull: #5597
2015-01-07 13:11:58 +01:00
Pieter Wuille
008138c04a
Bugfix: only track UTXO modification after lookup
Otherwise, if CCoinsViewCache::ModifyCoins throws an exception in between
setting hasModifier and constructing the CCoinsModifier, the cache ends up
in an inconsistent state, resulting in an assert failure in the next
modification.

Bug discovered by Wladimir J. van der Laan.

Rebased-From: 1c52aad540
Github-Pull: #5597
2015-01-07 13:11:54 +01:00
Pieter Wuille
3022e7df2a
Require sufficent priority for relay of free transactions
Rebased-From: 1c52aad540
Github-Pull: #5535
2015-01-07 13:11:49 +01:00
Cory Fields
fe925e221f Use EXTRA_LIBRARIES instead of noinst_LIBRARIES so we can avoid building unused code 2015-01-06 20:00:25 +00:00
Eric R. Schulz
06fdf326d3
bitcoin-tx: Fix JSON validation of prevtxs
Github-Pull: #5528
Rebased-From: 2a3d988b80 a089c50981 2c14d1532f
2015-01-06 17:32:31 +01:00
Pieter Wuille
58fda4d689
Update seed IPs, based on bitcoin.sipa.be crawler data
Rebased-From: be22b3da1d
Github-Pull: #5532
2015-01-06 11:02:50 +01:00
Thomas Zander
94b362dbd6
On close of splashscreen interrupt verifyDB
With the splashscreen being able to be closed it is possible to
shutdown during the lengthy verifyDB method. (Takes about a minute
on my machine). This change allows us to shutdown much sooner.

Github-Pull: #5557
Rebased-From: 70477a0bdf
2015-01-03 10:22:48 +01:00
Philip Kaufmann
50891ad080
[Qt] update a translation string and argument counts
Rebased-From: 643415aade
Github-Pull: #5583
2015-01-02 11:20:51 +01:00
Wladimir J. van der Laan
4f57a3b20c
Bump project-wide COPYRIGHT_YEAR to 2015
There is still a redundancy here between configure.ac and
clientversion.h.

Rebased-From: edbc9045cb
2015-01-02 11:04:57 +01:00
Wladimir J. van der Laan
8061d67aeb
Remove redundant copyright notices from README files
The normative place for these for the entire project is COPYING,
and the main README already has a MIT license section.

Rebased-From: e6df2bb48f
2015-01-02 11:03:13 +01:00
Luke Dashjr
1eadfd9753
Bugfix: prioritisetransaction: Do some basic sanity checking on txid
Besides giving a nicer error, this also prevents logging arbitrary data (which could have been used to exploit log readers) into debug.log

Rebased-From: 7f71813919
Github-Pull: #5499
2014-12-31 10:53:26 +01:00
Gregory Maxwell
18021d08f7
Remove bitnodes.io from dnsseeds.
I'm not comfortable with retaining this entry.

Rebased-From: a094b3d973
Github-Pull: #5545
2014-12-31 10:43:22 +01:00
Wladimir J. van der Laan
b790d139c9
English translation update 2014-12-31 10:39:17 +01:00
Michael Ford
8543b0dfd9
Correct tooltip on address book page
Rebased-From: 06206bb3b7
Github-Pull: 5571
2014-12-31 10:38:04 +01:00
Cory Fields
87d43a3c8e rpcserver: attempt to fix uncaught exception.
Rebased-From: f9c571aad8
Github-Pull: #5565
2014-12-30 17:38:03 +01:00
Wladimir J. van der Laan
ed934bdb4d
pull new translations from transifex 2014-12-28 12:21:17 +01:00
Luke Dashjr
52e57055cc en: Avoid ambiguous language regarding when transactions confirm
Rebased-From: a15dba5dff
Github-Pull: #5533
2014-12-27 05:03:39 +01:00
Peter Todd
06ca0651b6
Fix CScriptID(const CScript& in) in empty script case
Previously an empty script wouldn't be hashed, and CScriptID would be
assigned the incorrect value of 0 instead. This bug can be seen in the
RPC decodescript command:

    $ btc decodescript ""
    {
        "asm" : "",
        "type" : "nonstandard",
        "p2sh" : "31h1vYVSYuKP6AhS86fbRdMw9XHieotbST"
    }

Correct output:

    $ btc decodescript ""
    {
        "asm" : "",
        "type" : "nonstandard",
        "p2sh" : "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy"
    }

Rebased-From: d78f0dafd5
Github-Pull: #5541
2014-12-27 04:09:41 +01:00
Wladimir J. van der Laan
13e129ed9a
CLIENT_VERSION_IS_RELEASE → true 2014-12-23 18:12:12 +01:00
Wladimir J. van der Laan
f4dcc1e009
Merge pull request #5531 2014-12-23 14:26:36 +01:00
Pieter Wuille
63b5a1dc80 Do not use libgmp automatically in libsecp256k1 2014-12-23 14:20:28 +01:00
Wladimir J. van der Laan
3a88ba0794 qt: periodic language update 2014-12-23 12:58:33 +01:00
Adam Weiss
d10a9015ad
DOS: Respect max per-peer blocks in flight limit
Don't allow immediate inv driven block downloads if
a peer already has MAX_BLOCKS_IN_TRANSIT_PER_PEER
active downloads.  Prevents bogus inv spam from
blowing up block transfer tracking data structures.

Rebased-From: c90770430d
Github-Pull: #5507
2014-12-23 12:36:26 +01:00
Gregory Maxwell
15ad0b54fa
Apply AreSane() checks to the fees from the network.
'Sane' was already defined by this code as:
 fee.GetFeePerK() > minRelayFee.GetFeePerK() * 10000
 But sanity was only enforced for data loaded from disk.

Note that this is a pretty expansive definition of 'sane': A 10 BTC
 fee is still passes the test if its on a 100kb transaction.

This prevents a single insane fee on the network from making us reject
 our stored fee data at start.  We still may reject valid saved fee
 state if minRelayFee is changed between executions.

This also reduces the risk and limits the damage from a cascading
 failure where one party pays a bunch of insane fees which cases
 others to pay insane fees.

Rebased-From: 6484930690
Github-Pull: #5481
2014-12-23 12:30:14 +01:00
Gregory Maxwell
11855c1f99
Enforce minRelayTxFee on wallet created tx and add a maxtxfee option.
Previously the minRelayTxFee was only enforced on user specified values.

It was possible for smartfee to produce a fee below minRelayTxFee which
 would just result in the transaction getting stuck because it can't be
 relayed.

This also introduces a maxtxfee option which sets an absolute maximum
 for any fee created by the wallet, with an intention of increasing
 user confidence that the automatic fees won't burn them. This was
 frequently a concern even before smartfees.

If the configured fee policy won't even allow the wallet to meet the relay
 fee the transaction creation may be aborted.

Rebased-From: aa279d6131
Github-Pull: #5485
2014-12-23 12:12:40 +01:00
Pieter Wuille
8446262597
Reject headers that build on an invalid parent
Rebased-From: 3497022347
Github-Pull: #5459
2014-12-23 12:01:09 +01:00
Jameson Lopp
ad3d208fb9
remove max orphan blocks config parameter since it is no longer functional
Rebased-From: 4bc95c4387
2014-12-22 15:03:50 +01:00
Peter Todd
0cb8763cbb
Check against MANDATORY flags prior to accepting to mempool
Previously transactions were only tested again the
STANDARD_SCRIPT_VERIFY_FLAGS prior to mempool acceptance, so any bugs in
those flags that allowed actually-invalid transactions to pass would
result in allowing invalid transactions into the mempool. Fortunately
there is a second check in CreateNewBlock() that would prevent those
transactions from being mined, resulting in an invalid block, however
this could still be exploited as a DoS attack.

Rebased-From: 7c041b3b91
2014-12-22 12:42:58 +01:00
Philip Kaufmann
b03632a671
add missing CAutoFile::IsNull() check in main
Rebased-From: 84857e87e4
Github-Pull: #5437
2014-12-19 18:49:57 +01:00
Wladimir J. van der Laan
c3c635b316
version 0.9.99 -> 0.10.0
Bump version but keep CLIENT_VERSION_IS_RELEASE at false as this is not
a release yet.
2014-12-16 18:51:50 +01:00
Pavel Janík
44b4c0d8a9
signrawtransaction: validate private key.
Github-Pull: #5461
Rebased-From: aa768f1848
2014-12-12 11:56:28 +01:00
Wladimir J. van der Laan
41cced2106
Merge pull request #5267
34318d7 RPC-test based on invalidateblock for mempool coinbase spends (Gavin Andresen)
7fd6219 Make CTxMemPool::remove more effecient by avoiding recursion (Matt Corallo)
b7b4318 Make CTxMemPool::check more thourough by using CheckInputs (Matt Corallo)
723d12c Remove txn which are invalidated by coinbase maturity during reorg (Matt Corallo)
868d041 Remove coinbase-dependant transactions during reorg. (Matt Corallo)
2014-12-11 15:24:00 +01:00
Wladimir J. van der Laan
7c001bb49c
qt: translations pull from transifex 2014-12-11 11:10:23 +01:00
Wladimir J. van der Laan
5e521d3e4e
Merge pull request #5391
932ef50 [REST] JSON output: remove block infos from tx details if it is nested in block (Jonas Schnelli)
cae5486 [REST] added /rest/block/notxdetails/<hash> into REST-interface.md documentation (Jonas Schnelli)
73351c3 [REST] /rest/block response with full tx details (Jonas Schnelli)
2014-12-11 10:33:11 +01:00
Wladimir J. van der Laan
34468066ff
Merge pull request #5399
4be639e Use RPC_INVALID_PARAMETER instead of RPC_WALLET_ERROR for invalid amount. No return at the end of void function. (Pavel Janík)
b93173d Move SendMoney() to rpcwallet.cpp. (Pavel Janík)
2014-12-10 08:22:20 +01:00
Jonas Schnelli
932ef50f77 [REST] JSON output: remove block infos from tx details if it is nested in block 2014-12-09 16:05:51 +01:00
Jonas Schnelli
73351c3686 [REST] /rest/block response with full tx details
- rest block request returns full unfolded tx details
- /rest/block/notxdetails/<HASH> returns block where transactions are only represented by its hash
2014-12-09 16:05:50 +01:00
Wladimir J. van der Laan
7f76dda903
Merge pull request #5216
5ec654b [Qt] update paymentserver license and cleanup ordering (Philip Kaufmann)
4333e26 [Qt] add BIP70 DoS protection test (Philip Kaufmann)
31f8494 [Qt] add BIP70 payment request size DoS protection for URIs (Philip Kaufmann)
2284ccb [Qt] remove dup lock that is done in SetAddressBook() (Philip Kaufmann)
1ec753f [Qt] ensure socket is set to NULL in PaymentServer::ipcSendCommandLine (Philip Kaufmann)
814429d [Qt] add BIP70/BIP71 constants for all messages and mime types (Philip Kaufmann)
b82695b [Qt] make PaymentServer::ipcParseCommandLine void (Philip Kaufmann)
2014-12-09 10:16:16 +01:00
Wladimir J. van der Laan
4f85383cb3
Merge pull request #5409
65b0328 newlines in strings are invalid JSON (Ryan X. Charles)
2014-12-09 10:07:35 +01:00
Matt Corallo
7fd6219af7 Make CTxMemPool::remove more effecient by avoiding recursion 2014-12-08 14:09:58 -08:00
Matt Corallo
b7b4318f3a Make CTxMemPool::check more thourough by using CheckInputs 2014-12-08 14:05:42 -08:00