Commit Graph

1151 Commits

Author SHA1 Message Date
Simon da6d93916d Add option 'mempooltxinputlimit' so the mempool can reject a transaction
based on the number of transparent inputs.
2017-06-16 19:31:33 -07:00
Wladimir J. van der Laan eb5f63fe58
net: Automatically create hidden service, listen on Tor
Starting with Tor version 0.2.7.1 it is possible, through Tor's control socket
API, to create and destroy 'ephemeral' hidden services programmatically.
https://stem.torproject.org/api/control.html#stem.control.Controller.create_ephemeral_hidden_service

This means that if Tor is running (and proper authorization is available),
bitcoin automatically creates a hidden service to listen on, without user
manual configuration. This will positively affect the number of available
.onion nodes.

- When the node is started, connect to Tor through control socket
- Send `ADD_ONION` command
- First time:
    - Make it create a hidden service key
    - Save the key in the data directory for later usage
- Make it redirect port 8333 to the local port 8333 (or whatever port we're listening on).
- Keep control socket connection open for as long node is running. The hidden service will
  (by default) automatically go away when the connection is closed.
2017-03-25 20:22:09 +13:00
zkbot 7d9bf65501 Auto merge of #2168 - str4d:2164-getblock-anchor, r=daira
Add anchor to output of getblock

Closes #2164.
2017-03-23 18:21:10 +00:00
Jack Grigg 0bc1e2c431
Add anchor to output of getblock
Closes #2164.
2017-03-10 20:09:40 +13:00
Simon 07cf426404 Remove stale Qt comments and dead code 2017-03-09 17:04:59 -08:00
zkbot dadb1ab74c Auto merge of #2101 - str4d:2074-tests, r=arcalinea
Bitcoin 0.12 test PRs 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6337
- bitcoin/bitcoin#6390
- bitcoin/bitcoin#5515
- bitcoin/bitcoin#6287 (partial, remainder included in bitcoin/bitcoin#6703)
- bitcoin/bitcoin#6465

Part of #2074.
2017-03-03 21:25:03 +00:00
Cory Fields 72b25b0ffd
locking: add a quick example of GUARDED_BY
This was chosen not because it's necessarily helpful, but because its locking
assumptions were already correct.
2017-03-03 11:47:10 -08:00
Pavel Vasin 2af5a65066
remove unused inv from ConnectTip() 2017-03-03 10:57:22 -08:00
Jorge Timón e079f010bf
Consensus: Refactor: Separate Consensus::CheckTxInputs and GetSpendHeight in CheckInputs
Zcash:
- Replaces some of the refactoring performed in #1017
- Exposed Consensus::CheckTxInputs for testing
2017-03-03 10:57:09 -08:00
Pieter Wuille bfa832c7ed
Reduce checkpoints' effect on consensus.
Instead of only checking height to decide whether to disable script checks,
actually check whether a block is an ancestor of a checkpoint, up to which
headers have been validated. This means that we don't have to prevent
accepting a side branch anymore - it will be safe, just less fast to
do.

We still need to prevent being fed a multitude of low-difficulty headers
filling up our memory. The mechanism for that is unchanged for now: once
a checkpoint is reached with headers, no headers chain branching off before
that point are allowed anymore.
2017-03-03 10:57:07 -08:00
Philip Kaufmann db954a65ac
use const references where appropriate 2017-03-03 10:57:05 -08:00
Jack Grigg 1f015f6afa
Add a flag for enabling experimental features 2017-02-09 22:10:58 +00:00
Jonas Schnelli 6a793d9c27
use CBlockIndex* insted of uint256 for UpdatedBlockTip signal
- removes mapBlockIndex find operation
- theoretically allows removing the cs_main lock during zqm notification while introducing a new file position lock
2017-02-08 22:10:42 +00:00
João Barbosa 7e6ec078fa
Add UpdatedBlockTip signal to CMainSignals and CValidationInterface 2017-02-08 22:10:42 +00:00
Jack Grigg 207924a1d5
Remove OpenSSL PRNG reseeding
Per https://download.libsodium.org/doc/generating_random_data/ reseeding the
default libsodium PRNG is not required.
2017-01-23 17:06:54 +01:00
Jack Grigg 6fb8d0c2d6
Skip JoinSplit verification before the last checkpoint
Part of #1749
2016-12-09 21:06:45 +13:00
Sean Bowe bc59f53722 Isolate verification to a `ProofVerifier` context object that allows verification behavior to be tuned by the caller. 2016-12-05 12:40:06 -07:00
Simon 4e3ac9b015 Fix stale comment referencing upstream block interval 2016-11-18 10:26:20 -08:00
Simon 9ddb6ad028 Mempool will accept tx with joinsplits and the default z_sendmany fee.
Issue #1851 shows that a zaddr->taddr can be rejected from mempools
due to not meeting fee requirements given the size of the transaction.
Fee calculation for joinsplit txs has not yet been agreed upon, so
during this interim period, this patch ensures  joinsplit txs using
the default fee are not rejected due to an insufficient fee.
2016-11-15 11:32:59 -08:00
Simon ba0625f25d Set default minrelaytxfee to 1000 zatoshis to match upstream.
A txout will be considered dust when it has a value <546 zatoshis.
Helps to address #1719.
2016-11-15 10:48:51 -08:00
Jack Grigg 548bbd95f0
Adjust consensus rule to accept genesis block without height in coinbase
Closes #1753
2016-11-01 19:58:56 -05:00
Sean Bowe 7662d72bf4 Make more string changes. 2016-10-26 13:57:22 -06:00
Jack Grigg a6df7ab567
Add a persistent screen showing basic node metrics
The screen is implemented using ANSI Escape sequences.

Closes #1331
2016-10-22 15:50:06 -05:00
zkbot 30d3d2dfd4 Auto merge of #1603 - str4d:1556-reject-old-block-versions, r=daira
Reject block versions lower than 4

Includes parts of #1554
Closes #1556
2016-10-22 14:32:40 -04:00
zkbot f82273829a Auto merge of #1600 - str4d:1557-consensus-rule-disallow-v0-txns, r=daira
Disallow v0 transactions as a consensus rule

Closes #1557
2016-10-22 13:50:52 -04:00
zkbot e3c8e88e9b Auto merge of #1588 - bitcartel:upstream_8427_dos_logging, r=daira
Upstream: Prevent possible DoS in logging

bitcoin/bitcoin#8427
2016-10-22 13:08:26 -04:00
Simon 432bc22ade Patch backport of upstream 1588 as we don't (yet) use the NetMsgType namespace 2016-10-22 09:49:35 -07:00
Daira Hopwood cb1246194e Update the error message string for tx version too low. ref #1600
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-22 13:26:44 +01:00
Jack Grigg 80f4cdcf8f
Reject block versions lower than 4
Closes #1556
2016-10-22 00:43:26 -05:00
Jack Grigg 7ac924cdb7
Disallow v0 transactions as a consensus rule
Closes #1557
2016-10-22 00:40:50 -05:00
zkbot f808be7546 Auto merge of #1589 - bitcartel:upstream_7856_one_getaddr_per_connection, r=daira
Upstream: Only send one GetAddr response per connection.

bitcoin/bitcoin#8427
2016-10-21 22:53:19 -04:00
Gregory Maxwell a514cb2968 Only send one GetAddr response per connection.
This conserves resources from abusive peers that just send
 getaddr in a loop. Also makes correlating addr messages
 against INVs less effective.
2016-10-20 20:30:53 -07:00
Wladimir J. van der Laan e496b2e391 net: Ignore `notfound` P2P messages 2016-10-20 20:22:34 -07:00
Daira Hopwood e923e3ae0f Make v2 transactions standard.
This also corrects a rule about admitting large orphan transactions into the mempool, to account for v2-specific fields.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-18 19:37:55 +01:00
Jack Grigg 6a7acc29a1
Set CBlockIndex.hashAnchor correctly in ConnectBlock 2016-10-17 11:09:24 -05:00
Jack Grigg b6961fc112
Increment witnesses for new transactions on rescan
Closes #1400
2016-10-17 09:55:02 -05:00
Sean Bowe 74f15a73a1 Make 100KB transaction size limit a consensus rule, rather than a standard rule. 2016-10-08 00:00:23 -06:00
zkbot efe18f2e9b Auto merge of #1374 - str4d:1106-alert-safe-mode, r=str4d
Enable high-priority alerts to put the RPC into safe mode

This reverts the changes in 986b5e257e and adds a priority check.

Continuation of #1337
Closes #1106
2016-10-03 17:36:59 -04:00
Simon b7d072069e Update comment per review 2016-09-30 14:42:47 -07:00
Simon 3b30d8361a Founders reward: changed index computation, added new test and some refactoring. 2016-09-30 14:42:47 -07:00
Simon db0f931570 Add founders reward to ChainParams.
Fix bug where subsidy slow shift was ignored.
2016-09-30 14:42:47 -07:00
Jack Grigg a40034f7d6 Enable high-priority alerts to put the RPC into safe mode
This reverts the changes in 986b5e257e and adds a
priority check.

Closes #1106
2016-09-23 17:26:43 +12:00
zkbot 976479f824 Auto merge of #1411 - bitcartel:master_bitcoin_7106, r=daira
Upstream patch: Fix and improve relay from whitelisted peers

https://github.com/bitcoin/bitcoin/pull/7106
a9f3d3db5c0c8d1697998ed9b3e192ddbf9a31f4

An extra commit modifies the log message string, otherwise there are are a number of commits that need be to backported to add methods e.g. GetDebugMessage.  These commits modify the interface in consensus/validation.h so there are conflicts to be resolved. e.g.
9003c7c
a9ac95c
5f12263
fbf44e6
2016-09-20 19:41:00 -04:00
zkbot 5ef7fecf14 Auto merge of #1407 - bitcartel:master_bitcoin_7079, r=daira
Upstream patch: Prevent peer flooding inv request queue

https://github.com/bitcoin/bitcoin/pull/7079
5029698186445bf3cd69d0e720f019c472661bff
ebb25f4c23adbcb55796c402bafd6064a136f16f
2016-09-20 19:11:28 -04:00
Simon e63d14fd4d Replace %i format specifier with more commonly used %d. 2016-09-19 09:36:26 -07:00
de3dd8a015 Modify message string so we don't need to backport commits which implement FormatStateMessage and GetDebugMessage and involve changes to consensus/validation.h 2016-09-16 17:51:46 -07:00
Pieter Wuille 60aed95400 Fix and improve relay from whitelisted peers
This makes sure that retransmits by a whitelisted peer also actually
result in a retransmit.

Further, this changes the logic to never relay in case we would assign
a DoS score, as we expect to get DoS banned ourselves as a result.
2016-09-16 09:28:12 -07:00
Gregory Maxwell e2190f8017 Limit setAskFor and retire requested entries only when a getdata returns.
The setAskFor duplicate elimination was too eager and removed entries
 when we still had no getdata response, allowing the peer to keep
 INVing and not responding.
2016-09-15 23:41:29 -07:00
kazcw 56f165bdc1 prevent peer flooding request queue for an inv
mapAlreadyAskedFor does not keep track of which peer has a request queued for a
particular tx. As a result, a peer can blind a node to a tx indefinitely by
sending many invs for the same tx, and then never replying to getdatas for it.
Each inv received will be placed 2 minutes farther back in mapAlreadyAskedFor,
so a short message containing 10 invs would render that tx unavailable for 20
minutes.

This is fixed by disallowing a peer from having more than one entry for a
particular inv in mapAlreadyAskedFor at a time.
2016-09-15 23:17:34 -07:00
0163f8faa2 Closes #1371 by updating signed message 2016-09-12 11:01:28 -07:00