Commit graph

9531 commits

Author SHA1 Message Date
Wladimir J. van der Laan 12519bf62b 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.
2016-11-18 13:10:52 +01:00
Jonas Schnelli 76af4eb876
[Qt] fix coincontrol sort issue 2016-11-18 11:09:29 +01:00
Matt Corallo 97e28029c9 Erase orphans per-transaction instead of per-block 2016-11-17 17:10:00 -08:00
Matt Corallo ec4525ccc1 Move orphan processing to ActivateBestChain
This further decouples "main" and "net" processing logic by moving
orphan processing out of the chain-connecting cs_main lock and
into its own cs_main lock, beside all of the other chain callbacks.

Once further decoupling of net and main processing logic occurs,
orphan handing should move to its own lock, out of cs_main.

Note that this will introduce a race if there are any cases where
we assume the orphan map to be consistent with the current chain
tip, however I am confident there is no such case (ATMP will fail
without DoS score in all such cases).
2016-11-17 17:10:00 -08:00
MarcoFalke fa7cc5a508 Set DEFAULT_LIMITFREERELAY = 0 kB/minute 2016-11-18 00:23:25 +01:00
Pieter Wuille 9346f84299
Merge #9075: Decouple peer-processing-logic from block-connection-logic (#3)
ae22357 Replace CValidationState param in ProcessNewBlock with BlockChecked (Matt Corallo)
7c98ce5 Remove pfrom parameter from ProcessNewBlock (Matt Corallo)
e2e069d Revert "RPC: Give more details when "generate" fails" (Matt Corallo)
2016-11-17 13:23:50 -08:00
Wladimir J. van der Laan f6db48ad1c
Merge #8838: Calculate size and weight of block correctly in CreateNewBlock()
5f274a1 log block size and weight correctly. (jnewbery)
2016-11-17 14:14:51 +01:00
MarcoFalke cb2ed300a8
Merge #9155: [trivial] update comments for tx weight
07ede5d update comments for tx weight (Brian Deery)
2016-11-16 11:05:40 +01:00
Wladimir J. van der Laan 434e683f7b
Merge #9133: Unset fImporting for loading mempool
79f755d Unset fImporting for loading mempool (Alex Morcos)
2016-11-16 10:11:41 +01:00
Wladimir J. van der Laan 62af164638
Merge #9131: fNetworkActive is not protected by a lock, use an atomic
079142b fNetworkActive is not protected by a lock, use an atomic (Jonas Schnelli)
2016-11-16 10:09:52 +01:00
Pieter Wuille 6eeac6e30d
Merge #9164: [trivial] credit values are CAmount
20c3215 credit values are CAmount (Gregory Sanders)
2016-11-15 09:44:07 -08:00
instagibbs ea83d0098a SendMoney: use already-calculated balance 2016-11-15 11:56:45 -05:00
Gregory Sanders 20c3215a90 credit values are CAmount 2016-11-15 09:19:23 -05:00
Wladimir J. van der Laan 018a4eb120
Merge #9140: Bugfix: Correctly replace generated headers and fail cleanly
b74ff5c Bugfix: Correctly replace generated headers and fail cleanly (Luke Dashjr)
2016-11-15 10:34:56 +01:00
Wladimir J. van der Laan f54e4605fc
Merge #9132: Make strWalletFile const
f734505 Make strWalletFile const (Jonas Schnelli)
2016-11-15 10:06:01 +01:00
Wladimir J. van der Laan 770364b8ea
Merge #9160: [trivial] Fix hungarian variable name
ec34648 [trivial] Fix hungarian variable name (Russell Yanofsky)
2016-11-15 09:52:14 +01:00
Russell Yanofsky ec34648766 [trivial] Fix hungarian variable name
Follow up to comment https://github.com/bitcoin/bitcoin/pull/9058#discussion_r87676593
2016-11-14 14:02:24 -05:00
Brian Deery 07ede5d711 update comments for tx weight 2016-11-14 00:38:07 -06:00
MarcoFalke fa42e4a082 [qt] Make network disabled icon 50% opaque 2016-11-13 22:06:35 +01:00
Jonas Schnelli 4512550fa0
Remove unnecessary calls to CheckFinalTx 2016-11-12 13:50:39 +01:00
Pavel Janík 1260c1103b Mention the new network toggle functionality in the tooltip. 2016-11-12 13:28:21 +01:00
Jonas Schnelli 2e44893081
Move -salvagewallet, -zap(wtx) to where they belong 2016-11-12 10:25:34 +01:00
Luke Dashjr b74ff5cf0c Bugfix: Correctly replace generated headers and fail cleanly
Also removes generation of headers for *.raw files in test_bitcoin (none exist anymore)
2016-11-12 07:16:28 +00:00
Alex Morcos 79f755db41 Unset fImporting for loading mempool 2016-11-11 09:33:16 -05:00
Jonas Schnelli f7345050e9
Make strWalletFile const 2016-11-11 14:32:38 +01:00
Jonas Schnelli 079142b757
fNetworkActive is not protected by a lock, use an atomic 2016-11-11 14:09:52 +01:00
Luke Dashjr 5394b3940d Wallet: Split main logic from InitLoadWallet into CreateWalletFromFile 2016-11-11 11:35:49 +00:00
Luke Dashjr fb0c934d1b Wallet: Let the interval-flushing thread figure out the filename 2016-11-11 11:35:49 +00:00
Wladimir J. van der Laan 87ab49e4fe
Merge #9124: Use better name for local variable to prevent -Wshadow compiler warning
bf49f10 Use better name for local variable to prevent -Wshadow compiler warning (Pavel Janík)
2016-11-11 11:46:49 +01:00
Jonas Schnelli ab914a6530
Merge #8996: Network activity toggle
19f46f1 Qt: New network_disabled icon (Luke Dashjr)
54cf997 RPC/Net: Use boolean consistently for networkactive, and remove from getinfo (Luke Dashjr)
b2b33d9 Overhaul network activity toggle (Jonas Schnelli)
32efa79 Qt: Add GUI feedback and control of network activity state. (Jon Lund Steffensen)
e38993b RPC: Add "togglenetwork" method to toggle network activity temporarily (Jon Lund Steffensen)
7c9a98a Allow network activity to be temporarily suspended. (Jon Lund Steffensen)
2016-11-11 11:16:40 +01:00
Wladimir J. van der Laan 7977a1157a
Merge #9058: Fixes for p2p-compactblocks.py test timeouts on travis (#8842)
dac53b5 Modify getblocktxn handler not to drop requests for old blocks (Russell Yanofsky)
55bfddc [qa] Fix stale data bug in test_compactblocks_not_at_tip (Russell Yanofsky)
47e9659 [qa] Fix bug in compactblocks v2 merge (Russell Yanofsky)
2016-11-11 11:02:44 +01:00
Wladimir J. van der Laan 46027e8668
Merge #9112: Avoid ugly exception in log on unknown inv type
e9f25dd Avoid ugly exception in log on unknown inv type (Wladimir J. van der Laan)
2016-11-11 10:58:58 +01:00
Pavel Janík bf49f107ef Use better name for local variable to prevent -Wshadow compiler warning 2016-11-10 21:38:07 +01:00
Wladimir J. van der Laan 71bc39eb74
Merge #9049: Remove duplicatable duplicate-input check from CheckTransaction
e2b3fb3 Optimize vInOutPoints insertion a bit (Matt Corallo)
eecffe5 Remove redundant duplicate-input check from CheckTransaction (Matt Corallo)
b2e178a Add deserialize + CheckBlock benchmarks, and a full block hex (Matt Corallo)
2016-11-10 16:02:55 +01:00
MarcoFalke 4a2b170c07
Merge #9122: fix getnettotals RPC description about timemillis.
a79f864 fix getnettotals RPC description about timemillis. (Masahiko Hyuga)
2016-11-10 11:05:59 +01:00
Wladimir J. van der Laan aab102cbae
Merge #9121: Initialize variable to prevent compiler warning
bdcba6d Initialize variable to prevent compiler warning (Pavel Janík)
2016-11-10 10:35:07 +01:00
Wladimir J. van der Laan 537e0cb252
Merge #9120: bug: Missed one "return false" in recent refactoring in #9067
45d372f Missed one "return false" in recent refactoring in #9067 (UdjinM6)
2016-11-10 10:30:54 +01:00
Masahiko Hyuga a79f864945 fix getnettotals RPC description about timemillis. 2016-11-10 18:18:52 +09:00
Pavel Janík bdcba6d933 Initialize variable to prevent compiler warning 2016-11-10 08:11:51 +01:00
UdjinM6 45d372f889 Missed one "return false" in recent refactoring in #9067 2016-11-10 00:53:55 +03:00
Wladimir J. van der Laan fb156100f9
Merge #9111: Remove unused variable UNLIKELY_PCT from fees.h
d8edf03 Remove unused var UNLIKELY_PCT from fees.h (fanquake)
2016-11-09 21:54:56 +01:00
Matt Corallo e2b3fb349e Optimize vInOutPoints insertion a bit 2016-11-09 11:28:41 -08:00
Matt Corallo eecffe50ef Remove redundant duplicate-input check from CheckTransaction 2016-11-09 11:28:00 -08:00
Matt Corallo b2e178a2d2 Add deserialize + CheckBlock benchmarks, and a full block hex 2016-11-09 11:27:59 -08:00
Matt Corallo ae22357607 Replace CValidationState param in ProcessNewBlock with BlockChecked 2016-11-09 11:21:55 -08:00
Matt Corallo 7c98ce584e Remove pfrom parameter from ProcessNewBlock
This further decouples ProcessNewBlock from networking/peer logic.
2016-11-09 11:21:45 -08:00
Cory Fields 46625538d6 net: don't send feefilter messages before the version handshake is complete 2016-11-09 12:45:13 -05:00
Wladimir J. van der Laan e81df49644
Merge #9039: Various serialization simplifcations and optimizations
d59a518 Use fixed preallocation instead of costly GetSerializeSize (Pieter Wuille)
25a211a Add optimized CSizeComputer serializers (Pieter Wuille)
a2929a2 Make CSerAction's ForRead() constexpr (Pieter Wuille)
a603925 Avoid -Wshadow errors (Pieter Wuille)
5284721 Get rid of nType and nVersion (Pieter Wuille)
657e05a Make GetSerializeSize a wrapper on top of CSizeComputer (Pieter Wuille)
fad9b66 Make nType and nVersion private and sometimes const (Pieter Wuille)
c2c5d42 Make streams' read and write return void (Pieter Wuille)
50e8a9c Remove unused ReadVersion and WriteVersion (Pieter Wuille)
2016-11-09 13:52:04 +01:00
Wladimir J. van der Laan e9f25ddd00 Avoid ugly exception in log on unknown inv type
It is unexpected behavior for `ToString` to raise an exception. It
is expected to do a best-effort attempt at formatting but never fail.

Catch the exception and simply print unknown inv types as hexadecimal.

Fixes #9110.
2016-11-09 11:16:39 +01:00
Wladimir J. van der Laan e9847303e7
Merge #8874: Multiple Selection for peer and ban tables
1077577 Fix auto-deselection of peers (Andrew Chow)
addfdeb Multiple Selection for peer and ban tables (Andrew Chow)
2016-11-09 11:05:15 +01:00
fanquake d8edf03db7
Remove unused var UNLIKELY_PCT from fees.h 2016-11-09 17:51:27 +08:00
Matt Corallo e2e069dabc Revert "RPC: Give more details when "generate" fails"
This only returned information in the case of CheckBlock failure,
but breaks future changes.
2016-11-08 17:39:44 -08:00
Andrew Chow 1077577546 Fix auto-deselection of peers 2016-11-08 15:11:25 -05:00
Jorge Timón 1adf82ac39
RPC: Give more details when "generate" fails 2016-11-08 15:08:56 +01:00
Andrew Chow addfdebe1a Multiple Selection for peer and ban tables
Allows multiple selection and action for the nodes in the peer and ban tables in the Debug Window.
2016-11-08 08:50:04 -05:00
Wladimir J. van der Laan 4e5782438c
Merge #9088: Reduce ambiguity of warning message
77cbbd9 Make warning message about wallet balance possibly being incorrect less ambiguous. (R E Broadley)
2016-11-08 11:05:08 +01:00
Wladimir J. van der Laan f53023dbb8
Merge #9067: Fix exit codes
4441018 Every main()/exit() should return/use one of EXIT_ codes instead of magic numbers (UdjinM6)
bd0de13 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` (UdjinM6)
2016-11-08 10:55:03 +01:00
Jonas Schnelli b8f43e3331
Merge #9095: test: Fix test_random includes
fa8278e test: Fix test_random includes (MarcoFalke)
2016-11-08 08:41:57 +01:00
Pieter Wuille dc6b9406bd
Merge #9026: Fix handling of invalid compact blocks
d4833ff Bump the protocol version to distinguish new banning behavior. (Suhas Daftuar)
88c3549 Fix compact block handling to not ban if block is invalid (Suhas Daftuar)
c93beac [qa] Test that invalid compactblocks don't result in ban (Suhas Daftuar)
2016-11-07 18:11:18 -08:00
Daniel Cousens 5262a151e1 tx_valid: re-order inputs to how they are encoded 2016-11-08 11:58:39 +11:00
Matt Corallo 037159cebf Remove block-request logic from INV message processing 2016-11-07 17:41:00 -05:00
Pieter Wuille 9f554e03eb
Merge #9045: Hash P2P messages as they are received instead of at process-time
fe1dc62 Hash P2P messages as they are received instead of at process-time (Matt Corallo)
2016-11-07 14:19:44 -08:00
Pieter Wuille d59a518466 Use fixed preallocation instead of costly GetSerializeSize
Dbwrapper used GetSerializeSize() to compute the size of the buffer
to preallocate. For some cases (specifically: CCoins) this requires
a costly compression call. Avoid this by just using fixed size
preallocations instead.
2016-11-07 13:56:27 -08:00
Pieter Wuille 25a211aa9e Add optimized CSizeComputer serializers
To get the advantages of faster GetSerializeSize() implementations
back that were removed in "Make GetSerializeSize a wrapper on top of
CSizeComputer", reintroduce them in the few places in the form of a
specialized Serialize() implementation. This actually gets us in a
better state than before, as these even get used when they're invoked
indirectly in the serialization of another object.
2016-11-07 13:56:27 -08:00
Pieter Wuille a2929a26f5 Make CSerAction's ForRead() constexpr
The CSerAction's ForRead() method does not depend on any runtime
data, so guarantee that requests to it can be optimized out by
making it constexpr.

Suggested by Cory Fields.
2016-11-07 13:56:27 -08:00
Pieter Wuille a603925c77 Avoid -Wshadow errors
Suggested by Pavel Janik.
2016-11-07 13:56:27 -08:00
Pieter Wuille 528472111b Get rid of nType and nVersion
Remove the nType and nVersion as parameters to all serialization methods
and functions. There is only one place where it's read and has an impact
(in CAddress), and even there it does not impact any of the recursively
invoked serializers.

Instead, the few places that need nType or nVersion are changed to read
it directly from the stream object, through GetType() and GetVersion()
methods which are added to all stream classes.
2016-11-07 13:56:27 -08:00
Pieter Wuille 657e05ab2e Make GetSerializeSize a wrapper on top of CSizeComputer
Given that in default GetSerializeSize implementations created by
ADD_SERIALIZE_METHODS we're already using CSizeComputer(), get rid
of the specialized GetSerializeSize methods everywhere, and just use
CSizeComputer. This removes a lot of code which isn't actually used
anywhere.

For CCompactSize and CVarInt this actually removes a more efficient
size computing algorithm, which is brought back in a later commit.
2016-11-07 13:56:22 -08:00
Pieter Wuille fad9b66504 Make nType and nVersion private and sometimes const
Make the various stream implementations' nType and nVersion private
and const (except in CDataStream where we really need a setter).
2016-11-07 13:49:11 -08:00
Russell Yanofsky dac53b58b5 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.
2016-11-07 14:35:11 -05:00
UdjinM6 4441018d08 Every main()/exit() should return/use one of EXIT_ codes instead of magic numbers 2016-11-07 21:31:38 +03:00
Pieter Wuille c2c5d42f36 Make streams' read and write return void
The stream implementations had two cascading layers (the upper one
with operator<< and operator>>, and a lower one with read and write).
The lower layer's functions are never cascaded (nor should they, as
they should only be used from the higher layer), so make them return
void instead.
2016-11-07 09:39:46 -08:00
Pieter Wuille 50e8a9ccd7 Remove unused ReadVersion and WriteVersion
CDataStream and CAutoFile had a ReadVersion and WriteVersion method
that was never used. Remove them.
2016-11-07 09:39:46 -08:00
MarcoFalke fa8278e845 test: Fix test_random includes 2016-11-07 16:11:51 +01:00
Jonas Schnelli 78cdd643d3
Merge #9094: qt: Use correct conversion function for boost::path datadir
e760b30 qt: Use correct conversion function for boost::path datadir (Wladimir J. van der Laan)
2016-11-07 14:20:12 +01:00
Wladimir J. van der Laan 0b2322b144
Merge #8981: Wshadow: Do not shadow argument with a local variable
ff6639b Do not shadow local variable (Pavel Janík)
2016-11-07 13:44:00 +01:00
Wladimir J. van der Laan 8c6218a28a
Merge #8976: libconsensus: Add input validation of flags
5ca8ef2 libconsensus: Add input validation of flags (Wladimir J. van der Laan)
2016-11-07 13:41:39 +01:00
Wladimir J. van der Laan 3c03dc2cfc
Merge #7730: Remove priority estimation
0bd581a add release notes for removal of priority estimation (Alex Morcos)
b2322e0 Remove priority estimation (Alex Morcos)
2016-11-07 13:36:40 +01:00
Alex Morcos b2322e0fc6 Remove priority estimation 2016-11-07 13:22:34 +01:00
Wladimir J. van der Laan 1e50d22ed2
Merge #8709: Allow filterclear messages for enabling TX relay only.
1f951c6 Allow filterclear messages for enabling TX relay only. (R E Broadley)
2016-11-07 13:19:42 +01:00
Wladimir J. van der Laan c113a651f1
Merge #9052: Use RelevantServices instead of node_network in AttemptToEvict.
d32036a Use RelevantServices instead of node_network in AttemptToEvict. (Gregory Maxwell)
2016-11-07 13:14:04 +01:00
Wladimir J. van der Laan e760b307f6 qt: Use correct conversion function for boost::path datadir
Fixes #9089.
2016-11-07 12:57:07 +01:00
Wladimir J. van der Laan 44f2df613f
Merge #8675: Make copyright header lines uniform
4b04e32 [copyright] copyright header style uniform (isle2983)
2016-11-07 12:51:59 +01:00
Wladimir J. van der Laan 5fa7b07565
Merge #8736: base58: Improve DecodeBase58 performance.
e892dc1 Use prefix operator in for loop of DecodeBase58. (Jiaxing Wang)
159ed95 base58: Improve DecodeBase58 performance. (Jiaxing Wang)
2016-11-07 11:51:04 +01:00
Wladimir J. van der Laan c8c572f8f1
Merge #8708: net: have CConnman handle message sending
9027680 net: handle version push in InitializeNode (Cory Fields)
7588b85 net: construct CNodeStates in place (Cory Fields)
440f1d3 net: remove now-unused ssSend and Fuzz (Cory Fields)
5c2169c drop the optimistic write counter hack (Cory Fields)
ea33268 net: switch all callers to connman for pushing messages (Cory Fields)
3e32cd0 connman is in charge of pushing messages (Cory Fields)
b98c14c serialization: teach serializers variadics (Cory Fields)
2016-11-07 10:34:35 +01:00
Wladimir J. van der Laan 7b22e5001a
Merge #9070: Lockedpool fixes
b3ddc5e LockedPool: avoid quadratic-time allocation (Kaz Wesley)
0b59f80 LockedPool: fix explosion for illegal-sized alloc (Kaz Wesley)
21b8f3d LockedPool: test handling of invalid allocations (Kaz Wesley)
2016-11-07 09:21:23 +01:00
isle2983 4b04e32c20 [copyright] copyright header style uniform
Three categories of modifications:

1)

1 instance of 'The Bitcoin Core developers \n',
1 instance of 'the Bitcoin Core developers\n',
3 instances of 'Bitcoin Core Developers\n', and
12 instances of 'The Bitcoin developers\n'

are made uniform with the 443 instances of 'The Bitcoin Core developers\n'

2)

3 instances of 'BitPay, Inc\.\n' are made uniform with the other 6
instances of 'BitPay Inc\.\n'

3)

4 instances where there was no '(c)' between the 'Copyright' and the year
where it deviates from the style of the local directory.
2016-11-06 10:12:50 -07:00
R E Broadley 77cbbd9ecf Make warning message about wallet balance possibly
being incorrect less ambiguous.

Fixes #9079
2016-11-06 15:49:03 +08:00
UdjinM6 bd0de1386e 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)
2016-11-04 18:40:33 +03:00
Matt Corallo 190fd321ad Remove unused CTxOut::GetHash() 2016-11-04 10:50:43 -04:00
jnewbery 7451cf59cd Allow bitcoin-tx to parse partial transactions
Restore pre V0.13.1 functionality to bitcoin-tx and allow it to parse 0-input partial transactions.
2016-11-04 09:10:44 +00:00
Wladimir J. van der Laan ed64bcec2d
Merge #9069: Clean up bctest.py and bitcoin-util-test.py
2b175d4 Clean up bctest.py and bitcoin-util-test.py (John Newbery)
2016-11-04 08:31:23 +01:00
Cory Fields 902768099c net: handle version push in InitializeNode 2016-11-03 13:35:54 -07:00
Cory Fields 7588b85cd2 net: construct CNodeStates in place 2016-11-03 13:35:54 -07:00
Cory Fields 440f1d3e4c net: remove now-unused ssSend and Fuzz 2016-11-03 13:35:54 -07:00
Cory Fields 5c2169cc3f drop the optimistic write counter hack
This is now handled properly in realtime.
2016-11-03 13:35:54 -07:00
Cory Fields ea3326891d net: switch all callers to connman for pushing messages
Drop all of the old stuff.
2016-11-03 13:35:53 -07:00
Cory Fields 3e32cd09f6 connman is in charge of pushing messages
The changes here are dense and subtle, but hopefully all is more explicit
than before.

- CConnman is now in charge of sending data rather than the nodes themselves.
  This is necessary because many decisions need to be made with all nodes in
  mind, and a model that requires the nodes calling up to their manager quickly
  turns to spaghetti.

- The per-node-serializer (ssSend) has been replaced with a (quasi-)const
  send-version. Since the send version for serialization can only change once
  per connection, we now explicitly tag messages with INIT_PROTO_VERSION if
  they are sent before the handshake. With this done, there's no need to lock
  for access to nSendVersion.

  Also, a new stream is used for each message, so there's no need to lock
  during the serialization process.

- This takes care of accounting for optimistic sends, so the
  nOptimisticBytesWritten hack can be removed.

- -dropmessagestest and -fuzzmessagestest have not been preserved, as I suspect
  they haven't been used in years.
2016-11-03 13:32:09 -07:00
Cory Fields b98c14c4e3 serialization: teach serializers variadics
Also add a variadic CDataStream ctor for ease-of-use.
2016-11-03 13:32:09 -07:00
Wladimir J. van der Laan 82077ef6e4
Merge #9073: Trivial: Add common failure cases for rpc server connection failure
8f329f9 Add common failure cases for rpc server connection failure (instagibbs)
2016-11-03 19:20:01 +01:00
Suhas Daftuar d4833ff747 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-03 13:07:13 -04:00
Suhas Daftuar 88c35491ab Fix compact block handling to not ban if block is invalid 2016-11-03 13:07:12 -04:00
instagibbs 8f329f991b Add common failure cases for rpc server connection failure 2016-11-03 12:09:38 -04:00
Wladimir J. van der Laan 3665483be7
Merge #8969: Decouple peer-processing-logic from block-connection-logic (#2)
f5b960b Move nTimeBestReceived updating into net processing code (Matt Corallo)
d8670fb Move all calls to CheckBlockIndex out of net-processing logic (Matt Corallo)
d6ea737 Remove network state wipe from UnloadBlockIndex. (Matt Corallo)
fc0c24f Move MarkBlockAsReceived out of ProcessNewMessage (Matt Corallo)
65f35eb Move FlushStateToDisk call out of ProcessMessages::TX into ATMP (Matt Corallo)
2016-11-03 16:31:32 +01:00
John Newbery 2b175d4b01 Clean up bctest.py and bitcoin-util-test.py
- remove newlines
- change tabs for spaces, to align with convention in other py files
- add comments
- add 'Bitcoin Core Developers' copyright notice
2016-11-03 14:50:20 +00:00
Wladimir J. van der Laan fcf61b80fa
Merge #9050: net: make a few values immutable, and use deterministic randomness for the localnonce
59ac5c5 net: Use deterministic randomness for CNode's nonce, and make it const (Cory Fields)
aff6584 net: constify a few CNode vars to indicate that they're threadsafe (Cory Fields)
2016-11-03 10:45:18 +01:00
Wladimir J. van der Laan d1871da7fe
Merge #9071: Declare wallet.h functions inline
2ca882a Declare wallet.h functions inline (Pieter Wuille)
2016-11-03 10:22:11 +01:00
Pieter Wuille a33b1691f1 Do not fully sort all nodes for addr relay
As we only need 1 or 2, explicitly keep track of the best ones.
2016-11-03 00:20:04 -07:00
Pieter Wuille 508404de98
Merge #9053: IBD using chainwork instead of height and not using header timestamps
e141beb IsInitialBlockDownload no longer uses header-only timestamps. (Gregory Maxwell)
2082b55 Remove GetTotalBlocksEstimate and checkpoint tests that test nothing. (Gregory Maxwell)
fd46136 IBD check uses minimumchain work instead of checkpoints. (Gregory Maxwell)
2016-11-03 00:08:59 -07:00
Pieter Wuille ed0cc50afe
Merge #9036: wallet: Change default confirm target from 2 to 6
0fdf810 wallet: Change default confirm target from 2 to 6 (Wladimir J. van der Laan)
2016-11-02 23:36:27 -07:00
Pieter Wuille 2ca882ad41 Declare wallet.h functions inline 2016-11-02 17:29:16 -07:00
Kaz Wesley b3ddc5e76f LockedPool: avoid quadratic-time allocation
Use separate maps for used/free chunks to avoid linear scan through alloced
chunks for each alloc.
2016-11-02 16:52:56 -07:00
MarcoFalke c9bdf9a75f
Merge #9065: Merge doc/unit-tests.md into src/test/README.md
eedc461 Merge `doc/unit-tests.md` into `src/test/README.md` (Wladimir J. van der Laan)
2016-11-02 23:36:16 +01:00
Kaz Wesley 0b59f80625 LockedPool: fix explosion for illegal-sized alloc
Check for unreasonable alloc size in LockedPool rather than lancing through new
Arenas until we improbably find one worthy of the quixotic request or the system
can support no more Arenas.
2016-11-02 14:41:40 -07:00
Kaz Wesley 21b8f3db31 LockedPool: test handling of invalid allocations
(Currently fails due to bug)
2016-11-02 14:05:07 -07:00
Wladimir J. van der Laan 6a1343f73b
Merge #8977: [Wallet] Refactor wallet/init interaction (Reaccept wtx, flush thread)
cab1da7 [Wallet] Refactor wallet/init interaction (Reaccept wtx, flush thread) (Jonas Schnelli)
2016-11-02 21:37:43 +01:00
Wladimir J. van der Laan c05db83488
Merge #9013: Trivial: Explicitly pass const CChainParams& to LoadBlockIndexDB()
d0b01f3 Explicitly pass const CChainParams& to LoadBlockIndexDB() (Geoffrey Tsui)
2016-11-02 21:09:27 +01:00
Wladimir J. van der Laan bc785d7185
Merge #9042: [rpc] ParseHash: Fail when length is not 64
fa32619 [rpc] ParseHash: Fail when length is not 64 (MarcoFalke)
2016-11-02 21:04:20 +01:00
Wladimir J. van der Laan d316cfeb6e
Merge #9066: tests: Remove variable unused after refactoring
f91afe9 trivial: Remove variable unused after refactoring (Daniel Kraft)
2016-11-02 20:54:10 +01:00
Daniel Kraft f91afe9aac trivial: Remove variable unused after refactoring
Remove a variable that is now unused after the recent refactoring
(in 51f278329d) but has not been cleaned
up so far.
2016-11-02 19:31:19 +01:00
jnewbery 32c0d6e1d2 Add logging to bitcoin-util-test.py
- Use the python standard logging library
- Run all tests and report all failing test-cases (rather than stop after one test case fails)
- If output is different from expected output, log a contextual diff.
2016-11-02 18:16:57 +00:00
Wladimir J. van der Laan eedc461882 Merge doc/unit-tests.md into src/test/README.md
Refer to the right file in the top-level README.md.

Having only one file with test documentation saves some confusion about
where things are documented.
2016-11-02 18:19:43 +01:00
Wladimir J. van der Laan a4fd8dff68
Merge #8828: Move CWalletDB::ReorderTransactions to CWallet
86029e7 Move CWalletDB::ReorderTransactions to CWallet (Patrick Strateman)
2016-11-02 15:37:42 +01:00
Wladimir J. van der Laan 1107653d05
Merge #9060: trivial: fix bloom filter init to isEmpty = true
cccf73d trivial: fix bloom filter init to isEmpty = true (Robert McLaughlin)
2016-11-02 15:30:47 +01:00
Pavel Janík 4a9f3c50cc Do not shadow variable, use deprecated MAP_ANON if MAP_ANONYMOUS is not defined. 2016-11-02 14:18:19 +01:00
Wladimir J. van der Laan f8723d2318
Merge #8753: Locked memory manager
444c673 bench: Add benchmark for lockedpool allocation/deallocation (Wladimir J. van der Laan)
6567999 rpc: Add `getmemoryinfo` call (Wladimir J. van der Laan)
4536148 support: Add LockedPool (Wladimir J. van der Laan)
f4d1fc2 wallet: Get rid of LockObject and UnlockObject calls in key.h (Wladimir J. van der Laan)
999e4c9 wallet: Change CCrypter to use vectors with secure allocator (Wladimir J. van der Laan)
2016-11-02 11:16:29 +01:00
Wladimir J. van der Laan 6a8be7ba99
Merge #9032: test: Add format-dependent comparison to bctest
6c5cd9d test: Add format-dependent comparison to bctest (Wladimir J. van der Laan)
2016-11-02 11:15:36 +01:00
Wladimir J. van der Laan 101c642bef
Merge #8448: Store mempool and prioritization data to disk
582068a Add mempool.dat to doc/files.md (Pieter Wuille)
3f78562 Add DumpMempool and LoadMempool (Pieter Wuille)
ced7c94 Add AcceptToMemoryPoolWithTime function (Pieter Wuille)
c3efb58 Add feedelta to TxMempoolInfo (Pieter Wuille)
2016-11-02 11:12:58 +01:00
Gregory Maxwell e141beb6a9 IsInitialBlockDownload no longer uses header-only timestamps.
This avoids a corner case (mostly visible on testnet) where bogus
 headers can keep nodes in IsInitialBlockDownload.
2016-11-02 01:51:53 +00:00
Gregory Maxwell 2082b5574c Remove GetTotalBlocksEstimate and checkpoint tests that test nothing.
GetTotalBlocksEstimate is no longer used and it was the only thing
 the checkpoint tests were testing.

Since checkpoints are on their way out it makes more sense to remove
 the test file than to cook up a new pointless test.
2016-11-02 01:49:45 +00:00
Gregory Maxwell fd46136dfa IBD check uses minimumchain work instead of checkpoints.
This introduces a 'minimum chain work' chainparam which is intended
 to be the known amount of work in the chain for the network at the
 time of software release.  If you don't have this much work, you're
 not yet caught up.

This is used instead of the count of blocks test from checkpoints.

This criteria is trivial to keep updated as there is no element of
subjectivity, trust, or position dependence to it. It is also a more
reliable metric of sync status than a block count.
2016-11-02 01:47:02 +00:00
Robert McLaughlin cccf73db04 trivial: fix bloom filter init to isEmpty = true
Fixes newly initialized bloom filters being
constructed with isEmpty(false), which still
works but loses the possible speedup when
checking for key membership in an empty filter.
2016-11-01 21:04:26 -04:00
Jonas Schnelli 273bde37d8
Merge #9043: [qt] Return useful error message on ATMP failure
3333e5a [qt] Return useful error message on ATMP failure (MarcoFalke)
2016-11-01 08:33:17 +01:00
Gregory Maxwell d32036a47d 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.
2016-11-01 00:11:52 +00:00
Cory Fields 59ac5c5b72 net: Use deterministic randomness for CNode's nonce, and make it const 2016-10-31 17:17:18 -04:00
Cory Fields aff6584e09 net: constify a few CNode vars to indicate that they're threadsafe 2016-10-31 17:17:18 -04:00
Matt Corallo f5b960be4e Move nTimeBestReceived updating into net processing code 2016-10-31 10:08:11 -04:00
Matt Corallo d8670fb103 Move all calls to CheckBlockIndex out of net-processing logic
This will result in many more calls to CheckBlockIndex when
connecting a list of headers (eg in ::HEADERS messages processing)
but its only enabled in debug mode, and that should mostly just be
during IBD, so it should be OK.
2016-10-31 10:08:11 -04:00
Matt Corallo d6ea737be1 Remove network state wipe from UnloadBlockIndex.
UnloadBlockIndex is only used during init if we end up reindexing
to clear our block state so that we can start over. However, at
that time no connections have been brought up as CConnman hasn't
been started yet, so all of the network processing state logic is
empty when its called.

Additionally, the initialization of the recentRejects set is moved
to InitPeerLogic.
2016-10-31 10:08:11 -04:00
Matt Corallo fc0c24f67b Move MarkBlockAsReceived out of ProcessNewMessage 2016-10-31 10:08:11 -04:00
Matt Corallo 65f35eb91b Move FlushStateToDisk call out of ProcessMessages::TX into ATMP 2016-10-31 10:08:11 -04:00
MarcoFalke fa326193ad [rpc] ParseHash: Fail when length is not 64 2016-10-31 10:46:52 +01:00
Pieter Wuille 3f78562df5 Add DumpMempool and LoadMempool 2016-10-31 00:10:36 -07:00
Pieter Wuille ced7c949e8 Add AcceptToMemoryPoolWithTime function 2016-10-30 23:24:41 -07:00
Pieter Wuille c3efb58622 Add feedelta to TxMempoolInfo 2016-10-30 23:12:09 -07:00
matthias 7f61b49de8 Change all instance of 'GMT epoch' to 'Unix epoch' 2016-10-31 01:11:46 +01:00
Matt Corallo fe1dc62cef Hash P2P messages as they are received instead of at process-time 2016-10-30 18:04:57 -04:00
MarcoFalke 3333e5a1e5 [qt] Return useful error message on ATMP failure 2016-10-30 18:23:37 +01:00
Patrick Strateman 86029e72c9 Move CWalletDB::ReorderTransactions to CWallet 2016-10-30 02:15:49 -07:00
Wladimir J. van der Laan 6c5cd9d022 test: Add format-dependent comparison to bctest
This splits the output comparison for `bitcoin-tx` into two steps:

- First, check for data mismatch, parsing the data as json or hex
  depending on the extension of the output file

- Then, check if the literal string matches

For either of these cases give a different error.

This prevents wild goose chases when e.g. a trailing space doesn't match
exactly, and makes sure that both test output and examples are valid
data of the purported format.
2016-10-28 14:20:59 +02:00
Wladimir J. van der Laan 0fdf810d26 wallet: Change default confirm target from 2 to 6
Recent discussion (in IRC meetings, and e.g. #8989) has shown a
preference for the default confirm target for smartfees to be 6 instead
of 2, to avoid overpaying fees for questionable gain.

6 is also a compromise between the GUI's pre-#8989 value of 25 and the
bitcoind `-txconfirmtarget` default of 2. These were unified in #8989,
but this has made the (overly expensive) default of 2 as GUI default.
2016-10-28 14:15:46 +02:00
Wladimir J. van der Laan d2143dc937
Merge #8989: [Qt] overhaul smart-fee slider, adjust default confirmation target
cfe77ef [Qt] overhaul smart-fee slider, adjust default confirmation target (Jonas Schnelli)
6f02899 [Qt] Hide nTxConfirmTarget behind WalletModel (Jonas Schnelli)
004168d CoinControl: add option for custom confirmation target (Jonas Schnelli)
2016-10-28 14:14:55 +02:00
Wladimir J. van der Laan 0dcb888266
Merge #9016: Return useful error message on ATMP failure
169bdab Return useful error message on ATMP failure (instagibbs)
2016-10-28 13:49:15 +02:00
Jonas Schnelli cfe77ef412
[Qt] overhaul smart-fee slider, adjust default confirmation target 2016-10-28 10:44:30 +02:00
Jonas Schnelli 6f0289967f
[Qt] Hide nTxConfirmTarget behind WalletModel 2016-10-28 10:44:30 +02:00
Jonas Schnelli 004168dcb7
CoinControl: add option for custom confirmation target 2016-10-28 10:44:30 +02:00
S. Matthew English 1c3ecc70c8 instance of 'mem pool' to 'mempool'
there was only one instance of  'mem pool' and not 'mempool', so I changed it to conform to the others
2016-10-27 16:45:09 +02:00
Wladimir J. van der Laan 444c673d85 bench: Add benchmark for lockedpool allocation/deallocation 2016-10-27 13:17:26 +02:00
Wladimir J. van der Laan 6567999096 rpc: Add getmemoryinfo call
```
getmemoryinfo
Returns an object containing information about memory usage.

Result:
{
  "locked": {               (json object) Information about locked memory manager
    "used": xxxxx,          (numeric) Number of bytes used
    "free": xxxxx,          (numeric) Number of bytes available in current arenas
    "total": xxxxxxx,       (numeric) Total number of bytes managed
    "locked": xxxxxx,       (numeric) Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk.
  }
}

Examples:
> bitcoin-cli getmemoryinfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmemoryinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
```
2016-10-27 13:17:26 +02:00
Wladimir J. van der Laan 4536148b15 support: Add LockedPool
Add a pool for locked memory chunks, replacing LockedPageManager.

This is something I've been wanting to do for a long time. The current
approach of locking objects where they happen to be on the stack or heap
in-place causes a lot of mlock/munlock system call overhead, slowing
down any handling of keys.

Also locked memory is a limited resource on many operating systems (and
using a lot of it bogs down the system), so the previous approach of
locking every page that may contain any key information (but also other
information) is wasteful.
2016-10-27 13:17:25 +02:00
instagibbs 169bdabe14 Return useful error message on ATMP failure 2016-10-26 15:59:33 -04:00
Wladimir J. van der Laan 04c1c15544 rpc: Remove invalid explanation from wallet fee message 2016-10-26 11:57:27 +02:00
Russell Yanofsky 67c6326abd Send tip change notification from invalidateblock
This change is needed to prevent sync_blocks timeouts in the mempool_reorg
test after the sync_blocks update in the upcoming commit
"[qa] Change sync_blocks to pick smarter maxheight".

This change was initially suggested by Suhas Daftuar <sdaftuar@chaincode.com>
in https://github.com/bitcoin/bitcoin/pull/8680#r78209060
2016-10-25 15:30:55 -04:00
Geoffrey Tsui d0b01f3a85 Explicitly pass const CChainParams& to LoadBlockIndexDB() 2016-10-25 22:35:26 +08:00
Wladimir J. van der Laan 9bdf5269f8
Merge #8515: A few mempool removal optimizations
0334430 Add some missing includes (Pieter Wuille)
4100499 Return shared_ptr<CTransaction> from mempool removes (Pieter Wuille)
51f2783 Make removed and conflicted arguments optional to remove (Pieter Wuille)
f48211b Bypass removeRecursive in removeForReorg (Pieter Wuille)
2016-10-25 14:21:57 +02:00
Wladimir J. van der Laan f14f07cb94
Merge #9008: [net] Remove assert(nMaxInbound > 0)
fa1c3c2 [net] Remove assert(nMaxInbound > 0) (MarcoFalke)
2016-10-25 12:37:05 +02:00
Wladimir J. van der Laan e1d1f57b56
Merge #9002: Make connect=0 disable automatic outbound connections.
515e264 Make connect=0 disable automatic outbound connections. (Gregory Maxwell)
2016-10-25 12:27:24 +02:00
Gregory Maxwell 515e2642eb Make connect=0 disable automatic outbound connections.
Otherwise it just responds to this obvious bit of configuration by
 trying to connect to "0" in a loop.
2016-10-25 06:17:43 +00:00
MarcoFalke fa1c3c2eb0 [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.
2016-10-24 22:12:48 +02:00
Luke Dashjr 19f46f177e Qt: New network_disabled icon 2016-10-24 10:23:58 +00:00
Luke Dashjr 54cf99745f RPC/Net: Use boolean consistently for networkactive, and remove from getinfo 2016-10-24 10:23:58 +00:00
Jonas Schnelli b2b33d9017 Overhaul network activity toggle
- Rename RPC command "togglenetwork" to "setnetworkactive (true|false)"
- Add simple test case
- GUI toggle added to connections icon in statusbar
2016-10-24 10:23:58 +00:00
Jon Lund Steffensen 32efa79e0e Qt: Add GUI feedback and control of network activity state.
Add getNetworkActive()/setNetworkActive() method to client model.
Send network active status through NotifyNetworkActiveChanged.
Indicate in tool tip of gui status bar network indicator whether network activity is disabled.
Indicate in debug window whether network activity is disabled and add button to allow user to toggle network activity state.
2016-10-24 10:23:58 +00:00
Jon Lund Steffensen e38993bb36 RPC: Add "togglenetwork" method to toggle network activity temporarily
RPC command "togglenetwork" toggles network and returns new state after command.
RPC command "getinfo" returns "networkactive" field in output.
2016-10-24 10:23:58 +00:00
Jon Lund Steffensen 7c9a98aac8 Allow network activity to be temporarily suspended.
Added the function SetNetworkActive() which when called with argument set to false disconnects all nodes and sets the flag fNetworkActive to false. As long as this flag is false no new connections are attempted and no incoming connections are accepted. Network activity is reenabled by calling the function with argument true.
2016-10-24 10:23:58 +00:00
Wladimir J. van der Laan ced22d035a
Merge #8995: Add missing cs_main lock to ::GETBLOCKTXN processing
dfe7906 Add missing cs_main lock to ::GETBLOCKTXN processing (Matt Corallo)
2016-10-24 11:17:07 +02:00
Pieter Wuille 0334430b39 Add some missing includes 2016-10-21 19:22:43 -07:00
Pieter Wuille 4100499db4 Return shared_ptr<CTransaction> from mempool removes 2016-10-21 19:22:43 -07:00
Pieter Wuille 51f278329d Make removed and conflicted arguments optional to remove 2016-10-21 19:22:43 -07:00
Pieter Wuille f48211b700 Bypass removeRecursive in removeForReorg 2016-10-21 19:22:43 -07:00
Pavel Janík 1d8e12ba48 Fix doxygen comment: the transaction is returned in txOut 2016-10-21 23:42:37 +02:00
MarcoFalke f08222e882
Merge #8982: Eliminating Inconsistencies in Textual Output
3a286ab Eliminating Inconsistencies in Textual Output (S. Matthew English)
2016-10-21 19:39:46 +02:00
Matt Corallo dfe79060a6 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.
2016-10-21 12:15:19 -04:00
Wladimir J. van der Laan 3cf496d102
Merge #8968: Don't hold cs_main when calling ProcessNewBlock from a cmpctblock
72ca7d9 Don't hold cs_main when calling ProcessNewBlock from a cmpctblock (Matt Corallo)
2016-10-21 16:58:44 +02:00
Wladimir J. van der Laan 5af9a7117c
Merge #8975: Chainparams: Trivial: In AppInit2(), s/Params()/chainparams/
6f2f639 Chainparams: Trivial: In AppInit2(), s/Params()/chainparams/ (Jorge Timón)
2016-10-21 16:57:50 +02:00
Wladimir J. van der Laan 3fb3fade3c
Merge #8990: moveonly: move coincontrol to src/wallet
1ae5839 moveonly: move `coincontrol` to `src/wallet` (Wladimir J. van der Laan)
2016-10-21 15:30:28 +02:00
Jonas Schnelli 7b1bfa3a87
Merge #8985: Use pindexBestHeader instead of setBlockIndexCandidates for NotifyHeaderTip()
3154d6e [Qt] use NotifyHeaderTip's height and date for the progress update (Jonas Schnelli)
0a261b6 Use pindexBestHeader instead of setBlockIndexCandidates for NotifyHeaderTip() (Jonas Schnelli)
2016-10-21 14:30:02 +02:00
Wladimir J. van der Laan 1ae5839ff0 moveonly: move coincontrol to src/wallet 2016-10-21 11:48:18 +02:00
Wladimir J. van der Laan 5ca8ef299a libconsensus: Add input validation of flags
Makes it an error to use flags that have not been defined
on the libconsensus API.

There has been some confusion as to what pass to libconsensus, and
(combined with mention in the release notes) this should clear it up.

Using undocumented flags is a risk because their meaning,
and what combinations are allowed, changes from release to release.
E.g. it is no longer possible to pass (CLEANSTACK | P2SH) without
running into an assertion after the segwit changes.
2016-10-20 19:26:36 +02:00
Jonas Schnelli 3154d6e3a2
[Qt] use NotifyHeaderTip's height and date for the progress update 2016-10-20 19:02:59 +02:00
Jonas Schnelli 0a261b63fd
Use pindexBestHeader instead of setBlockIndexCandidates for NotifyHeaderTip() 2016-10-20 19:02:48 +02:00
S. Matthew English 3a286abf8f Eliminating Inconsistencies in Textual Output
There were discrepancies between usage of "block chain" and "blockchain", I've changed them to the latter. The reason for this was that Wikipedia when describing this data structure writes "A blockchain — *originally block chain*", so it seemed the more appropriate term.
2016-10-20 12:39:48 +02:00
Pavel Janík ff6639b0f5 Do not shadow local variable 2016-10-20 12:31:05 +02:00
Luke Dashjr 7942d31d5f RPC: importmulti: Avoid using boost::variant::operator!=, which is only in newer boost versions 2016-10-20 10:18:05 +00:00
Jonas Schnelli cab1da745b
[Wallet] Refactor wallet/init interaction (Reaccept wtx, flush thread) 2016-10-20 09:22:13 +02:00
Wladimir J. van der Laan f2d705629b
Merge #7551: Add importmulti RPC call
215caba Add consistency check to RPC call importmulti (Pedro Branco)
cb08fdb Add importmulti rpc call (Pedro Branco)
2016-10-20 09:04:32 +02:00
Jorge Timón 6f2f639cdf
Chainparams: Trivial: In AppInit2(), s/Params()/chainparams/ 2016-10-19 19:01:10 +02:00
Wladimir J. van der Laan c587577356
Merge #8928: Fix init segfault where InitLoadWallet() calls ATMP before genesis
37aefff Fix init segfault where InitLoadWallet() calls ATMP before genesis (Matt Corallo)
2016-10-19 18:11:15 +02:00
Wladimir J. van der Laan 475d68252e
Merge #8927: Add script tests for FindAndDelete in pre-segwit and segwit scripts
acf853d Add script tests for FindAndDelete in pre-segwit and segwit scripts (Johnson Lau)
2016-10-19 17:41:34 +02:00
Jonas Schnelli 3e942a7060
Merge #8774: Qt refactors to better abstract wallet access
178cd88 Qt/splash: Specifically keep track of which wallet(s) we are connected to for later disconnecting (Luke Dashjr)
1880aeb Qt: Get the private key for signing messages via WalletModel (Luke Dashjr)
2016-10-19 17:08:17 +02:00
Wladimir J. van der Laan 5d2c8e524e
Merge #7948: RPC: augment getblockchaininfo bip9_softforks data
fc14609 RPC: augment getblockchaininfo bip9_softforks data (mruddy)
2016-10-19 16:41:59 +02:00
Pedro Branco 215caba4ed Add consistency check to RPC call importmulti 2016-10-19 15:17:42 +01:00
Wladimir J. van der Laan f4d1fc259b wallet: Get rid of LockObject and UnlockObject calls in key.h
Replace these with vectors allocated from the secure allocator.

This avoids mlock syscall churn on stack pages, as well as makes
it possible to get rid of these functions.

Please review this commit and the previous one carefully that
no `sizeof(vectortype)` remains in the memcpys and memcmps usage
(ick!), and `.data()` or `&vec[x]` is used as appropriate instead of
&vec.
2016-10-19 16:17:33 +02:00
Wladimir J. van der Laan 999e4c91c2 wallet: Change CCrypter to use vectors with secure allocator
Change CCrypter to use vectors with secure allocator instead of buffers
on in the object itself which will end up on the stack. This avoids
having to call LockedPageManager to lock stack memory pages to prevent the
memory from being swapped to disk. This is wasteful.
2016-10-19 16:17:33 +02:00
Pedro Branco cb08fdbf78 Add importmulti rpc call 2016-10-19 15:17:13 +01:00
mruddy fc146095d2 RPC: augment getblockchaininfo bip9_softforks data 2016-10-19 09:08:39 -04:00
Jonas Schnelli e7156ad61b
[RPC] pass HTTP basic authentication username to the JSONRequest object 2016-10-19 14:47:27 +02:00
Jonas Schnelli 69d1c25768
[RPC] Give RPC commands more information about the RPC request 2016-10-19 14:42:08 +02:00
Wladimir J. van der Laan 23c32a9694
rpc: Change JSONRPCRequest to JSONRPCRequestObj
This is more consistent with `JSONRPCReplyObj`.
2016-10-19 14:30:14 +02:00
Wladimir J. van der Laan d736a6eb1f
Merge #8972: [Qt] make warnings label selectable (jonasschnelli)
ef0c9ee [Qt] make warnings label selectable (Jonas Schnelli)
2016-10-19 11:27:21 +02:00
Wladimir J. van der Laan b2df292e34
Merge #8951: RPC/Mining: getblocktemplate: Update and fix formatting of help
59daa58 RPC/Mining: getblocktemplate: Update and fix formatting of help (Luke Dashjr)
2016-10-19 10:59:11 +02:00
Jonas Schnelli ef0c9ee296 [Qt] make warnings label selectable 2016-10-19 10:51:59 +02:00
Luke Dashjr 59daa58d6a RPC/Mining: getblocktemplate: Update and fix formatting of help 2016-10-19 10:47:32 +02:00
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
jnewbery 5f274a1749 log block size and weight correctly. 2016-10-03 13:55:26 -04: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
Wladimir J. van der Laan d675984fdf
Merge #8784: Copyright headers for build scripts
0c4e6ce Add MIT license to build-aux/m4 scripts (Luke Dashjr)
3f8a5d8 Trivial: build-aux/m4/l_atomic: Fix typo (Luke Dashjr)
3b4b6dc Add MIT license to autogen.sh and share/genbuild.sh (Luke Dashjr)
f4dffdd Add MIT license to Makefiles (Luke Dashjr)
2016-09-29 07:58:08 +02:00
MarcoFalke fa05cfdf25 [rpc] throw JSONRPCError when utxo set can not be read 2016-09-28 21:00:58 +02:00
jnewbery 54e5d7c1b8 Add bitcoin-tx JSON tests 2016-09-28 13:38:42 -04:00
Pavel Janík 7e5fd7198e Do not include env_win.cc on non-Windows systems 2016-09-28 16:40:20 +02:00
Wladimir J. van der Laan 305087bdf6 net: Hardcode protocol sizes and use fixed-size types
The P2P network uses a fixed protocol, these sizes shouldn't change
based on what happens to be the architecture.
2016-09-28 15:33:45 +02:00
Wladimir J. van der Laan 41e58faf04 net: Consistent checksum handling
In principle, the checksums of P2P packets are simply 4-byte blobs which
are the first four bytes of SHA256(SHA256(payload)).

Currently they are handled as little-endian 32-bit integers half of the
time, as blobs the other half, sometimes copying the one to the other,
resulting in somewhat confused code.

This PR changes the handling to be consistent both at packet creation
and receiving, making it (I think) easier to understand.
2016-09-28 12:44:13 +02:00
Wladimir J. van der Laan 14b7b3fb9f
Merge #8814: [wallet, policy] ParameterInteraction: Don't allow 0 fee
fa4bfb4 [wallet, policy] ParameterInteraction: Don't allow 0 fee (MarcoFalke)
2016-09-28 08:09:42 +02:00
Johnson Lau e41bd449ab Add policy: null signature for failed CHECK(MULTI)SIG 2016-09-27 23:40:59 +08:00
Wladimir J. van der Laan 5a4f6d72e6
Merge #8526: Make non-minimal OP_IF/NOTIF argument non-standard for P2WSH
c72c5b1 Make non-minimal OP_IF/NOTIF argument non-standard for P2WSH (Johnson Lau)
2016-09-27 17:10:15 +02:00
Wladimir J. van der Laan e9d5f6fec8
Merge #8357: [mempool] Fix relaypriority calculation error
94a34a5 Fix relaypriority calculation error (maiiz)
2016-09-27 16:33:32 +02:00
Pavel Janík 4731cab8fb Do not shadow variables 2016-09-27 09:25:15 +02:00
MarcoFalke faa4de2a2a [qt] sync-overlay: Don't block during reindex 2016-09-26 22:29:45 +02:00
MarcoFalke 2f71490d21
Merge #8805: Trivial: Grammar and capitalization
c9ce17b Trivial: Grammar and capitalization (Derek Miller)
2016-09-26 22:27:45 +02:00
Wladimir J. van der Laan 8f1fbf36a7
Merge #8796: [trivial] fix mempool comment (outdated by BIP125)
c14ffd5 [trivial] fix mempool comment (outdated by BIP125) (jonnynewbs)
2016-09-26 15:11:02 +02:00
Wladimir J. van der Laan dd20ed1223
Merge #8780: [rpc] Deprecate getinfo
fa6e71b [qa] Add getinfo smoke tests and rework versionbits test (MarcoFalke)
ddddaaf [rpc] Deprecate getinfo (MarcoFalke)
2016-09-26 15:03:06 +02:00
Wladimir J. van der Laan bb843adc8d
Merge #8722: bitcoin-cli: More detailed error reporting
381826d bitcoin-cli: More detailed error reporting (Wladimir J. van der Laan)
2016-09-26 14:53:38 +02:00
jonnynewbs c14ffd524b [trivial] fix mempool comment (outdated by BIP125) 2016-09-26 08:52:52 -04:00
MarcoFalke fa4bfb4819 [wallet, policy] ParameterInteraction: Don't allow 0 fee 2016-09-26 14:44:24 +02:00
Wladimir J. van der Laan ab0b411868
Merge #8486: [wallet] Add high transaction fee warnings
faef293 [wallet] Add high transaction fee warnings (MarcoFalke)
2016-09-26 13:57:10 +02:00
Matthew King a92bf4af66 bitcoind: Daemonize using daemon(3)
Simplified version of #8278. Assumes that every OS that (a) is supported
by Bitcoin Core (b) supports daemonization has the `daemon()` function
in its C library.

- Removes the fallback path for operating systems that support
  daemonization but not `daemon()`. This prevents never-exercised code from
  ending up in the repository (see discussion here:
  https://github.com/bitcoin/bitcoin/pull/8278#issuecomment-242704745).

- Removes the windows-specific path. Windows doesn't support `daemon()`,
  so it don't support daemonization there, automatically.

Original code by Matthew King, adapted by Wladimir van der Laan.
2016-09-26 13:37:44 +02:00
MarcoFalke faef293cf3 [wallet] Add high transaction fee warnings 2016-09-26 01:11:27 +02:00
Wladimir J. van der Laan 37871f216e
Merge #8807: [univalue] Pull subtree from upstream
3650668 Squashed 'src/univalue/' changes from f32df99..daf1285 (MarcoFalke)
2016-09-25 16:21:43 +02:00
MarcoFalke 9bf41af708 Merge commit '3650668cdbbf369dd8f30c8e8eb5bb883325942d' into HEAD 2016-09-25 15:19:23 +02:00
Wladimir J. van der Laan b8d10fd4ef
Merge #8802: Fix future copyright year
edeaf24 Fix future copyright year (Mitchell Cash)
2016-09-25 13:12:01 +02:00
Derek Miller c9ce17beed Trivial: Grammar and capitalization 2016-09-24 12:22:47 -05:00
MarcoFalke 08cc5fd666
Merge #8790: [test] Remove redundant debug print in addrman_tests
3333bd2 [test] Remove redundant print in addrman_tests (MarcoFalke)
2016-09-24 15:38:38 +02:00
Mitchell Cash edeaf24e4c Fix future copyright year 2016-09-24 13:46:08 +10:00
Jonas Schnelli 24f72e9f3f
Merge #8371: [Qt] Add out-of-sync modal info layer
08827df [Qt] modalinfolayer: removed unused comments, renamed signal, code style overhaul (Jonas Schnelli)
d8b062e [Qt] only update "amount of blocks left" when the header chain is in-sync (Jonas Schnelli)
e3245b4 [Qt] add out-of-sync modal info layer (Jonas Schnelli)
e47052f [Qt] ClientModel add method to get the height of the header chain (Jonas Schnelli)
a001f18 [Qt] Always pass the numBlocksChanged signal for headers tip changed (Jonas Schnelli)
bd44a04 [Qt] make Out-Of-Sync warning icon clickable (Jonas Schnelli)
0904c3c [Refactor] refactor function that forms human readable text out of a timeoffset (Jonas Schnelli)
2016-09-23 18:22:48 +02:00
Jonas Schnelli 08827df3ec
[Qt] modalinfolayer: removed unused comments, renamed signal, code style overhaul 2016-09-23 16:07:21 +02:00
Wladimir J. van der Laan d2e46558ba
Merge #8661: Do not set an addr time penalty when a peer advertises itself.
6d0ced1 Do not set an addr time penalty when a peer advertises itself. (Gregory Maxwell)
2016-09-23 13:56:01 +02:00
Wladimir J. van der Laan 5d0219d983
Merge #8793: Do not shadow in src/qt
f839350 Do not shadow in src/qt (Pavel Janík)
2016-09-23 12:44:35 +02:00
Pavel Janík f839350420 Do not shadow in src/qt 2016-09-23 12:42:00 +02:00
Johnson Lau c72c5b1e3b Make non-minimal OP_IF/NOTIF argument non-standard for P2WSH 2016-09-23 13:07:38 +08:00
Wladimir J. van der Laan 2b514aa2ea
Merge #8785: Comment on CNode::nLocalServices meaning
b5ccded Comment on CConnman::nLocalServices meaning (instagibbs)
2016-09-22 16:41:02 +02:00
instagibbs b5ccded57f Comment on CConnman::nLocalServices meaning 2016-09-22 08:19:44 -04:00
MarcoFalke 3333bd2d15 [test] Remove redundant print in addrman_tests 2016-09-22 12:50:39 +02:00
Wladimir J. van der Laan 26b370a937
Merge #8636: Implement NULLDUMMY softfork (BIP147)
482f852 Implement NULLDUMMY softfork (Johnson Lau)
2016-09-22 10:58:00 +02:00
Luke Dashjr f4dffdd6bf Add MIT license to Makefiles 2016-09-21 22:35:12 +00:00
MarcoFalke ddddaafa4a [rpc] Deprecate getinfo
This was replaced by getmininginfo, getnetworkinfo and getwalletinfo
2016-09-21 21:19:20 +02:00
Wladimir J. van der Laan cf5ebaa921
Merge #8656: Trivial: Do not shadow global variable fileout
7c069a7 Do not shadow global variable (Pavel Janík)
2016-09-21 14:13:44 +02:00
Wladimir J. van der Laan 381826dfee bitcoin-cli: More detailed error reporting
Register a evhttp error handler to get a more detailed error message
if the HTTP request fails.
2016-09-21 14:02:42 +02:00
Wladimir J. van der Laan fec6af7440
Merge #8777: [qt] WalletModel: Expose disablewallet
6666ca6 [qt] WalletModel: Expose disablewallet (MarcoFalke)
2016-09-21 13:45:20 +02:00
MarcoFalke 6666ca6379 [qt] WalletModel: Expose disablewallet 2016-09-21 13:11:15 +02:00
Wladimir J. van der Laan 886e8c9b72
Merge #8768: init: Get rid of fDisableWallet
fa58edb [wallet] Introduce DEFAULT_DISABLE_WALLET (MarcoFalke)
fab9107 init: Get rid of fDisableWallet (MarcoFalke)
2016-09-21 12:27:56 +02:00
MarcoFalke fa58edbffe [wallet] Introduce DEFAULT_DISABLE_WALLET 2016-09-21 12:06:58 +02:00
Wladimir J. van der Laan b4f53641a9
Merge #8765: [Wallet] remove "unused" ThreadFlushWalletDB from removeprunedfunds
c6f5ca8 [Wallet] remove "unused" ThreadFlushWalletDB from removeprunedfunds (Jonas Schnelli)
2016-09-21 08:15:33 +02:00
MarcoFalke fab91070d3 init: Get rid of fDisableWallet 2016-09-20 17:32:05 +02:00
Jonas Schnelli c6f5ca822f
[Wallet] remove "unused" ThreadFlushWalletDB from removeprunedfunds 2016-09-20 16:18:24 +02:00
Jonas Schnelli 6052d50910
Merge #8672: Qt: Show transaction size in transaction details window
c015634 qt: Adding transaction size to transaction details window (Hampus Sjöberg)
 \-- merge fix for s/size/total size/
fdf82fb Adding method GetTotalSize() to CTransaction (Hampus Sjöberg)
2016-09-20 15:34:33 +02:00
Wladimir J. van der Laan 4335d5a41b
Merge #7783: [Qt] RPC-Console: support nested commands and simple value queries
1586044 [Qt] RPC-Console: support nested commands and simple value queries (Jonas Schnelli)
2016-09-20 14:15:35 +02:00
Wladimir J. van der Laan a1f8d3ed95
Merge #8696: [Wallet] Remove last external reference to CWalletDB
2ca6b9d Remove last reference to CWalletDB from accounting_tests.cpp (Patrick Strateman)
02e2a81 Remove pwalletdb parameter from CWallet::AddAccountingEntry (Patrick Strateman)
d2e678d Add CWallet::ReorderTransactions and use in accounting_tests.cpp (Patrick Strateman)
59adc86 Add CWallet::ListAccountCreditDebit (Patrick Strateman)
2016-09-20 12:47:31 +02:00
Wladimir J. van der Laan 02ac669730
Merge #8760: [init] Get rid of some ENABLE_WALLET
faddd62 init: Get rid of some ENABLE_WALLET (MarcoFalke)
2016-09-20 12:45:46 +02:00
Wladimir J. van der Laan 82eacc786d
Merge #8700: [copyright] add MIT license headers to .sh scripts where missing
0766d1c [copyright] add MIT license headers to .sh scripts where missing (isle2983)
2016-09-20 10:02:33 +02:00
maiiz 94a34a5d95 Fix relaypriority calculation error 2016-09-20 11:45:30 +08:00
Wladimir J. van der Laan 047ded0b12
Merge #8688: Move static global randomizer seeds into CConnman
d9ff591 Move static global randomizer seeds into CConnman (Pieter Wuille)
2016-09-19 18:02:01 +02:00
Wladimir J. van der Laan 8bae52a9a0
Merge #8737: Trivial: UndoReadFromDisk works on undo files (rev), not on block files.
b4fb512 UndoReadFromDisk works on undo files (rev), not on block files. (Pavel Janík)
2016-09-19 16:54:17 +02:00
Wladimir J. van der Laan f07424a671
Merge #8707: net: fix maxuploadtarget setting
f3552da net: fix maxuploadtarget setting (Cory Fields)
2016-09-19 16:46:50 +02:00
MarcoFalke faddd62518 init: Get rid of some ENABLE_WALLET 2016-09-19 16:14:18 +02:00
Pieter Wuille d9ff591d42 Move static global randomizer seeds into CConnman 2016-09-19 15:53:47 +02:00
Wladimir J. van der Laan 2ebb8099d9
Merge #8742: Specify Protobuf version 2 in paymentrequest.proto
c4084c2 Specify Protobuf version 2 in paymentrequest.proto (fanquake)
2016-09-19 15:43:51 +02:00
Wladimir J. van der Laan a5b20edd3d
Merge #8494: [init, wallet] ParameterInteraction() iff wallet enabled
fa5d276 [init] ParameterInteraction() iff wallet enabled (MarcoFalke)
2016-09-19 11:38:16 +02:00
Jiaxing Wang e892dc1268 Use prefix operator in for loop of DecodeBase58. 2016-09-16 19:13:01 +08:00
fanquake c4084c2085
Specify Protobuf version 2 in paymentrequest.proto 2016-09-16 11:45:08 +08:00
Wladimir J. van der Laan d9c99c3058 net: No longer send local address in addrMe
After #8594 the addrFrom sent by a node is not used anymore at all,
so don't bother sending it.

Also mitigates the privacy issue in (#8616). It doesn't completely solve
the issue as GetLocalAddress is also called in AdvertiseLocal, but at
least when advertising addresses it stands out less as *our* address.
2016-09-15 23:42:01 +02:00
Patrick Strateman 2ca6b9df1d Remove last reference to CWalletDB from accounting_tests.cpp 2016-09-15 13:51:04 -07:00
Patrick Strateman 02e2a81536 Remove pwalletdb parameter from CWallet::AddAccountingEntry 2016-09-15 13:50:59 -07:00
Patrick Strateman d2e678d7d2 Add CWallet::ReorderTransactions and use in accounting_tests.cpp 2016-09-15 06:52:15 -07:00
Patrick Strateman 59adc86680 Add CWallet::ListAccountCreditDebit
Simple pass through for CWalletDB::ListAccountCreditDebit
2016-09-15 06:52:15 -07:00
Pavel Janík b4fb512719 UndoReadFromDisk works on undo files (rev), not on block files. 2016-09-15 12:40:09 +02:00
Jiaxing Wang 159ed95f74 base58: Improve DecodeBase58 performance.
Improve DecodeBase58 performance the same way as commit 3252208 did
for EncodeBase58.
2016-09-15 17:39:54 +08:00
Cory Fields f3552da813 net: fix maxuploadtarget setting
This was broken by 63cafa6329.

Note that while this fixes the settings, it doesn't fix the actual usage of
-maxuploadtarget completely, as there is currently a bug in the
nOptimisticBytesWritten accounting that causes a delayed response if the target
is reached. That bug will be addressed separately.
2016-09-14 13:14:04 -04:00
Wladimir J. van der Laan 881d7eaf29
Merge #8715: net: only delete CConnman if it's been created
36fa01f net: only delete CConnman if it's been created (Cory Fields)
2016-09-14 10:16:25 +02:00
Cory Fields 36fa01f217 net: only delete CConnman if it's been created
In the case of (for example) an already-running bitcoind, the shutdown sequence
begins before CConnman has been created, leading to a null-pointer dereference
when g_connman->Stop() is called.

Instead, Just let the CConnman dtor take care of stopping.
2016-09-13 22:43:23 -04:00
Spencer Lievens a56037805c [WALLET] Addition of ImmatureCreditCached to MarkDirty()
To protect against possible invalidation and to bring conformity to the code.
2016-09-13 23:30:32 +01:00
Jonas Schnelli 1b6bcdd3aa
Remove maxuploadtargets recommended minimum 2016-09-13 18:08:17 +02:00
Jonas Schnelli d8b062ef5e
[Qt] only update "amount of blocks left" when the header chain is in-sync 2016-09-13 17:57:25 +02:00
Wladimir J. van der Laan fa7caf6d91
Merge #8693: add witness address to address book
62ffbbd add witness address to address book (instagibbs)
2016-09-13 17:10:28 +02:00
Wladimir J. van der Laan c9914c2094
Merge #8699: Remove createwitnessaddress RPC command
86c3f8d Remove createwitnessaddress (Johnson Lau)
2016-09-13 17:03:00 +02:00
Wladimir J. van der Laan 37ac67816a
Merge #8601: Add option to opt into full-RBF when sending funds (rebase, original by petertodd)
86726d8 Rename `-optintofullrbf` option to `-walletrbf` (Wladimir J. van der Laan)
05fa823 wallet: Add BIP125 comment for MAXINT-1/-2 behavior (Wladimir J. van der Laan)
152f45b Add option to opt into full-RBF when sending funds (Peter Todd)
2016-09-13 11:35:26 +02:00
Wladimir J. van der Laan 86726d8680 Rename -optintofullrbf option to -walletrbf
This makes it clear that this is a wallet option.
2016-09-13 11:32:29 +02:00
Johnson Lau 86c3f8db0b Remove createwitnessaddress
This RPC command is unsafe as it will return an address even if the script is invalid.
2016-09-13 11:35:14 +08:00
R E Broadley 1f951c67a4 Allow filterclear messages for enabling TX relay only.
An example of where this might be useful is allowing a node to connect blocksonly during IBD but then becoming a full-node once caught up with the latest block. This might also even want to be the default behaviour since during IBD most TXs appear to be orphans, and are routinely dropped (for example when a node disconnects). Therefore, this can waste a lot of bandwidth.

Additionally, another pull could be written to stop relaying of TXs to nodes that are clearly far behind the latest block and are running a node that doesn't store many orphan TXs, such as recent versions of Bitcoin Core.
2016-09-13 09:10:22 +07:00
isle2983 0766d1cac3 [copyright] add MIT license headers to .sh scripts where missing
Years are set according to 'git log' history
2016-09-11 13:36:22 -06:00
rodasmith 1d635ae61b fix op order to append first alert 2016-09-10 11:41:01 -07:00
instagibbs 62ffbbdec3 add witness address to address book 2016-09-09 12:15:08 -04:00
Jonas Schnelli 702e6e059b
Merge #8678: [Qt][CoinControl] fix UI bug that could result in paying unexpected fee
0480293 [Qt][CoinControl] fix UI bug that could result in paying unexpected fee (Jonas Schnelli)
2016-09-09 14:34:03 +02:00
Pavel Janík 64d9507ea5 [WIP] Remove unused statement in serialization 2016-09-09 13:59:34 +02:00
Pieter Wuille 6898213409
Merge #8681: Performance Regression Fix: Pre-Allocate txChanged vector
ec81881 Performance Regression Fix: Pre-Allocate txChanged vector (Jeremy Rubin)
2016-09-09 13:41:15 +02:00
Wladimir J. van der Laan 2abfe5956e
Merge #8664: Fix segwit-related wallet bug
c40b034 Clear witness with vin/vout in CWallet::CreateTransaction() (Suhas Daftuar)
2016-09-09 12:24:39 +02:00
Wladimir J. van der Laan 6423116741
Merge #8085: p2p: Begin encapsulation
0103c5b net: move MAX_FEELER_CONNECTIONS into connman (Cory Fields)
e700cd0 Convert ForEachNode* functions to take a templated function argument rather than a std::function to eliminate std::function overhead (Jeremy Rubin)
d1a2295 Made the ForEachNode* functions in src/net.cpp more pragmatic and self documenting (Jeremy Rubin)
98591c5 net: move vNodesDisconnected into CConnman (Cory Fields)
fa2f8bc net: add nSendBufferMaxSize/nReceiveFloodSize to CConnection::Options (Cory Fields)
a19553b net: Introduce CConnection::Options to avoid passing so many params (Cory Fields)
bafa5fc net: Drop StartNode/StopNode and use CConnman directly (Cory Fields)
e81a602 net: pass CClientUIInterface into CConnman (Cory Fields)
f60b905 net: Pass best block known height into CConnman (Cory Fields)
fdf69ff net: move max/max-outbound to CConnman (Cory Fields)
8a59369 net: move semOutbound to CConnman (Cory Fields)
bd72937 net: move nLocalServices/nRelevantServices to CConnman (Cory Fields)
be9c796 net: move SendBufferSize/ReceiveFloodSize to CConnman (Cory Fields)
63cafa6 net: move send/recv statistics to CConnman (Cory Fields)
adf5d4c net: SocketSendData returns written size (Cory Fields)
ee44fa9 net: move messageHandlerCondition to CConnman (Cory Fields)
960cf2e net: move nLocalHostNonce to CConnman (Cory Fields)
551e088 net: move nLastNodeId to CConnman (Cory Fields)
6c19d92 net: move whitelist functions into CConnman (Cory Fields)
53347f0 net: create generic functor accessors and move vNodes to CConnman (Cory Fields)
c0569c7 net: Add most functions needed for vNodes to CConnman (Cory Fields)
8ae2dac net: move added node functions to CConnman (Cory Fields)
502dd3a net: Add oneshot functions to CConnman (Cory Fields)
a0f3d3c net: move ban and addrman functions into CConnman (Cory Fields)
aaf018e net: handle nodesignals in CConnman (Cory Fields)
b1a5f43 net: move OpenNetworkConnection into CConnman (Cory Fields)
02137f1 net: Move socket binding into CConnman (Cory Fields)
5b446dd net: Pass CConnection to wallet rather than using the global (Cory Fields)
8d58c4d net: Pass CConnman around as needed (Cory Fields)
d7349ca net: Add rpc error for missing/disabled p2p functionality (Cory Fields)
cd16f48 net: Create CConnman to encapsulate p2p connections (Cory Fields)
d93b14d net: move CBanDB and CAddrDB out of net.h/cpp (Cory Fields)
531214f gui: add NodeID to the peer table (Cory Fields)
2016-09-09 11:52:22 +02:00
Wladimir J. van der Laan 4daf02a03f
Merge #8677: Do not shadow upper local variable 'send', prevent -Wshadow compiler warning.
125b946 Do not shadow upper local variable 'send', prevent -Wshadow compiler warning. (Pavel Janík)
2016-09-09 10:25:39 +02:00
Wladimir J. van der Laan 666eaf03cf
Merge #8680: Address Travis spurious failures
d6a5dc4 add waitfornewblock/waitforblock/waitforblockheight rpcs and use them for tests (Cory Fields)
2016-09-09 08:33:54 +02:00
Wladimir J. van der Laan 80a4f21d37
Merge #8525: Do not store witness txn in rejection cache
ca10a03 Add basic test for IsStandard witness transaction blinding (instagibbs)
34521e4 Do not store witness txn in rejection cache (Pieter Wuille)
2016-09-09 07:47:48 +02:00
Cory Fields 0103c5b90f net: move MAX_FEELER_CONNECTIONS into connman 2016-09-08 13:06:05 -04:00
Jeremy Rubin e700cd0bc8 Convert ForEachNode* functions to take a templated function argument rather than a std::function to eliminate std::function overhead 2016-09-08 13:06:05 -04:00
Jeremy Rubin d1a2295f0d Made the ForEachNode* functions in src/net.cpp more pragmatic and self documenting 2016-09-08 13:06:05 -04:00
Cory Fields 98591c5027 net: move vNodesDisconnected into CConnman 2016-09-08 13:06:05 -04:00
Cory Fields fa2f8bc47f net: add nSendBufferMaxSize/nReceiveFloodSize to CConnection::Options 2016-09-08 13:06:00 -04:00
Cory Fields a19553b992 net: Introduce CConnection::Options to avoid passing so many params 2016-09-08 13:04:29 -04:00
Cory Fields bafa5fc5a1 net: Drop StartNode/StopNode and use CConnman directly 2016-09-08 12:24:07 -04:00
Cory Fields e81a602cf0 net: pass CClientUIInterface into CConnman 2016-09-08 12:24:07 -04:00
Cory Fields f60b9059e4 net: Pass best block known height into CConnman
CConnman then passes the current best height into CNode at creation time.

This way CConnman/CNode have no dependency on main for height, and the signals
only move in one direction.

This also helps to prevent identity leakage a tiny bit. Before this change, an
attacker could theoretically make 2 connections on different interfaces. They
would connect fully on one, and only establish the initial connection on the
other. Once they receive a new block, they would relay it to your first
connection, and immediately commence the version handshake on the second. Since
the new block height is reflected immediately, they could attempt to learn
whether the two connections were correlated.

This is, of course, incredibly unlikely to work due to the small timings
involved and receipt from other senders. But it doesn't hurt to lock-in
nBestHeight at the time of connection, rather than letting the remote choose
the time.
2016-09-08 12:24:06 -04:00
Cory Fields fdf69ff21a net: move max/max-outbound to CConnman 2016-09-08 12:24:06 -04:00
Cory Fields 8a593694b1 net: move semOutbound to CConnman 2016-09-08 12:24:06 -04:00
Cory Fields bd72937dc4 net: move nLocalServices/nRelevantServices to CConnman
These are in-turn passed to CNode at connection time. This allows us to offer
different services to different peers (or test the effects of doing so).
2016-09-08 12:24:06 -04:00
Cory Fields be9c796dc5 net: move SendBufferSize/ReceiveFloodSize to CConnman 2016-09-08 12:24:06 -04:00
Cory Fields 63cafa6329 net: move send/recv statistics to CConnman 2016-09-08 12:24:06 -04:00
Cory Fields adf5d4c2e4 net: SocketSendData returns written size 2016-09-08 12:24:06 -04:00
Cory Fields ee44fa9576 net: move messageHandlerCondition to CConnman 2016-09-08 12:24:06 -04:00
Cory Fields 960cf2e405 net: move nLocalHostNonce to CConnman
This behavior seems to have been quite racy and broken.

Move nLocalHostNonce into CNode, and check received nonces against all
non-fully-connected nodes. If there's a match, assume we've connected
to ourself.
2016-09-08 12:24:06 -04:00
Cory Fields 551e0887db net: move nLastNodeId to CConnman 2016-09-08 12:24:06 -04:00
Cory Fields 6c19d92361 net: move whitelist functions into CConnman 2016-09-08 12:24:06 -04:00
Cory Fields 53347f0cb9 net: create generic functor accessors and move vNodes to CConnman 2016-09-08 12:24:06 -04:00
Cory Fields c0569c7fa1 net: Add most functions needed for vNodes to CConnman 2016-09-08 12:12:58 -04:00
Cory Fields 8ae2dac1c6 net: move added node functions to CConnman 2016-09-08 12:12:58 -04:00
Cory Fields 502dd3a8a0 net: Add oneshot functions to CConnman 2016-09-08 12:12:57 -04:00
Cory Fields a0f3d3cdad net: move ban and addrman functions into CConnman 2016-09-08 12:12:57 -04:00
Cory Fields aaf018e3b7 net: handle nodesignals in CConnman 2016-09-08 12:06:24 -04:00
Cory Fields b1a5f43208 net: move OpenNetworkConnection into CConnman 2016-09-08 12:06:24 -04:00
Cory Fields 02137f11e2 net: Move socket binding into CConnman 2016-09-08 12:06:24 -04:00
Cory Fields 5b446dd5b1 net: Pass CConnection to wallet rather than using the global 2016-09-08 12:04:35 -04:00
Cory Fields 8d58c4d81f net: Pass CConnman around as needed 2016-09-08 12:04:35 -04:00
Cory Fields d7349ca50d net: Add rpc error for missing/disabled p2p functionality 2016-09-08 12:04:35 -04:00
Cory Fields cd16f48028 net: Create CConnman to encapsulate p2p connections 2016-09-08 12:04:35 -04:00
Cory Fields d93b14dc5d net: move CBanDB and CAddrDB out of net.h/cpp
This will eventually solve a circular dependency
2016-09-08 12:03:22 -04:00
Cory Fields 531214fb10 gui: add NodeID to the peer table 2016-09-08 12:03:22 -04:00
MarcoFalke ddc308068d
Merge #8671: Minimal fix to slow prevector tests as stopgap measure
f71d4a3 Minimal fix to slow prevector tests as stopgap measure (Jeremy Rubin)
2016-09-08 11:12:50 +02:00
Jeremy Rubin ec81881b86 Performance Regression Fix: Pre-Allocate txChanged vector 2016-09-07 20:10:50 -04:00
MarcoFalke ec139a5621
Merge #8673: Trivial: Fix obvious assignment/equality error in test
426e7bc Fix obvious assignment/equality error in test (Jeremy Rubin)
2016-09-07 19:36:43 +02:00
Cory Fields d6a5dc4a2e add waitfornewblock/waitforblock/waitforblockheight rpcs and use them for tests
waitfornewblock waits until a new block is received, or the timeout expires, then
returns the current block height/hash.

waitforblock waits for a specific blockhash, or until the timeout expires, then
returns the current block height/hash. If the target blockhash is the current
tip, it will return immediately.

waitforblockheight waits until the tip has reached a certain height or higher,
then returns the current height and hash.

waitforblockheight is used to avoid polling in the rpc tests.
2016-09-07 12:46:01 -04:00
Jonas Schnelli 04802930d4
[Qt][CoinControl] fix UI bug that could result in paying unexpected fee 2016-09-07 16:05:27 +02:00
Pavel Janík 125b946cb4 Do not shadow upper local variable 'send', prevent -Wshadow compiler warning. 2016-09-07 13:45:13 +02:00
Pieter Wuille 5b2ea29cf4
Merge #8594: Do not add random inbound peers to addrman.
eb3596f Do not add random inbound peers to addrman. (Gregory Maxwell)
2016-09-07 13:19:53 +02:00
Pieter Wuille e2a1a1ee89
Merge #8606: Fix some locks
144ed76 Fix some locks (Pieter Wuille)
2016-09-07 13:10:10 +02:00
Hampus Sjöberg c015634400 qt: Adding transaction size to transaction details window 2016-09-06 22:31:36 +02:00
Hampus Sjöberg fdf82fba31 Adding method GetTotalSize() to CTransaction
GetTotalSize() returns the total transaction size (including witness) in
bytes.
2016-09-06 22:30:30 +02:00
Jeremy Rubin 426e7bce0e Fix obvious assignment/equality error in test 2016-09-06 16:22:13 -04:00
Jeremy Rubin f71d4a3786 Minimal fix to slow prevector tests as stopgap measure 2016-09-06 16:19:25 -04:00
Wladimir J. van der Laan d077f43f7e
Merge #8663: trivial: remove unnecessary variable fDaemon
ff2ed7a trivial: remove unnecessary variable fDaemon (mruddy)
2016-09-06 15:20:08 +02:00
Pieter Wuille 34521e4d7d Do not store witness txn in rejection cache 2016-09-05 17:48:56 +02:00
Pieter Wuille e82fb872ff
Merge #8651: Predeclare PrecomputedTransactionData as struct
4424af5 Predeclare PrecomputedTransactionData as sturct (Pieter Wuille)
2016-09-05 13:30:09 +02:00
Suhas Daftuar c40b034327 Clear witness with vin/vout in CWallet::CreateTransaction() 2016-09-04 20:09:13 -04:00
mruddy ff2ed7a5bc trivial: remove unnecessary variable fDaemon 2016-09-04 11:42:07 -04:00
Gregory Maxwell 6d0ced1865 Do not set an addr time penalty when a peer advertises itself.
Claims a peer makes about itself are inherently more credible.
2016-09-03 10:24:37 +00:00
Pavel Janík 7c069a7093 Do not shadow global variable 2016-09-02 20:50:59 +02:00
Wladimir J. van der Laan cbe9ae8c69
Merge #8466: [Trivial] Do not shadow variables in networking code
b7c349d Do not shadow variables in networking code (Pavel Janík)
2016-09-02 12:51:56 +02:00
Wladimir J. van der Laan 381d0ddc8a
Merge #8449: [Trivial] Do not shadow local variable, cleanup
a159f25 Remove redundand (and shadowing) declaration (Pavel Janík)
cce3024 Do not shadow local variable, cleanup (Pavel Janík)
2016-09-02 12:25:59 +02:00
Pieter Wuille 4424af5190 Predeclare PrecomputedTransactionData as sturct 2016-09-02 11:43:06 +02:00
Wladimir J. van der Laan 6f939c9080
Merge #8629: C++11: s/boost::scoped_ptr/std::unique_ptr/
cdd79eb C++11: s/boost::scoped_ptr/std::unique_ptr/ (Jorge Timón)
2016-09-02 09:56:33 +02:00
Jorge Timón cdd79eb70f C++11: s/boost::scoped_ptr/std::unique_ptr/ 2016-09-01 19:05:07 +02:00
Pieter Wuille 854f1af22e Make the dummy argument to getaddednodeinfo optional 2016-09-01 16:27:30 +02:00
Wladimir J. van der Laan f061415d12
Merge #8638: rest.cpp: change HTTP_INTERNAL_SERVER_ERROR to HTTP_BAD_REQUEST
f012a85 rest.cpp: change HTTP_INTERNAL_SERVER_ERROR to HTTP_BAD_REQUEST (djpnewton)
2016-09-01 15:58:43 +02:00
Wladimir J. van der Laan 0e563d89c0
Merge #8472: Do not shadow LOCK's criticalblock variable for LOCK inside LOCK
33d15a3 Do not shadow LOCK's criticalblock variable for LOCK inside LOCK (Pavel Janík)
2016-09-01 14:42:00 +02:00
Pieter Wuille 19b0f33de0
Merge #8524: Precompute sighashes
35fe039 Rename to PrecomputedTransactionData (Pieter Wuille)
ab48c5e Unit test for sighash caching (Nicolas DORIER)
d2c5d04 Precompute sighashes (Pieter Wuille)
2016-09-01 12:20:43 +02:00
djpnewton f012a857f5 rest.cpp: change HTTP_INTERNAL_SERVER_ERROR to HTTP_BAD_REQUEST 2016-09-01 22:12:19 +12:00
Wladimir J. van der Laan 84decb54f2
Merge #8612: Check for compatibility with download in FindNextBlocksToDownload
887919c Check for compatibility with download in FindNextBlocksToDownload (Pieter Wuille)
2016-08-31 17:59:56 +02:00
Wladimir J. van der Laan abc677c9a9
Merge #8191: Do not shadow variables in src/wallet
b175cb7 Do not shadow variables. (Pavel Janík)
2016-08-31 16:40:29 +02:00
Wladimir J. van der Laan 5cac8b123e
Merge #8291: [util] CopyrightHolders: Check for untranslated substitution
33336e1 [util] CopyrightHolders: Check for untranslated substitution (MarcoFalke)
2016-08-31 16:17:00 +02:00
Pavel Janík b175cb755b Do not shadow variables. 2016-08-31 16:16:05 +02:00
Wladimir J. van der Laan 0c8875d23b
Merge #8163: Do not shadow global RPC table variable (tableRPC)
de1bbe3 Do not shadow global RPC table variable (tableRPC) (Pavel Janík)
2016-08-31 16:07:58 +02:00
Wladimir J. van der Laan df3f12d409
Merge #8626: Berkeley DB v6 compatibility fix
323a5fe Berkeley DB v6 compatibility fix (Alexey Vesnin)
2016-08-31 14:42:45 +02:00
Johnson Lau 482f852da6 Implement NULLDUMMY softfork 2016-08-31 19:38:23 +08:00
Wladimir J. van der Laan 2b23dbaee5
Merge #8611: Reduce default number of blocks to check at startup
203f212 Reduce default number of blocks to check at startup (Pieter Wuille)
2016-08-30 13:38:42 +02:00
Alexey Vesnin 323a5fe06a Berkeley DB v6 compatibility fix
Fixes building error looking like this:
CXX wallet/libbitcoin_wallet_a-db.o
wallet/db.cpp: In member function ‘void CDBEnv::EnvShutdown()’:
wallet/db.cpp:46:16: error: call of overloaded ‘DbEnv(int)’ is ambiguous
DbEnv(0).remove(strPath.c_str(), 0);
^
wallet/db.cpp:46:16: note: candidates are:
In file included from wallet/db.h:21:0,
from wallet/db.cpp:6:
/usr/include/db_cxx.h:916:2: note: DbEnv::DbEnv(const DbEnv&)
DbEnv(const DbEnv &);
^
/usr/include/db_cxx.h:518:2: note: DbEnv::DbEnv(DB_ENV)
DbEnv(DB_ENV *dbenv);
^
/usr/include/db_cxx.h:516:2: note: DbEnv::DbEnv(u_int32_t)
DbEnv(u_int32_t flags);
^
Makefile:5780: recipe for target 'wallet/libbitcoin_wallet_a-db.o' failed
make[2]: ** [wallet/libbitcoin_wallet_a-db.o] Error 1
2016-08-30 09:00:55 +03:00
Pieter Wuille 01680195f8
Merge #8564: [Wallet] remove unused code/conditions in ReadAtCursor
beef966 [Wallet] remove unused code/conditions in ReadAtCursor (Jonas Schnelli)
2016-08-29 16:16:23 +02:00
Wladimir J. van der Laan a5bb6387f7
Merge #8607: [doc] Fix doxygen off-by-one comments, fix typos
fafe7b3 contrib: Make fix-copyright-headers.py more portable (MarcoFalke)
fa27c0a [doc] Fix typos in comments, doxygen: Fix comment syntax (MarcoFalke)
fabfd5d [qa] pull-tester: Don't mute zmq ImportError (MarcoFalke)
67a5502 init: Fix typo in help message for -whitelistforcerelay (Wladimir J. van der Laan)
2016-08-28 16:06:03 +02:00
Pieter Wuille 05e1c85fb6
Merge #8573: Set jonasschnellis dns-seeder filter flag
40a95cf Set jonasschnellis dns-seeder filter flag (Jonas Schnelli)
2016-08-28 13:17:30 +02:00
Pieter Wuille 203f2121be Reduce default number of blocks to check at startup 2016-08-27 15:28:20 +02:00
Pieter Wuille 5127c4f21c Add preciousblock RPC
Includes a bugfix by Luke-Jr.
2016-08-26 23:05:45 +02:00
Pieter Wuille 887919c7b7 Check for compatibility with download in FindNextBlocksToDownload 2016-08-26 21:44:44 +02:00
Pieter Wuille 144ed76ea0 Fix some locks
This makes sure that cs_filter is never held while taking cs_main
or CNode::cs_vSend.
2016-08-26 21:11:57 +02:00
Pieter Wuille 35fe0393f2 Rename to PrecomputedTransactionData 2016-08-26 18:44:10 +02:00
Pieter Wuille 9a0ed08b40
Merge #8109: Do not shadow member variables
ff8d279 Do not shadow member variables (Pavel Janík)
2016-08-26 18:13:22 +02:00
Wladimir J. van der Laan 12892dbb9f
Merge #8590: Remove unused variables
fa6dc9f Remove unused variables (MarcoFalke)
2016-08-26 13:24:12 +02:00
Wladimir J. van der Laan 05fa823bf6 wallet: Add BIP125 comment for MAXINT-1/-2 behavior 2016-08-26 12:57:28 +02:00
Peter Todd 152f45ba58 Add option to opt into full-RBF when sending funds 2016-08-26 12:10:42 +02:00
Jonas Schnelli e3245b43d5
[Qt] add out-of-sync modal info layer 2016-08-26 11:34:30 +02:00
Wladimir J. van der Laan 65837375d9
Merge #8581: [wallet] rpc: Drop misleading option
fab5ecb [wallet] rpc: Drop misleading option (MarcoFalke)
2016-08-26 11:21:55 +02:00
Wladimir J. van der Laan c19f8a4a77
Merge #8583: Show XTHIN in GUI
4c3e2cb Show XTHIN in GUI (R E Broadley)
2016-08-26 11:20:36 +02:00
Wladimir J. van der Laan 6c9f1b8c24
Merge #8561: Show "end" instead of many zeros when getheaders request received with a hashStop of Null
259ee09 Show "end" instead of many zeros when getheaders request received with a hashStop of Null. (R E Broadley)
2016-08-26 10:04:26 +02:00
Jonas Schnelli e47052f6b5
[Qt] ClientModel add method to get the height of the header chain 2016-08-26 09:53:09 +02:00
Jonas Schnelli a001f18802
[Qt] Always pass the numBlocksChanged signal for headers tip changed 2016-08-26 09:53:09 +02:00
Jonas Schnelli bd44a04dc3
[Qt] make Out-Of-Sync warning icon clickable 2016-08-26 09:53:09 +02:00
Jonas Schnelli 0904c3cda4
[Refactor] refactor function that forms human readable text out of a timeoffset 2016-08-26 09:53:09 +02:00
Gregory Maxwell eb3596f7c2 Do not add random inbound peers to addrman.
We should learn about new peers via address messages.

An inbound peer connecting to us tells us nothing about
 its ability to accept incoming connections from us, so
 we shouldn't assume that we can connect to it based on
 this.

The vast majority of nodes on the network do not accept
 incoming connections, adding them will only slow down
 the process of making a successful connection in the
 future.

Nodes which have configured themselves to not announce would prefer we
 not violate their privacy by announcing them in GETADDR responses.
2016-08-25 23:48:59 +00:00
MarcoFalke fa8b02d36d [rpc] rawtx: Prepare fLimitFree to make it an option 2016-08-25 15:28:04 +02:00
MarcoFalke fa28bfa341 [wallet] Set fLimitFree = true 2016-08-25 15:27:48 +02:00
Pieter Wuille 53f8f226bd
Merge #8462: Move AdvertiseLocal debug output to net category
f13c1ba Move AdvertiseLocal debug output to net category (Michael Rotarius)
2016-08-25 15:15:16 +02:00
Pavel Janík de1bbe3b78 Do not shadow global RPC table variable (tableRPC) 2016-08-25 15:02:26 +02:00
MarcoFalke fa6dc9f0e5 Remove unused variables 2016-08-25 14:59:38 +02:00
Jonas Schnelli 0606f95b1e
Merge #7579: [Qt] show network/chain errors in the GUI
2f32c82 [Qt] show network/chain errors in the GUI (Jonas Schnelli)
2016-08-25 14:55:26 +02:00
Jonas Schnelli d26234a9e2
Merge #8487: Persist the datadir after option reset
57acb82 Load choose datadir dialog after options reset (Andrew Chow)
15df3c1 Persist the datadir after option reset (Andrew Chow)
2016-08-25 11:42:57 +02:00
MarcoFalke 95a983d56d
Merge #8578: [test] Remove unused code
fa1cf9e [test] Remove unused code (MarcoFalke)
2016-08-25 11:00:21 +02:00
Wladimir J. van der Laan 026c6edac9
Merge #8282: net: Feeler connections to increase online addrs in the tried table.
dbb1f64 Added feeler connections increasing good addrs in the tried table. (Ethan Heilman)
2016-08-25 10:48:24 +02:00
R E Broadley 4c3e2cb2df Show XTHIN in GUI 2016-08-25 09:22:46 +07:00
MarcoFalke fa1cf9e7b8 [test] Remove unused code 2016-08-24 20:21:31 +02:00
MarcoFalke fab5ecb771 [wallet] rpc: Drop misleading option 2016-08-24 19:28:04 +02:00
Andrew Chow 57acb82e70 Load choose datadir dialog after options reset 2016-08-24 09:40:48 -04:00
Jonas Schnelli 62a5a8a018
Merge #8463: [qt] Remove Priority from coincontrol dialog
fa8dd78 [qt] Remove Priority from coincontrol dialog (MarcoFalke)
2016-08-24 13:58:43 +02:00
Wladimir J. van der Laan 21857d2bf7
Merge #8450: [Test] Replace rpc_wallet_tests.cpp with python RPC unit tests
9578333 Remove rpc_wallet_tests.cpp (Patrick Strateman)
25400c4 Account wallet feature RPC tests. (Patrick Strateman)
2016-08-24 12:10:42 +02:00
MarcoFalke fa8dd785a2 [qt] Remove Priority from coincontrol dialog 2016-08-24 11:37:30 +02:00
Pieter Wuille f12d2b5a8a
Merge #8560: Trivial: Fix two VarInt examples in serialize.h
7bd5ff4 Trivial: Fix two VarInt examples in serialize.h (Christian Barcenas)
2016-08-24 10:42:08 +02:00
Wladimir J. van der Laan f9167003d9
Merge #8445: Move CWallet::setKeyPool to private section of CWallet.
8680d3a Move wallet initialization logic from AppInit2 to CWallet::InitLoadWallet (Patrick Strateman)
e86eb71 Move CWallet::setKeyPool to private section of CWallet (Patrick Strateman)
2016-08-24 10:33:16 +02:00
Jonas Schnelli 40a95cfd8f
Set jonasschnellis dns-seeder filter flag 2016-08-24 09:06:56 +02:00
Ethan Heilman dbb1f640e6 Added feeler connections increasing good addrs in the tried table.
Tests if addresses are online or offline by briefly connecting to them. These short lived connections are referred to as feeler connections. Feeler connections are designed to increase the number of fresh online addresses in tried by selecting and connecting to addresses in new. One feeler connection is attempted on average once every two minutes.

This change was suggested as Countermeasure 4 in
Eclipse Attacks on Bitcoin’s Peer-to-Peer Network, Ethan Heilman,
Alison Kendler, Aviv Zohar, Sharon Goldberg. ePrint Archive Report
2015/263. March 2015.
2016-08-23 16:26:42 -04:00
Jonas Schnelli beef966e36
[Wallet] remove unused code/conditions in ReadAtCursor 2016-08-23 15:36:23 +02:00
Jonas Schnelli 15860448d3
[Qt] RPC-Console: support nested commands and simple value queries
Commands can be executed with bracket syntax, example: `getwalletinfo()`.
Commands can be nested, example: `sendtoaddress(getnewaddress(), 10)`.
Simple queries are possible: `listunspent()[0][txid]`
Object values are accessed with a non-quoted string, example: [txid].

Fully backward compatible.
`generate 101` is identical to `generate(101)`
Result value queries indicated with `[]` require the new brackets syntax.
Comma as argument separator is now also possible: `sendtoaddress,<address>,<amount>`
Space as argument separator works also with the bracket syntax, example: `sendtoaddress(getnewaddress() 10)

No dept limitation, complex commands are possible:
`decoderawtransaction(getrawtransaction(getblock(getbestblockhash())[tx][0]))[vout][0][value]`
2016-08-23 15:32:39 +02:00
R E Broadley 259ee09f88 Show "end" instead of many zeros when getheaders request received with a hashStop of Null. 2016-08-23 13:14:07 +07:00
Christian Barcenas 7bd5ff4623 Trivial: Fix two VarInt examples in serialize.h 2016-08-22 20:49:36 -04:00
Wladimir J. van der Laan 41d8e78f94
Merge #8539: CDB: fix debug output
fab2e26 CDB: fix debug output (crowning-)
2016-08-22 16:40:08 +02:00
MarcoFalke fa27c0a2c4 [doc] Fix typos in comments, doxygen: Fix comment syntax 2016-08-22 10:51:41 +02:00
Wladimir J. van der Laan 67a55025a1 init: Fix typo in help message for -whitelistforcerelay
Reported by pryds on Transifex in the Danish translation.
2016-08-22 10:51:13 +02:00
Wladimir J. van der Laan 37e77c106c
Merge #8554: trivial: remove unused variable
4207630 trivial: remove unused variable (Daniel Kraft)
2016-08-22 10:36:37 +02:00
Wladimir J. van der Laan bb0f763a25
Merge #8558: Add copyright header to wallet_text_fixture.cpp
653bb3d Add copyright header to wallet_text_fixture.cpp (Wladimir J. van der Laan)
2016-08-22 10:32:30 +02:00
Wladimir J. van der Laan a55a018d5f
Merge #8548: [wallet] Use __func__ to get function name for output printing
fa785d1 Use __func__ to get function name for output printing (MarcoFalke)
2016-08-22 09:58:28 +02:00
Wladimir J. van der Laan 653bb3d640 Add copyright header to wallet_text_fixture.cpp
I created the file but forgot to add this header.
2016-08-22 09:24:50 +02:00
Patrick Strateman 8680d3aa80 Move wallet initialization logic from AppInit2 to CWallet::InitLoadWallet 2016-08-20 14:03:47 -07:00
Daniel Kraft 4207630f5a trivial: remove unused variable
Remove the unused variable "blockTmp" in CMerkleTx::SetMerkleBranch.  It
was previously used to read the block from disk if not provided as
argument, but is no longer needed.
2016-08-20 10:28:06 +02:00
MarcoFalke fa785d1211 Use __func__ to get function name for output printing 2016-08-19 18:59:00 +02:00
Jonas Schnelli 2468292a03
Merge #8517: [Qt] show wallet HD state in statusbar
914154f [Qt] add HD enabled/disabled icon to the status bar (Jonas Schnelli)
2016-08-19 18:47:49 +02:00
Jonas Schnelli 56ac046960
Merge #8443: [Wallet] Trivial cleanup of HD wallet changes
7e5d94d [Wallet] Trivial cleanup of HD wallet changes (Jonas Schnelli)
2016-08-19 18:39:19 +02:00
Jonas Schnelli 7e5d94df1f
[Wallet] Trivial cleanup of HD wallet changes 2016-08-19 16:23:37 +02:00
Wladimir J. van der Laan f4e777819c
Merge #8461: document return value of networkhashps for getmininginfo RPC endpoint
65f4532 document return value of networkhashps for getmininginfo RPC endpoint (Jameson Lopp)
2016-08-19 12:18:42 +02:00
Jonas Schnelli 914154f0cc
[Qt] add HD enabled/disabled icon to the status bar 2016-08-19 09:21:04 +02:00
Wladimir J. van der Laan b4a9aa511c qt: Fix random segfault when closing "Choose data directory" dialog
The `pickDataDirectory()` function was calling `exit(0)` to quit
the application when the user closes the dialog without choosing
a data directory.

This is a bad idea because a background thread is created (to
check free space on the drive of the currently selected datadir).
The thread is not stopped and unwound properly, resulting in a potential
race condition somewhere deep in Qt.

So replace the `exit()` by a boolean return value, and let the
stack unwind normally.
2016-08-18 16:58:25 +02:00
crowning- fab2e26d20 CDB: fix debug output
It doesn't really help to clear a variable before printing it to the debug log.
2016-08-18 16:52:38 +02:00
Pieter Wuille 8250de1358
Merge #8453: Bring secp256k1 subtree up to date with master
b213535 Squashed 'src/secp256k1/' changes from 6c527ec..7a49cac (Wladimir J. van der Laan)
2016-08-18 13:53:41 +02:00
Patrick Strateman e86eb71604 Move CWallet::setKeyPool to private section of CWallet 2016-08-17 15:24:57 -07:00
Wladimir J. van der Laan e753eaeb34
Merge #8505: Trivial: Fix typos in various files
1aacfc2 various typos (leijurv)
2016-08-17 12:51:16 +02:00
Wladimir J. van der Laan 65e6444181
Merge #8513: Fix a type error that would not compile on OSX.
8194a6e Fix a type error that would not compile on Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) (Jeremy Rubin)
2016-08-17 12:32:58 +02:00
Wladimir J. van der Laan 29496fc9e0
Merge #8512: Trivial: Corrected JSON typo on setban of net.cpp
6ffd996 Corrected JSON typo on setban of net.cpp (Sev)
2016-08-17 12:01:46 +02:00
Nicolas DORIER ab48c5e721 Unit test for sighash caching 2016-08-16 15:37:56 +02:00
Pieter Wuille d2c5d044d0 Precompute sighashes
Original version by Nicolas Dorier. Precomputing version by Pieter Wuille.
2016-08-16 15:35:45 +02:00
Wladimir J. van der Laan 0237096df5 Merge commit 'b2135359b3ad37cf2ac09b008079ddb237eff2c9' 2016-08-16 11:34:43 +02:00
Wladimir J. van der Laan b2135359b3 Squashed 'src/secp256k1/' changes from 6c527ec..7a49cac
7a49cac Merge #410: Add string.h include to ecmult_impl
0bbd5d4 Add string.h include to ecmult_impl
c5b32e1 Merge #405: Make secp256k1_fe_sqrt constant time
926836a Make secp256k1_fe_sqrt constant time
e2a8e92 Merge #404: Replace 3M + 4S doubling formula with 2M + 5S one
8ec49d8 Add note about 2M + 5S doubling formula
5a91bd7 Merge #400: A couple minor cleanups
ac01378 build: add -DSECP256K1_BUILD to benchmark_internal build flags
a6c6f99 Remove a bunch of unused stdlib #includes
65285a6 Merge #403: configure: add flag to disable OpenSSL tests
a9b2a5d configure: add flag to disable OpenSSL tests
b340123 Merge #402: Add support for testing quadratic residues
e6e9805 Add function for testing quadratic residue field/group elements.
efd953a Add Jacobi symbol test via GMP
fa36a0d Merge #401: ecmult_const: unify endomorphism and non-endomorphism skew cases
c6191fd ecmult_const: unify endomorphism and non-endomorphism skew cases
0b3e618 Merge #378: .gitignore build-aux cleanup
6042217 Merge #384: JNI: align shared files copyright/comments to bitcoinj's
24ad20f Merge #399: build: verify that the native compiler works for static precomp
b3be852 Merge #398: Test whether ECDH and Schnorr are enabled for JNI
aa0b1fd build: verify that the native compiler works for static precomp
eee808d Test whether ECDH and Schnorr are enabled for JNI
7b0fb18 Merge #366: ARM assembly implementation of field_10x26 inner (rebase of #173)
001f176 ARM assembly implementation of field_10x26 inner
0172be9 Merge #397: Small fixes for sha256
3f8b78e Fix undefs in hash_impl.h
2ab4695 Fix state size in sha256 struct
6875b01 Merge #386: Add some missing `VERIFY_CHECK(ctx != NULL)`
2c52b5d Merge #389: Cast pointers through uintptr_t under JNI
43097a4 Merge #390: Update bitcoin-core GitHub links
31c9c12 Merge #391: JNI: Only call ecdsa_verify if its inputs parsed correctly
1cb2302 Merge #392: Add testcase which hits additional branch in secp256k1_scalar_sqr
d2ee340 Merge #388: bench_ecdh: fix call to secp256k1_context_create
093a497 Add testcase which hits additional branch in secp256k1_scalar_sqr
a40c701 JNI: Only call ecdsa_verify if its inputs parsed correctly
faa2a11 Update bitcoin-core GitHub links
47b9e78 Cast pointers through uintptr_t under JNI
f36f9c6 bench_ecdh: fix call to secp256k1_context_create
bcc4881 Add some missing `VERIFY_CHECK(ctx != NULL)` for functions that use `ARG_CHECK`
6ceea2c align shared files copyright/comments to bitcoinj's
70141a8 Update .gitignore
7b549b1 Merge #373: build: fix x86_64 asm detection for some compilers
bc7c93c Merge #374: Add note about y=0 being possible on one of the sextic twists
e457018 Merge #364: JNI rebased
86e2d07 JNI library: cleanup, removed unimplemented code
3093576a JNI library
bd2895f Merge pull request #371
e72e93a Add note about y=0 being possible on one of the sextic twists
3f8fdfb build: fix x86_64 asm detection for some compilers
e5a9047 [Trivial] Remove double semicolons
c18b869 Merge pull request #360
3026daa Merge pull request #302
03d4611 Add sage verification script for the group laws
a965937 Merge pull request #361
83221ec Add experimental features to configure
5d4c5a3 Prevent damage_array in the signature test from going out of bounds.
419bf7f Merge pull request #356
03d84a4 Benchmark against OpenSSL verification

git-subtree-dir: src/secp256k1
git-subtree-split: 7a49cacd3937311fcb1cb36b6ba3336fca811991
2016-08-16 11:34:11 +02:00
instagibbs edb6cf1432 remove no-longer-used InitError logic 2016-08-15 10:28:53 -04:00
MarcoFalke 6e5e5abba6
Merge #8270: Tests: Use portable #! in python scripts (/usr/bin/env)
7b01ce2 Favour python over python2 as per PR #7723 (Matthew King)
873e81f Use portable #! in python scripts (/usr/bin/env) (Matthew King)
2016-08-15 15:45:20 +02:00
Jonas Schnelli c503863150
Merge #8192: [trivial] Remove URLs from About dialog translations
208d37f [trivial] Remove URLs from About dialog translations (fanquake)
2016-08-15 15:36:42 +02:00
Pavel Janík b7c349d5e7 Do not shadow variables in networking code 2016-08-15 14:10:07 +02:00
Wladimir J. van der Laan 1030fa718c
Merge #8128: Net: Turn net structures into dumb storage classes
9e9d644 net: fixup nits (Cory Fields)
8945384 net: Have LookupNumeric return a CService directly (Cory Fields)
21ba407 net: narrow include scope after moving to netaddress (Cory Fields)
21e5b96 net: move CNetAddr/CService/CSubNet out of netbase (Cory Fields)
1017b8a net: Add direct tests for new CSubNet constructors (Cory Fields)
b6c3ff3 net: Split resolving out of CSubNet (Cory Fields)
f96c7c4 net: Split resolving out of CService (Cory Fields)
31d6b1d net: Split resolving out of CNetAddr (Cory Fields)
2016-08-15 13:35:27 +02:00
Pieter Wuille d727f77e39
Merge #7946: Reduce cs_main locks during ConnectTip/SyncWithWallets
b3b3c2a Reduce cs_main locks during ConnectTip/SyncWithWallets (Jonas Schnelli)
2016-08-15 11:56:37 +02:00
Jeremy Rubin 8194a6e525 Fix a type error that would not compile on Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) 2016-08-14 20:45:46 -04:00
leijurv 1aacfc2da5
various typos 2016-08-14 07:57:11 -06:00
Sev 6ffd996b8e Corrected JSON typo on setban of net.cpp 2016-08-14 15:36:22 +03:00
Wladimir J. van der Laan 3859072963
Merge #8353: Trivial: tiny c++11 refactors
c784086 use std::map::emplace() instead of std::map::insert() (whythat)
5e187e7 use c++11 std::unique_ptr instead of boost::shared_ptr (whythat)
947913f use std::map::erase(const_iterator, const_iterator) to get non-constant iterator (whythat)
2016-08-13 15:55:09 +02:00
Cory Fields 9e9d644f51 net: fixup nits 2016-08-12 14:22:49 -04:00
Jonas Schnelli b3b3c2a562
Reduce cs_main locks during ConnectTip/SyncWithWallets 2016-08-12 14:53:10 +02:00
Wladimir J. van der Laan 0d0abcac1e
Merge #8481: Qt: Fix minimize and close bugs
05242e9 Fix minimize and close bugs (adlawren)
2016-08-11 15:23:05 +02:00
Andrew Chow 15df3c196b Persist the datadir after option reset
After a reset is performed, the datadir setting is saved and readded to the settings so that it is persisted across option resets.
2016-08-10 15:09:19 -04:00
Wladimir J. van der Laan edebf425a2
Merge #8489: Bugfix: Use pre-BIP141 sigops until segwit activates (GBT)
239cbd2 qa/rpc-tests/segwit: Test GBT sigops before and after activation (Luke Dashjr)
160f895 Bugfix: Use pre-BIP141 sigops until segwit activates (Luke Dashjr)
2016-08-10 09:21:34 +02:00
MarcoFalke fa5d276c90 [init] ParameterInteraction() iff wallet enabled 2016-08-10 08:40:57 +02:00
whythat c784086075 use std::map::emplace() instead of std::map::insert() 2016-08-09 03:11:45 +03:00
whythat 5e187e7001 use c++11 std::unique_ptr instead of boost::shared_ptr 2016-08-09 03:11:45 +03:00
whythat 947913fc54 use std::map::erase(const_iterator, const_iterator) to get non-constant iterator 2016-08-09 03:11:28 +03:00
Luke Dashjr 160f895a80 Bugfix: Use pre-BIP141 sigops until segwit activates 2016-08-08 21:56:32 +00:00
Patrick Strateman 9578333ec4 Remove rpc_wallet_tests.cpp 2016-08-07 19:30:20 -07:00
adlawren 05242e937d Fix minimize and close bugs
refs #8225

To ensure the GUI closes when the "Minimize on close" window option is disabled, and the "Minimize to the tray instead of the taskbar" window option is enbaled, remove a check made against the "Minimize to the tray instead of the taskbar" value, made during GUI closure.

To ensure the GUI minimizes to the taskbar when the "Minimize on close" window option is enabled, and the "Minimize to the tray instead of the taskbar" window option is disabled, minimize the GUI and ignore the closure event.
2016-08-06 23:58:30 -07:00
Pavel Janík 33d15a3a76 Do not shadow LOCK's criticalblock variable for LOCK inside LOCK 2016-08-06 10:54:29 +02:00
Pavel Janík 4a35e0f34c Do not shadow members in dbwrapper 2016-08-05 21:17:50 +02:00
Pavel Janík a159f25e19 Remove redundand (and shadowing) declaration 2016-08-05 20:03:01 +02:00
Michael Rotarius f13c1bae52 Move AdvertiseLocal debug output to net category 2016-08-05 18:34:32 +02:00
Jameson Lopp 65f4532f13 document return value of networkhashps for getmininginfo RPC endpoint 2016-08-05 04:04:07 -04:00
Cory Fields 8945384bca net: Have LookupNumeric return a CService directly
Also fix up a few small issues:
- Lookup with "badip:port" now sets the port to 0
- Don't allow assert to have side-effects
2016-08-04 16:41:39 -04:00
Wladimir J. van der Laan f97d335942
Merge #8392: Fix several node initialization issues
9d4eb9a Do diskspace check before import thread is started (Pieter Wuille)
aa59f2e Add extra message to avoid a long 'Loading banlist' (Pieter Wuille)
0fd2a33 Use a signal to continue init after genesis activation (Pieter Wuille)
2016-08-04 12:33:21 +02:00
Wladimir J. van der Laan 37d83bb0a9
Merge #8391: Consensus: Remove ISM
122786d Consensus: Remove ISM (NicolasDorier)
2016-08-04 12:20:35 +02:00
Pavel Janík cce3024c23 Do not shadow local variable, cleanup 2016-08-03 20:35:29 +02:00
Wladimir J. van der Laan 194110fb91
Merge #8189: rename mapAddrCount to mapNetGroupNodes
657fc19 rename mapAddrCount to mapNetGroupNodes (instagibbs)
2016-08-03 11:50:45 +02:00
Wladimir J. van der Laan ced2d5ef7c
Merge #8446: [Trivial] BIP9 parameters on regtest cleanup
0fc00be Do not shadow previous local variable (Pavel Janík)
115265b Trivial: bip -> BIP in help text and comment (Pavel Janík)
2016-08-03 11:05:29 +02:00
Wladimir J. van der Laan fc93486d2a
Merge #8428: Update README.md inside of src/test/
b8db185 Update README.md (Chris Stewart)
2016-08-03 11:00:30 +02:00
Pavel Janík 0fc00bea5d Do not shadow previous local variable 2016-08-02 10:26:54 +02:00
Pavel Janík 115265bb10 Trivial: bip -> BIP in help text and comment 2016-08-02 10:26:05 +02:00
Wladimir J. van der Laan 63c03dd41c
Merge #8418: Add tests for compact blocks
45c7ddd Add p2p test for BIP 152 (compact blocks) (Suhas Daftuar)
9a22a6c Add support for compactblocks to mininode (Suhas Daftuar)
a8689fd Tests: refactor compact size serialization in mininode (Suhas Daftuar)
9c8593d Implement SipHash in Python (Pieter Wuille)
56c87e9 Allow changing BIP9 parameters on regtest (Suhas Daftuar)
2016-08-02 08:26:57 +02:00
Wladimir J. van der Laan ea268747b6
Merge #8419: Enable size accounting in mining unit tests
8bfd708 Enable size accounting in mining unit tests (Suhas Daftuar)
2016-08-01 10:42:31 +02:00
Pieter Wuille c7e05b35ab
Merge #8432: Make CWallet::fFileBacked private.
29c2d99 Make CWallet::fFileBacked private. (Patrick Strateman)
2016-08-01 02:12:47 +02:00
Pieter Wuille b9c1cd8184
Merge #8152: [Wallet] Remove CWalletDB* parameter from CWallet::AddToWallet
5723bb4 Remove unused pwalletdb from CWallet::AddToWallet (Patrick Strateman)
867f842 Remove CWalletDB* parameter from CWallet::AddToWallet (Patrick Strateman)
00f09c9 Split CWallet::AddToWallet into AddToWallet and LoadToWallet. (Patrick Strateman)
2016-08-01 02:06:42 +02:00
Pieter Wuille 8ea7d31e38
Merge #8413: Trivial: pass Consensus::Params& instead of CChainParams& in ContextualCheckBlock
c8664ee Trivial: pass Consensus::Params& instead of CChainParams& in ContextualCheckBlock (Jorge Timón)
2016-08-01 01:53:29 +02:00
Pieter Wuille f798b891bc
Merge #8346: Mempool: Use Consensus::CheckTxInputs direclty over main::CheckInputs
a6cc299 Mempool: Use Consensus::CheckTxInputs direclty over main::CheckInputs (Jorge Timón)
2016-08-01 00:09:14 +02:00
Pavel Janík ff8d279a78 Do not shadow member variables 2016-07-31 20:55:09 +02:00
Cory Fields 21ba407a73 net: narrow include scope after moving to netaddress
Net functionality is no longer needed for CAddress/CAddrman/etc. now that
CNetAddr/CService/CSubNet are dumb storage classes.
2016-07-31 14:01:44 -04:00
Cory Fields 21e5b96ff4 net: move CNetAddr/CService/CSubNet out of netbase 2016-07-31 14:01:44 -04:00
Cory Fields 1017b8a960 net: Add direct tests for new CSubNet constructors 2016-07-31 14:01:43 -04:00
Cory Fields b6c3ff3dae net: Split resolving out of CSubNet 2016-07-31 14:01:43 -04:00
Chris Stewart b8db185952 Update README.md
Updating documentation for adding new unit test files

Removing unneeded sentence from README

Removing uint160_tests.cpp as it DNE

Formatting command line instructions to use ``

fixing 80 char formatting issue in README

fixing more nits
2016-07-31 12:43:45 -05:00
Cory Fields f96c7c4d91 net: Split resolving out of CService 2016-07-31 13:24:07 -04:00
Cory Fields 31d6b1d5f0 net: Split resolving out of CNetAddr 2016-07-31 13:24:07 -04:00
Patrick Strateman 29c2d99bc9 Make CWallet::fFileBacked private. 2016-07-30 11:27:48 -07:00
Pieter Wuille 9d4eb9ad99 Do diskspace check before import thread is started 2016-07-30 02:17:51 +02:00
Pieter Wuille aa59f2ed3f Add extra message to avoid a long 'Loading banlist' 2016-07-30 02:17:51 +02:00
Pieter Wuille 0fd2a33648 Use a signal to continue init after genesis activation 2016-07-30 02:17:47 +02:00
Patrick Strateman 5723bb44ce Remove unused pwalletdb from CWallet::AddToWallet 2016-07-29 17:04:14 -07:00
Patrick Strateman 867f842f1e Remove CWalletDB* parameter from CWallet::AddToWallet 2016-07-29 17:04:14 -07:00
Patrick Strateman 00f09c920c Split CWallet::AddToWallet into AddToWallet and LoadToWallet.
This removes the fFromLoadWallet flag in AddToWallet.  These were already
effectively two methods.
2016-07-29 17:04:14 -07:00
Wladimir J. van der Laan 5c9e49d12c net: Ignore notfound P2P messages 2016-07-29 17:44:01 +02:00
Pieter Wuille 9c8593d2b4 Implement SipHash in Python 2016-07-29 09:41:58 -04:00
Suhas Daftuar 56c87e9211 Allow changing BIP9 parameters on regtest 2016-07-29 09:41:58 -04:00
Wladimir J. van der Laan 7a2d402727
Merge #8274: util: Update tinyformat
a5072a7 util: Remove zero-argument versions of LogPrint and error (Wladimir J. van der Laan)
695041e util: Update tinyformat (Wladimir J. van der Laan)
2016-07-29 12:32:47 +02:00
Wladimir J. van der Laan b77bb95b3c
Merge #8421: httpserver: drop boost (#8023 dependency)
7e87033 httpserver: replace boost threads with std (Cory Fields)
d3773ca httpserver: explicitly detach worker threads (Cory Fields)
755aa05 httpserver: use a future rather than relying on boost's try_join_for (Cory Fields)
2016-07-29 11:29:00 +02:00
Wladimir J. van der Laan 842bf8d2c5
Merge #8408: Prevent fingerprinting, disk-DoS with compact blocks
1d06e49 Ignore CMPCTBLOCK messages for pruned blocks (Suhas Daftuar)
1de2a46 Ignore GETBLOCKTXN requests for unknown blocks (Suhas Daftuar)
2016-07-29 08:21:03 +02:00
Cory Fields 7e87033447 httpserver: replace boost threads with std
along with mutex/condvar/bind/etc.

httpserver handles its own interruption, so there's no reason not to use std
threading.

While we're at it, may as well kill the BOOST_FOREACH's as well.
2016-07-28 19:08:04 -04:00
Cory Fields d3773ca9ae httpserver: explicitly detach worker threads
When using std::thread in place of boost::thread, letting the threads destruct
results in a std::terminate. According to the docs, the same thing should be
be happening in later boost versions:
http://www.boost.org/doc/libs/1_55_0/doc/html/thread/thread_management.html#thread.thread_management.thread.destructor

I'm unsure why this hasn't blown up already, but explicitly detaching can't
hurt.
2016-07-28 19:07:23 -04:00
Cory Fields 755aa05174 httpserver: use a future rather than relying on boost's try_join_for 2016-07-28 19:07:15 -04:00
Pieter Wuille ad087638ee
Merge #8412: libconsensus: Expose a flag for BIP112
d12b732 libconsensus: Expose a flag for BIP112 (Jorge Timón)
2016-07-29 00:59:02 +02:00
Jorge Timón a6cc299541 Mempool: Use Consensus::CheckTxInputs direclty over main::CheckInputs 2016-07-29 00:48:20 +02:00
Suhas Daftuar 8bfd70817b Enable size accounting in mining unit tests 2016-07-28 14:27:19 -04:00
Wladimir J. van der Laan 133c727cc4
Merge #8321: [trivial] Switched constants to sizeof()
fbc6070 [trivial] Switched constants to sizeof() (Thomas Snider)
2016-07-28 13:54:08 +02:00
Jonas Schnelli 2266b43e33
Port from 0.13: Create a new HD seed after encrypting the wallet
Forward-ports two commits from 0.13:
- [0.13] Create a new HD seed after encrypting the wallet
- [Wallet] Add CKeyMetadata record for HDMasterKey(s), factor out HD key generation

Github-Pull: #8389
Rebased-From: f142c11ac634df487cc4bc65a5f1c9a3e3563dd9 de45c065f0648c4c41b57cb492420ceeed29dd11
2016-07-28 13:22:33 +02:00
Wladimir J. van der Laan 806b9e7570
Merge #8332: semi trivial: clarify witness branches in transaction.h serialization
e37b16a transaction: clarify witness branches (Daniel Cousens)
2016-07-28 13:00:02 +02:00
Wladimir J. van der Laan 30a87c0747
Merge #8407: [Qt] Add dbcache migration path
893f379 [Qt] Add dbcache migration path (Jonas Schnelli)
2016-07-28 11:28:42 +02:00
Jonas Schnelli 893f379ba0
[Qt] Add dbcache migration path 2016-07-28 10:57:24 +02:00
Wladimir J. van der Laan 64d660a43f
Merge #8348: Trivial: Segwit: Don't call IsWitnessEnabled from ContextualCheckBlock
38c4c8b Trivial: Segwit: Don't call IsWitnessEnabled from ContextualCheckBlock (Jorge Timón)
2016-07-28 09:51:04 +02:00
Kaz Wesley d3af342276 prepend license statement to indirectmap
Add statement about MIT licensing to indirectmap.h. I forgot the license
preamble when I originally wrote the file.
2016-07-27 16:27:07 -07:00
Jorge Timón d12b732ac2 libconsensus: Expose a flag for BIP112
We added the segwit one, but we forgot CHECKSEQUENCEVERIFY
2016-07-28 00:23:03 +02:00
Jorge Timón c8664eeac7 Trivial: pass Consensus::Params& instead of CChainParams& in ContextualCheckBlock 2016-07-27 23:58:04 +02:00
Wladimir J. van der Laan 4d4970fe53
Merge #8206: [Wallet] Add HD xpriv to dumpwallet
77c912d [Wallet] add HD xpriv to dumpwallet (Jonas Schnelli)
2016-07-27 15:25:34 +02:00
Jonas Schnelli 77c912d21c
[Wallet] add HD xpriv to dumpwallet 2016-07-27 15:19:23 +02:00
Suhas Daftuar 1d06e49834 Ignore CMPCTBLOCK messages for pruned blocks
Also ignores CMPCTBLOCK announcements that have too little work.  This is to
prevent disk-exhaustion DoS.
2016-07-26 16:52:35 -04:00
Suhas Daftuar 1de2a46632 Ignore GETBLOCKTXN requests for unknown blocks
Don't disconnect peers, or else we leak information that could be
used for fingerprinting.
2016-07-26 16:50:48 -04:00
Wladimir J. van der Laan 4b1a4d8810
Merge #8381: Make witness v0 outputs non-standard
c59c434 qa: Add test for standardness of segwit v0 outputs (Suhas Daftuar)
1ffaff2 Make witness v0 outputs non-standard before segwit activation (Johnson Lau)
2016-07-26 14:24:11 +02:00
Wladimir J. van der Laan 618c9dd8c6
Merge #8365: Treat high-sigop transactions as larger rather than rejecting them
ab942c1 Treat high-sigop transactions as larger rather than rejecting them (Pieter Wuille)
2016-07-26 11:27:30 +02:00
Wladimir J. van der Laan 517eee3e8f
Merge #8362: Scale legacy sigop count in CreateNewBlock
682aa0f Scale legacy sigop count in CreateNewBlock (Suhas Daftuar)
2016-07-25 18:08:09 +02:00
lizhi cc021ef486 remove outdated legacy code
CheckSignatureElement is not used,it be replaced by eccrypto::CheckSignatureElement.
2016-07-24 10:49:07 +08:00
NicolasDorier 122786d0e0 Consensus: Remove ISM 2016-07-23 01:02:53 +09:00
Suhas Daftuar c59c434b7d qa: Add test for standardness of segwit v0 outputs 2016-07-23 00:01:02 +08:00
Johnson Lau 1ffaff2f74 Make witness v0 outputs non-standard before segwit activation 2016-07-22 06:35:07 +00:00
Jonas Schnelli b50e1ac298
[Wallet] Correct hdmasterkeyid/masterkeyid name confusion 2016-07-21 21:58:12 +02:00
Wladimir J. van der Laan 381917f610
Merge #8347: Trivial: Make CBlockIndex param const in ContextualCheckBlockHeader and ContextualCheckBlock
6f3d616 Trivial: Make CBlockIndex param const in ContextualCheckBlockHeader and ContextualCheckBlock (Jorge Timón)
2016-07-21 14:31:40 +02:00
NicolasDorier 7821889bce Consensus: Remove calls to error() from ContextualCheckBlock 2016-07-21 20:57:08 +09:00
Wladimir J. van der Laan 6f4092da80
Merge #8342: Consensus: Trivial transform BOOST_FOREACH into for loop
a3e1984 Consensus: Trivial transform BOOST_FOREACH into for loop (NicolasDorier)
2016-07-21 11:56:33 +02:00
fanquake 208d37f116
[trivial] Remove URLs from About dialog translations 2016-07-21 16:21:08 +08:00
Jonas Schnelli 2f32c82b3d
[Qt] show network/chain errors in the GUI 2016-07-20 14:42:19 +02:00
Patrick Strateman 6523fcaab2 Move SetMinVersion for FEATURE_HD to SetHDMasterKey 2016-07-19 22:30:17 -07:00
Pieter Wuille ab942c15bd Treat high-sigop transactions as larger rather than rejecting them 2016-07-19 12:31:49 +02:00
Wladimir J. van der Laan 045106b4f1
Merge #8367: [Wallet] Ensure <0.13 clients can't open HD wallets
a4f137f [Wallet] Ensure <0.13 clients can't open HD wallets (Jonas Schnelli)
2016-07-19 12:13:12 +02:00
Thomas Snider fbc60703a5 [trivial] Switched constants to sizeof() 2016-07-18 19:42:09 -07:00
Jonas Schnelli a4f137f367
[Wallet] Ensure <0.13 clients can't open HD wallets 2016-07-18 22:56:45 +02:00
Suhas Daftuar 2c06bae39e Rename "block cost" to "block weight" 2016-07-18 13:28:26 -04:00
Suhas Daftuar 682aa0f289 Scale legacy sigop count in CreateNewBlock 2016-07-18 12:42:41 -04:00
Wladimir J. van der Laan 6c0336c772
build: bump version to 0.13.99
Now that 0.13 branch has been split off, master is 0.13.99 (pre-0.14).
2016-07-18 12:22:18 +02:00
Wladimir J. van der Laan e4382fbef5
qt: periodic translations update 2016-07-18 12:13:08 +02:00
Wladimir J. van der Laan 8cef5bd58a mining: Improve -blockmaxcost help message
One-word replacement to #8354.
2016-07-18 10:56:25 +02:00
Wladimir J. van der Laan f5660d381a
Merge #8295: Mining-related fixups for 0.13.0
c1d61fb Add warning if -blockminsize is used. (Suhas Daftuar)
27362dd Remove -blockminsize option (Suhas Daftuar)
d2e46e1 Remove addScoreTxs() (Suhas Daftuar)
6dd4bc2 Exclude witness transactions in addPackageTxs() pre-segwit activation (Suhas Daftuar)
f15c2cd CreateNewBlock: add support for size-accounting to addPackageTxs (Suhas Daftuar)
2016-07-18 08:23:45 +02:00
Wladimir J. van der Laan 238300b398
Merge #8323: Add HD keypath to CKeyMetadata, report metadata in validateaddress
7945088 [Wallet] comsetic non-code changes for the HD feature (Jonas Schnelli)
68d7682 [Wallet] ensure CKeyMetadata.hdMasterKeyID will be cleared during SetNull() (Jonas Schnelli)
f708085 [QA] extend wallet-hd test to cover HD metadata (Jonas Schnelli)
986c223 [Wallet] print hd masterkeyid in getwalletinfo (Jonas Schnelli)
b1c7b24 [Wallet] report optional HDKeypath/HDMasterKeyId in validateaddress (Jonas Schnelli)
5b95dd2 [Wallet] extend CKeyMetadata with HD keypath (Jonas Schnelli)
2016-07-18 07:58:33 +02:00
Wladimir J. van der Laan 37303934fe
Merge #8305: Improve handling of unconnecting headers
e91cf4b Add test for handling of unconnecting headers (Suhas Daftuar)
96fa953 Improve handling of unconnecting headers (Suhas Daftuar)
2016-07-18 07:46:12 +02:00
Jorge Timón 38c4c8b701 Trivial: Segwit: Don't call IsWitnessEnabled from ContextualCheckBlock 2016-07-17 02:41:58 +02:00
Jorge Timón 6f3d616dc8 Trivial: Make CBlockIndex param const in ContextualCheckBlockHeader and ContextualCheckBlock 2016-07-17 01:43:15 +02:00
NicolasDorier a3e1984651 Consensus: Trivial transform BOOST_FOREACH into for loop 2016-07-16 11:08:52 +09:00
Jonas Schnelli 7945088d41
[Wallet] comsetic non-code changes for the HD feature 2016-07-15 10:34:08 +02:00
Jonas Schnelli 68d7682b9f
[Wallet] ensure CKeyMetadata.hdMasterKeyID will be cleared during SetNull() 2016-07-15 10:33:25 +02:00
Wladimir J. van der Laan bc94b87487
Merge #8324: [Wallet] keep HD seed during salvagewallet
b993671 [Wallet] keep HD seed during salvagewallet (Jonas Schnelli)
2016-07-14 11:37:48 +02:00
Wladimir J. van der Laan ca40ef6029
Merge #8312: Fix mempool DoS vulnerability from malleated transactions
46c9620 Test that unnecessary witnesses can't be used for mempool DoS (Suhas Daftuar)
bb66a11 Fix DoS vulnerability in mempool acceptance (Suhas Daftuar)
2016-07-14 08:21:13 +02:00
Wladimir J. van der Laan 4324bd237c
Merge #8311: Rename CTxinWitness -> CTxInWitness
36ae37a Rename CTxinWitness -> CTxInWitness (Bob McElrath)
2016-07-14 08:18:38 +02:00
Wladimir J. van der Laan 1bc9c8085f
Merge #8271: [bugfix] Do not send witnesses in cmpctblock
252675e Do not send witnesses in cmpctblock (Pieter Wuille)
2016-07-14 08:17:22 +02:00
Daniel Cousens e37b16a75c transaction: clarify witness branches 2016-07-14 13:40:50 +10:00
Suhas Daftuar 96fa95361f Improve handling of unconnecting headers
When processing a headers message that looks like a block announcement,
send peer a getheaders if the headers message won't connect.

Apply DoS points after too many consecutive unconnecting headers messages.
2016-07-12 13:12:40 -04:00
Wladimir J. van der Laan 4831a16223
qt: periodic translation update
Added languages:
- `bg_BG`: Bulgarian (Bulgaria)
2016-07-12 11:40:33 +02:00
Jonas Schnelli b993671921
[Wallet] keep HD seed during salvagewallet 2016-07-09 12:58:03 +02:00
Jonas Schnelli 986c223214
[Wallet] print hd masterkeyid in getwalletinfo 2016-07-09 12:12:36 +02:00
Jonas Schnelli b1c7b244e2
[Wallet] report optional HDKeypath/HDMasterKeyId in validateaddress 2016-07-09 12:12:32 +02:00
Jonas Schnelli 5b95dd2c25
[Wallet] extend CKeyMetadata with HD keypath 2016-07-09 11:52:17 +02:00
MarcoFalke 477777f250 [rpcwallet] Don't use floating point 2016-07-08 12:01:25 +02:00
Wladimir J. van der Laan ff46dd4a34
Merge #7540: Rename OP_NOP3 to OP_CHECKSEQUENCEVERIFY
18c975c Rename NOP3 to CHECSEQUENCEVERIFY in rpc tests (BtcDrak)
14d0130 Rename OP_NOP3 to OP_CHECKSEQUENCEVERIFY (BtcDrak)
2016-07-08 11:39:10 +02:00
Suhas Daftuar bb66a11396 Fix DoS vulnerability in mempool acceptance
Moves the IsStandard check to happen after the premature-witness check,
so that adding a witness to a transaction can't prevent mempool acceptance.

Note that this doesn't address the broader category of potential mempool DoS
issues that affect transactions after segwit activation.
2016-07-07 15:49:26 -04:00
Bob McElrath 36ae37a9f9 Rename CTxinWitness -> CTxInWitness 2016-07-06 19:46:46 -04:00
Jonas Schnelli 91abb77970
Merge #8288: qt: Network-specific example address
4f44cb6 qt: Network-specific example address (Wladimir J. van der Laan)
2016-07-06 15:45:17 +02:00
Wladimir J. van der Laan b978701ba1
qt: periodic translations update 2016-07-06 07:59:07 +02:00
Wladimir J. van der Laan 396f9d6296
Merge #8273: Bump -dbcache default to 300MiB
efd1d83 doc: Mention dbcache increase in release notes (Wladimir J. van der Laan)
32cab91 Bump `-dbcache` default to 300MiB (Wladimir J. van der Laan)
2016-07-06 07:46:47 +02:00
Wladimir J. van der Laan 32cab91278 Bump -dbcache default to 300MiB
Also cap the allocation for the leveldb-specific cache for the UTXO set
to 8MiB.
This avoids that the extra cache memory goes to the much less effective
leveldb cache instead of our application-level cache.
2016-07-06 07:44:51 +02:00
Wladimir J. van der Laan 042c323922
Merge #8275: Remove bad chain alert partition check
ab8be98 Remove bad chain alert partition check (BtcDrak)
2016-07-06 07:35:54 +02:00
Wladimir J. van der Laan aef381161f
Merge #8298: wallet: Revert input selection post-pruning
20f3cd7 wallet: Revert input selection post-pruning (Wladimir J. van der Laan)
2016-07-06 07:21:40 +02:00
Suhas Daftuar c1d61fbd08 Add warning if -blockminsize is used. 2016-07-05 19:57:45 -04:00
Gregory Maxwell 4fbdc4365b Revert "net: Avoid duplicate getheaders requests." PR #8054
This reverts commit f93c2a1b7e.

This can cause synchronization to get stuck.
2016-07-05 20:45:14 +00:00
MarcoFalke 33336e1aac [util] CopyrightHolders: Check for untranslated substitution
Also, remove check which is always true
2016-07-02 10:46:26 +02:00
Wladimir J. van der Laan 20f3cd75f6 wallet: Revert input selection post-pruning
This reverts PR #4906, "Coinselection prunes extraneous inputs from
ApproximateBestSubset".

Apparently the previous behavior of slightly over-estimating the set of
inputs was useful in cleaning up UTXOs.

See also #7664, #7657, as well as 2016-07-01 discussion on #bitcoin-core-dev IRC.
2016-07-01 13:26:01 +02:00
Suhas Daftuar 27362dda4d Remove -blockminsize option 2016-06-30 11:41:13 -04:00
Suhas Daftuar d2e46e1b5c Remove addScoreTxs() 2016-06-30 11:37:38 -04:00
Suhas Daftuar 6dd4bc289c Exclude witness transactions in addPackageTxs() pre-segwit activation 2016-06-30 11:24:32 -04:00
Wladimir J. van der Laan 975a41dcc2 windows: Add testnet icon for testnet link
Overhauled testnet icon by Jonas Schnelli
2016-06-30 17:17:58 +02:00
Wladimir J. van der Laan 4f44cb616d qt: Network-specific example address
Generate an (invalid) example address for in the bitcoin address
widgets, based on the network prefix, instead of hardcoding a mainnet
address.

- `1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L` for mainnet (same as now)
- `n2wxQmfexkjwEPgdD6iJA7T7RtzkmHxhFc` for testnet
2016-06-29 17:35:54 +02:00
Wladimir J. van der Laan a7897c02f7 qt: Remove client name from debug window
Remove the client name from the debug window in the GUI. It is already
part of the user agent, so adding it separately doesn't add anything.
2016-06-28 18:27:49 +02:00
BtcDrak 14d01309be Rename OP_NOP3 to OP_CHECKSEQUENCEVERIFY 2016-06-28 17:17:36 +01:00
Wladimir J. van der Laan 3685e0c1da
Merge #8261: The bit field is shown only when status is "started"
2129fce The bit field is shown only when status is "started" (Pavel Janík)
2016-06-28 16:06:40 +02:00
Wladimir J. van der Laan 3b2dadc8d5
qt: Periodic translations update 2016-06-28 11:49:38 +02:00
Pavel Janík 2129fcea69 The bit field is shown only when status is "started" 2016-06-28 10:25:27 +02:00
Wladimir J. van der Laan ff03c50c00
Merge #8257: Do not ask a UI question from bitcoind
1acf1db Do not ask a UI question from bitcoind (Pieter Wuille)
2016-06-28 10:12:01 +02:00
Wladimir J. van der Laan a5072a7730 util: Remove zero-argument versions of LogPrint and error
Changes in tinyformat, recently imported from upstream have made the
zero-argument versions of formatting functions unnecessary. Remove them.

This is a slight semantic change: `%` characters in the zero-argument
call are now regarded and need to be escaped. As for as I know, the only
use of this is in `main.cpp`.
2016-06-27 18:39:25 +02:00
Wladimir J. van der Laan 695041e495 util: Update tinyformat
Updates `tinyformat.h` to commit
3a33bbf654 upstream.

Makes sure that our local changes are kept:

- #3767 1b8fd35aad Make tinyformat errors raise an exception instead of assert()ing
- #4735 9b6d4c5cdc Move strprintf define to tinyformat.h
- #4748 6e5fd003e0 include stdexcept (for std::exception)
- #8000 9eaa0afa6e force USE_VARIADIC_TEMPLATES
- Add `std::string format(const std::string &fmt...` added this
  at the time, as we want to be able to do `strprintf(_(...), ...)`

Inspired by #8264.
2016-06-27 18:17:27 +02:00
Suhas Daftuar f15c2cde45 CreateNewBlock: add support for size-accounting to addPackageTxs
Includes a change to not continue to use size-accounting in addScoreTxs
or addPackageTxs just because addPriorityTxs() is used.
2016-06-27 10:58:58 -04:00
Wladimir J. van der Laan 5a06ebbf2d
Merge #8258: RPC: Hide softfork if timeout is 0
409f833 RPC: Hide softfork if timeout is 0 (jl2012)
2016-06-27 16:07:50 +02:00
Pieter Wuille 252675efc6 Do not send witnesses in cmpctblock 2016-06-26 20:19:00 +02:00
Matthew King 873e81f89b Use portable #! in python scripts (/usr/bin/env) 2016-06-26 16:47:03 +03:00
Wladimir J. van der Laan 1922e5a654
Merge #8244: remove unnecessary LOCK(cs_main) in getrawpmempool
27f8126 remove unnecessary LOCK(cs_main) (Daniel Cousens)
2016-06-25 16:10:10 +02:00
jl2012 409f83322e RPC: Hide softfork if timeout is 0 2016-06-25 00:55:07 +08:00
Wladimir J. van der Laan d612837814
Merge #8149: Segregated witness rebased
f852813 BIP9 parameters for testnet (Johnson Lau)
070dbc4 --- [SEGWIT] begin: deployment --- (Pieter Wuille)
fdb43df [qa] Add GetTransactionSigOpCost unit tests (Jonas Nick)
d846e02 [qa] script_tests: witness tests can specify tx amount (Suhas Daftuar)
330b0f3 [qa] p2p segwit tests (Suhas Daftuar)
4f7ff00 [qa] Add rpc test for segwit (Alex Morcos)
66cca79 [qa] Autogeneration support for witness in script_tests (Pieter Wuille)
06d3805 [qa] Add segwit support to script_tests (Pieter Wuille)
00f46cb [qa] Add transaction tests for segwit (NicolasDorier)
0aa9207 [qa] Witness version 0 signing unit tests (Pieter Wuille)
978e200 --- [SEGWIT] begin: tests --- (Pieter Wuille)
745eb67 [RPC] signrawtransaction can sign P2WSH (NicolasDorier)
f4691ab [RPC] Add wallet support for witness transactions (using P2SH) (Pieter Wuille)
605e847 BIP143: Signing logic (Pieter Wuille)
9757b57 --- [SEGWIT] begin: wallet --- (Pieter Wuille)
af87a67 Do not use compact blocks when segwit is enabled (Pieter Wuille)
6032f69 Add rewind logic to deal with post-fork software updates (Pieter Wuille)
b7dbeb2 [libconsensus] Script verification API with amounts (Thomas Kerin)
2b1f6f9 BIP141: Other consensus critical limits, and BIP145 (Pieter Wuille)
7c4bf77 [RPC] Return witness data in blockchain RPCs (Johnson Lau)
3dd4102 BIP143: Verification logic (Pieter Wuille)
0ef1dd3 Refactor script validation to observe amounts (Pieter Wuille)
b8a9749 BIP144: Handshake and relay (receiver side) (Pieter Wuille)
8b49040 BIP141: Commitment structure and deployment (Pieter Wuille)
449f9b8 BIP141: Witness program (Pieter Wuille)
7030d9e BIP144: Serialization, hashes, relay (sender side) (Pieter Wuille)
ecacfd9 --- [SEGWIT] begin: P2P/node/consensus --- (Pieter Wuille)
2016-06-24 18:07:44 +02:00
Pieter Wuille 1acf1db76f Do not ask a UI question from bitcoind 2016-06-24 16:45:12 +02:00
Wladimir J. van der Laan af2421c291
Merge #8256: BUG: bitcoin-qt crash
d7828ab check that transactionView->selectionModel()->selectedRows(0) exists (fsb4000)
2016-06-24 13:48:16 +02:00
fsb4000 d7828abd5b check that transactionView->selectionModel()->selectedRows(0) exists 2016-06-24 18:08:32 +07:00
Pieter Wuille 133deb83df Mark my dnsseed as supporting filtering 2016-06-23 15:44:35 +02:00
Wladimir J. van der Laan 08338942b5
Merge #8204: Update petertodd's testnet seed
d80efec Update petertodd's testnet seed (Peter Todd)
2016-06-23 13:04:42 +02:00
Wladimir J. van der Laan a1c92c29fd trivial: capitalize BIP32 in option help
For consistency, BIP32 should be in uppercase in translation message.

Reported by @pryds on Transifex.
2016-06-23 10:44:36 +00:00
Daniel Cousens 27f8126ff3 remove unnecessary LOCK(cs_main) 2016-06-23 12:44:53 +10:00
Johnson Lau f8528134fc BIP9 parameters for testnet 2016-06-22 15:43:02 +02:00
Jonas Nick fdb43df23e [qa] Add GetTransactionSigOpCost unit tests 2016-06-22 15:43:02 +02:00
Suhas Daftuar d846e02372 [qa] script_tests: witness tests can specify tx amount
Add tests that witness signatures cover value
2016-06-22 15:43:02 +02:00
Suhas Daftuar 330b0f31ee [qa] p2p segwit tests
mininode now supports witness transactions/blocks, blocktools
has a helper for adding witness commitments to blocks, and script
has a function to calculate hashes for signature under sigversion
1, used by segwit.

Py3 conversion by Marco Falke

Test to make sure upgraded nodes don't ask for non-wit blocks by
Gregory Sanders.
2016-06-22 15:43:02 +02:00
Alex Morcos 4f7ff00497 [qa] Add rpc test for segwit
Amended by Pieter Wuille to use multisig 1-of-1 for P2WSH tests, and BIP9
based switchover logic.

Fixes and py3 conversion by Marco Falke.
2016-06-22 15:43:01 +02:00
Pieter Wuille 66cca79130 [qa] Autogeneration support for witness in script_tests 2016-06-22 15:43:01 +02:00
Pieter Wuille 06d3805c1a [qa] Add segwit support to script_tests
Contains fix by Johnson Lau.
2016-06-22 15:43:01 +02:00
NicolasDorier 00f46cbcd9 [qa] Add transaction tests for segwit
Including BIP143 P2WSH examples by jl2012.
2016-06-22 15:43:01 +02:00
Pieter Wuille 0aa9207451 [qa] Witness version 0 signing unit tests 2016-06-22 15:43:01 +02:00
NicolasDorier 745eb678ef [RPC] signrawtransaction can sign P2WSH 2016-06-22 15:43:01 +02:00
Pieter Wuille f4691ab3a9 [RPC] Add wallet support for witness transactions (using P2SH)
Includes support for pushkeyhash wit v0 by Alex Morcos.
2016-06-22 15:43:01 +02:00
Pieter Wuille 605e8473a7 BIP143: Signing logic 2016-06-22 15:43:01 +02:00
Pieter Wuille af87a67eff Do not use compact blocks when segwit is enabled 2016-06-22 15:43:00 +02:00
Pieter Wuille 6032f6930a Add rewind logic to deal with post-fork software updates
Includes logic for dealing with pruning by Suhas Daftuar.
2016-06-22 15:43:00 +02:00
Thomas Kerin b7dbeb24eb [libconsensus] Script verification API with amounts
script_tests: always test bitcoinconsensus_verify_script_with_amount if VERIFY_WITNESS isn't set

Rename internal method + make it static

trim bitcoinconsensus_ prefix

Add SERIALIZE_TRANSACTION_WITNESS flag
2016-06-22 15:43:00 +02:00
Pieter Wuille 2b1f6f9ccf BIP141: Other consensus critical limits, and BIP145
Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
2016-06-22 15:43:00 +02:00
Johnson Lau 7c4bf779e8 [RPC] Return witness data in blockchain RPCs
Includes RPC field name changes by Luke-jr.
2016-06-22 15:43:00 +02:00
Pieter Wuille 3dd410294d BIP143: Verification logic
Includes simplifications by Eric Lombrozo.
2016-06-22 15:43:00 +02:00
Pieter Wuille 0ef1dd3e11 Refactor script validation to observe amounts
This is a preparation for BIP143 support.
2016-06-22 15:43:00 +02:00
Pieter Wuille b8a97498df BIP144: Handshake and relay (receiver side)
Service bit logic by Nicolas Dorier.

Only download blocks from witness peers after fork.
2016-06-22 15:42:59 +02:00
Pieter Wuille 8b49040854 BIP141: Commitment structure and deployment
Includes a fix by Suhas Daftuar and LongShao007
2016-06-22 15:42:59 +02:00
Pieter Wuille 449f9b8deb BIP141: Witness program 2016-06-22 15:42:59 +02:00
Pieter Wuille 7030d9eb47 BIP144: Serialization, hashes, relay (sender side)
Contains refactorings by Eric Lombrozo.
Contains fixup by Nicolas Dorier.
Contains cleanup of CInv::GetCommand by Alex Morcos
2016-06-22 15:42:59 +02:00
Wladimir J. van der Laan e9d76a161d
Merge #8068: Compact Blocks
48efec8 Fix some minor compact block issues that came up in review (Matt Corallo)
ccd06b9 Elaborate bucket size math (Pieter Wuille)
0d4cb48 Use vTxHashes to optimize InitData significantly (Matt Corallo)
8119026 Provide a flat list of txid/terators to txn in CTxMemPool (Matt Corallo)
678ee97 Add BIP 152 to implemented BIPs list (Matt Corallo)
56ba516 Add reconstruction debug logging (Matt Corallo)
2f34a2e Get our "best three" peers to announce blocks using cmpctblocks (Matt Corallo)
927f8ee Add ability to fetch CNode by NodeId (Matt Corallo)
d25cd3e Add receiver-side protocol implementation for CMPCTBLOCK stuff (Matt Corallo)
9c837d5 Add sender-side protocol implementation for CMPCTBLOCK stuff (Matt Corallo)
00c4078 Add protocol messages for short-ids blocks (Matt Corallo)
e3b2222 Add some blockencodings tests (Matt Corallo)
f4f8f14 Add TestMemPoolEntryHelper::FromTx version for CTransaction (Matt Corallo)
85ad31e Add partial-block block encodings API (Matt Corallo)
5249dac Add COMPACTSIZE wrapper similar to VARINT for serialization (Matt Corallo)
cbda71c Move context-required checks from CheckBlockHeader to Contextual... (Matt Corallo)
7c29ec9 If AcceptBlockHeader returns true, pindex will be set. (Matt Corallo)
96806c3 Stop trimming when mapTx is empty (Pieter Wuille)
2016-06-22 14:30:38 +02:00
Wladimir J. van der Laan 9e45ef1ef0
Merge #8234: qt: Periodic transifex update
4cbe05b qt: Periodic transifex update (Wladimir J. van der Laan)
2016-06-22 08:52:06 +02:00
Wladimir J. van der Laan 760a6c7cb2
Merge #8231: [Qt] fix a bug where the SplashScreen will not be hidden during startup
b3e1348 [Qt] fix a bug where the SplashScreen will not be hidden during startup (Jonas Schnelli)
2016-06-22 08:50:14 +02:00
Wladimir J. van der Laan 961893f26e
Merge #8222: Enable mempool consistency checks in unit tests
3775ff9 Enable mempool consistency checks in unit tests (Pieter Wuille)
2016-06-22 08:48:37 +02:00
Matt Corallo 48efec82f3 Fix some minor compact block issues that came up in review 2016-06-21 16:09:46 -07:00
Wladimir J. van der Laan 4cbe05bf20 qt: Periodic transifex update
Pulls in the following new languages:

- `af` Afrikaans
- `es_419` Spanish (Latin America)
- `es_AR` Spanish (Argentina)
- `es_CO` Spanish (Colombia)
- `fil` Filipino
- `it_IT` Italian (Italy)
- `ro` Romanian
- `sr@latin` Serbian (Latin)
- `ta` Tamil
- `uz@Latn` Uzbek (Latin)
- `zh_HK` Chinese (Hong Kong)
2016-06-21 15:32:07 +02:00
Jonas Schnelli b3e1348c46
[Qt] fix a bug where the SplashScreen will not be hidden during startup 2016-06-21 11:35:29 +02:00
TheLazieR Yip bf9c70b100
Fix LogPrint to LogPrintf
Printing Log without category defined should use LogPrintf

Github-Pull: #8230
Meta: PR should have been based on master in the first place
2016-06-21 10:21:42 +02:00
Wladimir J. van der Laan 1f86d64f6d
Merge #8220: Stop trimming when mapTx is empty
ad0752e Stop trimming when mapTx is empty (Pieter Wuille)
2016-06-20 15:21:27 +02:00
Wladimir J. van der Laan 94ab58b5cc
Merge #8179: Evict orphans which are included or precluded by accepted blocks.
54326a6 Increase maximum orphan size to 100,000 bytes. (Gregory Maxwell)
8c99d1b Treat orphans as implicit inv for parents, discard when parents rejected. (Gregory Maxwell)
11cc143 Adds an expiration time for orphan tx. (Gregory Maxwell)
db0ffe8 This eliminates the primary leak that causes the orphan map to  always grow to its maximum size. (Gregory Maxwell)
1b0bcc5 Track orphan by prev COutPoint rather than prev hash (Pieter Wuille)
2016-06-20 14:53:33 +02:00
Wladimir J. van der Laan a6ddb19bd9
Merge #7687: Stop treating importaddress'ed scripts as change
595b22e Stop treating importaddress'ed scripts as change (Pieter Wuille)
2016-06-20 14:09:49 +02:00
Wladimir J. van der Laan 12a541e8da
Merge #8210: [Qt] Bump to Qt5.6.1
2759597 Only pass -lQt5PlatformSupport if >=Qt5.6 (Jonas Schnelli)
59d063d Use runtime linking of QT libdbus, use custom/temp. SDK URL (Jonas Schnelli)
6194d9a Fix bitcoin_qt.m4 and fix-xcb-include-order.patch (Jonas Schnelli)
f6eb4e2 [depends] OpenSSL 1.0.1k - update config_opts (fanquake)
f25209a depends: bump OSX toolchain (Cory Fields)
2016-06-20 13:33:41 +02:00
Jonas Schnelli 2759597bc8
Only pass -lQt5PlatformSupport if >=Qt5.6 2016-06-20 10:17:01 +02:00
Pieter Wuille ccd06b94f6 Elaborate bucket size math 2016-06-19 23:06:55 -07:00
Matt Corallo 0d4cb48ef1 Use vTxHashes to optimize InitData significantly 2016-06-19 23:06:55 -07:00
Matt Corallo 811902649d Provide a flat list of txid/terators to txn in CTxMemPool 2016-06-19 23:06:55 -07:00
Matt Corallo 56ba516727 Add reconstruction debug logging 2016-06-19 23:06:55 -07:00
Matt Corallo 2f34a2e476 Get our "best three" peers to announce blocks using cmpctblocks 2016-06-19 23:06:55 -07:00
Matt Corallo 927f8eede0 Add ability to fetch CNode by NodeId 2016-06-19 23:06:55 -07:00
Matt Corallo d25cd3ec4e Add receiver-side protocol implementation for CMPCTBLOCK stuff 2016-06-19 23:06:55 -07:00
Matt Corallo 9c837d5468 Add sender-side protocol implementation for CMPCTBLOCK stuff 2016-06-19 01:34:58 -07:00
Matt Corallo 00c40784fe Add protocol messages for short-ids blocks 2016-06-19 01:34:57 -07:00
Matt Corallo e3b2222144 Add some blockencodings tests 2016-06-19 01:34:57 -07:00
Matt Corallo f4f8f14adc Add TestMemPoolEntryHelper::FromTx version for CTransaction 2016-06-19 01:34:57 -07:00
Matt Corallo 85ad31ede7 Add partial-block block encodings API 2016-06-19 01:34:57 -07:00
Matt Corallo 5249daca5a Add COMPACTSIZE wrapper similar to VARINT for serialization 2016-06-19 01:34:57 -07:00
Matt Corallo cbda71cf04 Move context-required checks from CheckBlockHeader to Contextual... 2016-06-19 01:34:57 -07:00
Matt Corallo 7c29ec9449 If AcceptBlockHeader returns true, pindex will be set.
Assert this instead of checking (and then dref'ing later anyway)
to make sure no one thinks they can change that postcondition of
AcceptBlockHeader..
2016-06-19 01:34:57 -07:00
Pieter Wuille 96806c39f4 Stop trimming when mapTx is empty 2016-06-19 01:34:57 -07:00
Daniel Kraft 9fce0629b4 [c++11] Use std::unique_ptr for block creation.
CreateNewBlock returns a pointer for which the caller takes ownership.
Use std::unique_ptr to make this explicit and simplify handling of these
objects in getblocktemplate.
2016-06-18 19:38:28 +02:00
Pieter Wuille 3775ff9ea7 Enable mempool consistency checks in unit tests 2016-06-18 19:15:03 +02:00
Pieter Wuille ad0752e41f Stop trimming when mapTx is empty 2016-06-18 18:50:40 +02:00
MarcoFalke faa91b12f7 [wallet] tests: Don't use floating point 2016-06-17 13:07:38 +02:00
Pieter Wuille 66db2d62d5
Merge #7600: Mining: Select transactions using feerate-with-ancestors
29fac19 Add unit tests for ancestor feerate mining (Suhas Daftuar)
c82a4e9 Use ancestor-feerate based transaction selection for mining (Suhas Daftuar)
2016-06-16 19:20:13 +02:00
Suhas Daftuar 29fac19c93 Add unit tests for ancestor feerate mining 2016-06-16 12:35:37 -04:00
Suhas Daftuar c82a4e9a63 Use ancestor-feerate based transaction selection for mining
Includes changes by Pieter Wuille
2016-06-16 12:35:37 -04:00
Wladimir J. van der Laan 9c3d0fab36
Merge #7892: Add full UTF-8 support to RPC
7982fce doc: Mention full UTF-8 support in release notes (Wladimir J. van der Laan)
6bbb4ef test: test utf-8 for labels in wallet (Wladimir J. van der Laan)
a406fcb test: add ensure_ascii setting to AuthServiceProxy (Wladimir J. van der Laan)
60ab9b2 Squashed 'src/univalue/' changes from 2740c4f..f32df99 (Wladimir J. van der Laan)
2016-06-16 12:08:35 +02:00
Wladimir J. van der Laan 3f89a534ac
Merge #8113: Rework addnode behaviour
1a5a4e6 Randomize name lookup result in ConnectSocketByName (Pieter Wuille)
f9f5cfc Prevent duplicate connections where one is by name and another by ip (Pieter Wuille)
1111b80 Rework addnode behaviour (Pieter Wuille)
2016-06-16 12:06:51 +02:00
Wladimir J. van der Laan 62fcf27bd8
Merge #8171: [RPC] Fix createrawtx sequence number unsigned int parsing
6fa950a [RPC] Fix createrawtx sequence number unsigned int parsing (Jonas Schnelli)
2016-06-16 11:06:51 +02:00
Wladimir J. van der Laan e4bb4a85a5
Merge #8084: Add recently accepted blocks and txn to AttemptToEvictConnection.
6ee7f05 Allow disconnecting a netgroup with only one member in eviction. (Gregory Maxwell)
5d0ca81 Add recently accepted blocks and txn to AttemptToEvictConnection. (Gregory Maxwell)
2016-06-16 11:03:52 +02:00
Wladimir J. van der Laan 0a64777b90
Merge #8208: Do not set extra flags for unfiltered DNS seed results
bc0a895 Do not set extra flags for unfiltered DNS seed results (Pieter Wuille)
2016-06-16 10:57:59 +02:00
Wladimir J. van der Laan f7a403b4cf
Merge #8207: [trivial] Add a link to the Bitcoin-Core repository and website to the About Dialog
fa58e5e [doc] Add website links to about dialog (MarcoFalke)
2016-06-16 10:56:20 +02:00
MarcoFalke fa58e5ee93 [doc] Add website links to about dialog 2016-06-16 10:07:36 +02:00
Gregory Maxwell 6ee7f05622 Allow disconnecting a netgroup with only one member in eviction.
With the latest additions there are enough protective measures that
 we can take the training wheels off.
2016-06-15 20:19:13 +00:00
Gregory Maxwell 5d0ca81f74 Add recently accepted blocks and txn to AttemptToEvictConnection.
This protects any not-already-protected peers who were the most
 recent four to relay transactions and most recent four to send
 blocks to us.
2016-06-15 20:19:07 +00:00
Pieter Wuille bc0a895d81 Do not set extra flags for unfiltered DNS seed results 2016-06-15 19:31:58 +02:00
Gregory Maxwell 54326a6808 Increase maximum orphan size to 100,000 bytes.
Although this increases node memory usage in the worst case by perhaps
 30MB, the current behavior causes severe issues with dependent tx relay.
2016-06-15 09:56:42 +00:00
Gregory Maxwell 8c99d1b525 Treat orphans as implicit inv for parents, discard when parents rejected.
An orphan whos parents were rejected is never going to connect, so there
 is little utility in keeping it.

Orphans also helpfully tell us what we're missing, so go ahead and treat
 it as INVed.
2016-06-15 09:56:37 +00:00
Gregory Maxwell 11cc143895 Adds an expiration time for orphan tx.
This prevents higher order orphans and other junk from
 holding positions in the orphan map.  Parents delayed
 twenty minutes are more are unlikely to ever arrive.

The freed space will improve the orphan matching success rate for
 other transactions.
2016-06-15 09:56:28 +00:00
Peter Todd d80efec327
Update petertodd's testnet seed
New seed with servicebit filtering support.
2016-06-15 00:11:39 -04:00
BtcDrak ab8be98fdb Remove bad chain alert partition check
As per meeting 2016-03-31
https://bitcoincore.org/en/meetings/2016/03/31/#bad-chain-alerts

The partition checker was producing huge number of false-positives
and was disabled in 0.12.1 on the understanding it would either be
fixed in 0.13 or removed entirely from master if not.
2016-06-14 12:26:59 +01:00
Jonas Schnelli fb0ac482ee
Merge #7636: Add bitcoin address label to request payment QR code
1c2a1ba Add address label to request payment QR Code (QT) (Francesco 'makevoid' Canessa)
2016-06-14 13:17:44 +02:00
Wladimir J. van der Laan b67a4726df
Merge #8035: [Wallet] Add simplest BIP32/deterministic key generation implementation
afcd77e Detect -usehd mismatches when wallet.dat already exists (Jonas Schnelli)
17c0131 [Docs] Add release notes and bip update for Bip32/HD wallets (Jonas Schnelli)
c022e5b [Wallet] use constant for bip32 hardened key limit (Jonas Schnelli)
f190251 [Wallet] Add simplest BIP32/deterministic key generation implementation (Jonas Schnelli)
2016-06-14 11:44:22 +02:00
Jonas Schnelli afcd77e179
Detect -usehd mismatches when wallet.dat already exists 2016-06-14 08:56:01 +02:00
Pieter Wuille 1a5a4e6488 Randomize name lookup result in ConnectSocketByName 2016-06-13 23:53:08 +02:00
Pieter Wuille f9f5cfc506 Prevent duplicate connections where one is by name and another by ip 2016-06-13 23:53:08 +02:00
Pieter Wuille 1111b80df8 Rework addnode behaviour
* Use CNode::addeName to track whether a connection to a name is already open
  * A new connection to a previously-connected by-name addednode is only opened when
    the previous one closes (even if the name starts resolving to something else)
  * At most one connection is opened per addednode (even if the name resolves to multiple)
* Unify the code between ThreadOpenAddedNodeConnections and getaddednodeinfo
  * Information about open connections is always returned, and the dns argument becomes a dummy
  * An IP address and inbound/outbound is only reported for the (at most 1) open connection
2016-06-13 23:53:06 +02:00
Pieter Wuille ecd7fd37c8 Introduce REQUIRED_SERVICES constant 2016-06-13 17:40:16 +02:00
Pieter Wuille ee06e04369 Introduce enum ServiceFlags for service flags 2016-06-13 17:40:16 +02:00
Pieter Wuille 15bf863219 Don't require services in -addnode 2016-06-13 17:40:16 +02:00
Pieter Wuille 5e7ab16d29 Only store and connect to NODE_NETWORK nodes 2016-06-13 17:40:16 +02:00
Pieter Wuille fc83f18153 Verify that outbound connections have expected services 2016-06-13 17:40:16 +02:00
Pieter Wuille 3764dec36c Keep addrman's nService bits consistent with outbound observations 2016-06-13 17:40:16 +02:00
Francesco 'makevoid' Canessa 1c2a1bac0a Add address label to request payment QR Code (QT)
In the Receive 'Tab' of the QT wallet, when 'Show'ing a previously requested payment, add a label underneath the QR Code showing the bitcoin address where the funds will go to.

This way the user can be sure that the QR code scanner app the user using is reading the correct bitcoin address, preventing funds to be stolen.

Includes fix for HiDPI screens by @jonasschnelli.
2016-06-13 16:09:14 +01:00
Wladimir J. van der Laan 44c1b1c9bb
Merge #8141: Continuing port of java comparison tool
ff2dcf2 Tests: Edit bloated varint test and add option for 'barely expensive' tests (mrbandrews)
12c5a16 Catch exceptions from non-canonical encoding and print only to log (mrbandrews)
291f8aa Continuing port of java comptool (mrbandrews)
8c9e681 Tests: Rework blockstore to avoid re-serialization. (mrbandrews)
2016-06-13 11:37:37 +02:00
Wladimir J. van der Laan e1486eb95c
Merge #7598: Refactor CreateNewBlock to be a method of the BlockAssembler class
c2dd5a3 FIX: correctly measure size of priority block (Alex Morcos)
a278764 FIX: Account for txs already added to block in addPriorityTxs (Alex Morcos)
4dc94d1 Refactor CreateNewBlock to be a method of the BlockAssembler class (Alex Morcos)
2016-06-13 11:35:55 +02:00
Gregory Maxwell db0ffe80a0 This eliminates the primary leak that causes the orphan map to
always grow to its maximum size.

This does not go so far as to attempt to connect orphans made
 connectable by a new block.

Keeping the orphan map less full helps improve the reliability
 of relaying chains of transactions.
2016-06-10 20:42:03 +00:00
Pieter Wuille 1b0bcc5f95 Track orphan by prev COutPoint rather than prev hash 2016-06-10 19:51:20 +00:00
instagibbs 657fc19d65 rename mapAddrCount to mapNetGroupNodes 2016-06-10 10:09:06 -04:00
Wladimir J. van der Laan 63151521fd Merge commit '60ab9b200654ef0914459711cf2b22be16be3dc2' 2016-06-10 15:19:51 +02:00
Wladimir J. van der Laan ac8d0418ed
qt: translations update 2016-06-10 10:12:00 +02:00
Wladimir J. van der Laan fde0ac403c
Merge #8133: build: Finish up out-of-tree changes
d1a3d57 bulid: fix "make translate" when out-of-tree (Cory Fields)
340012d build: add temporary fix for "bad magic number" error in out-of-tree builds (Cory Fields)
142ffc7 travis: use out-of-tree build (Cory Fields)
92e37a3 build: fix out-of-tree 'make deploy' for osx (Cory Fields)
ab95d5d build: a few ugly hacks to get the rpc tests working out-of-tree (Cory Fields)
fc4ad0c build: more out-of-tree fixups (Cory Fields)
0cb0f26 build: out-of-tree fixups (Cory Fields)
2016-06-10 10:05:57 +02:00
Wladimir J. van der Laan 9201ce8f2f
Merge #8181: build: Get rid of CLIENT_DATE
d096d22 build: Get rid of `CLIENT_DATE` (Wladimir J. van der Laan)
2016-06-10 09:51:34 +02:00
Cory Fields d1a3d570e5 bulid: fix "make translate" when out-of-tree 2016-06-09 17:49:16 -04:00
Pieter Wuille 7ce9ac5c83
Merge #7292: [RPC] Expose ancestor/descendant information over RPC
176e19b Mention new RPC's in release notes (Suhas Daftuar)
7f6eda8 Add ancestor statistics to mempool entry RPC output (Suhas Daftuar)
a9b8390 Add test coverage for new RPC calls (Suhas Daftuar)
b09b813 Add getmempoolentry RPC call (Suhas Daftuar)
0dfd869 Add getmempooldescendants RPC call (Suhas Daftuar)
8f7b5dc Add getmempoolancestors RPC call (Suhas Daftuar)
5ec0cde Refactor logic for converting mempool entries to JSON (Suhas Daftuar)
2016-06-09 16:32:37 +02:00
Suhas Daftuar 7f6eda8043 Add ancestor statistics to mempool entry RPC output 2016-06-09 09:56:27 -04:00
Suhas Daftuar b09b8135ae Add getmempoolentry RPC call 2016-06-09 09:56:27 -04:00
Suhas Daftuar 0dfd86956d Add getmempooldescendants RPC call 2016-06-09 09:56:27 -04:00
Wladimir J. van der Laan d096d22446 build: Get rid of CLIENT_DATE
Putting the build date in the executable is a practice that has no place
in these days, now that deterministic building is increasingly common.

Continues #7732 which did this for the GUI.
2016-06-09 13:34:09 +02:00
Wladimir J. van der Laan 0b5279f89c
Merge #8166: src/test: Do not shadow local variables
c2715d3 Do not shadow local variables (Pavel Janík)
2016-06-09 08:25:25 +02:00
Wladimir J. van der Laan 1445835bd3
Merge #8154: drop vAddrToSend after sending big addr message
d3d02d5 drop vAddrToSend after sending big addr message (Kaz Wesley)
2016-06-09 08:13:14 +02:00
Wladimir J. van der Laan d36618585d
Merge #8168: util: Add ParseUInt32 and ParseUInt64
e012f3c util: Add ParseUInt32 and ParseUInt64 (Wladimir J. van der Laan)
2016-06-09 07:37:07 +02:00
Wladimir J. van der Laan 7e6dd7bee4
Merge #8172: Fix two warnings for comparison between signed and unsigned
77f63a4 Fix two warnings for comparison between signed and unsigned (Pieter Wuille)
2016-06-09 07:29:09 +02:00
Pieter Wuille 4286f43025
Merge #8173: Use SipHash for node eviction (cont'd)
eebc232 test: Add more test vectors for siphash (Wladimir J. van der Laan)
8884830 Use C++11 thread-safe static initializers (Pieter Wuille)
c31b24f Use 64-bit SipHash of netgroups in eviction (Pieter Wuille)
9bf156b Support SipHash with arbitrary byte writes (Pieter Wuille)
053930f Avoid recalculating vchKeyedNetGroup in eviction logic. (Patrick Strateman)
2016-06-08 18:32:34 +02:00
Pieter Wuille cd0c5135ab
Merge #8083: Add support for dnsseeds with option to filter by servicebits
2d83013d Add support for dnsseeds with option to filter by servicebits (Jonas Schnelli)
2016-06-08 17:42:14 +02:00
Wladimir J. van der Laan eebc232187 test: Add more test vectors for siphash
Add full test vectors from spec, test per byte and per 8 bytes.

Builds on #8086.
2016-06-08 15:50:55 +02:00
Pieter Wuille 66ed450d77
Merge #7935: Versionbits: GBT support
12c708a getblocktemplate: Use version/force mutation to support pre-BIP9 clients (Luke Dashjr)
9879060 getblocktemplate: Explicitly handle the distinction between GBT-affecting softforks vs not (Luke Dashjr)
72cd6b2 qa/rpc-tests: bip9-softforks: Add tests for getblocktemplate versionbits updates (Luke Dashjr)
d3df40e Implement BIP 9 GBT changes (Luke Dashjr)
2016-06-08 15:44:07 +02:00
Jonas Schnelli 6fa950a573
[RPC] Fix createrawtx sequence number unsigned int parsing 2016-06-08 15:43:28 +02:00
Pieter Wuille 77f63a4fcd Fix two warnings for comparison between signed and unsigned 2016-06-08 15:34:18 +02:00
Wladimir J. van der Laan 75ec320a0d
Merge #8153: [rpc] fundrawtransaction feeRate: Use BTC/kB
fa7f4f5 [rpc] fundrawtransaction feeRate: Use BTC/kB (MarcoFalke)
faf82e8 [rpc] fundrawtransaction: Fix help text and interface (MarcoFalke)
2016-06-08 14:14:54 +02:00
Wladimir J. van der Laan a7c41f2de0
Merge #8126: std::shared_ptr based CTransaction storage in mempool
288d85d Get rid of CTxMempool::lookup() entirely (Pieter Wuille)
c2a4724 Optimization: use usec in expiration and reuse nNow (Pieter Wuille)
e9b4780 Optimization: don't check the mempool at all if no mempool req ever (Pieter Wuille)
dbfb426 Optimize the relay map to use shared_ptr's (Pieter Wuille)
8d39d7a Switch CTransaction storage in mempool to std::shared_ptr (Pieter Wuille)
1b9e6d3 Add support for unique_ptr and shared_ptr to memusage (Pieter Wuille)
2016-06-08 14:01:18 +02:00
Wladimir J. van der Laan 761cddb690
Merge #7703: tor: Change auth order to only use password auth if -torpassword
2e49448 tor: Change auth order to only use HASHEDPASSWORD if -torpassword (Wladimir J. van der Laan)
2016-06-08 13:09:41 +02:00
Wladimir J. van der Laan 67c91f8c4c
Merge #8065: Addrman offline attempts
6182d10 Do not increment nAttempts by more than one for every Good connection. (Gregory Maxwell)
c769c4a Avoid counting failed connect attempts when probably offline. (Gregory Maxwell)
2016-06-08 13:01:53 +02:00
Wladimir J. van der Laan 2156fa23b8
Merge #8078: Disable the mempool P2P command when bloom filters disabled
3d3602f Add RPC test for the p2p mempool command in conjunction with disabled bloomfilters (Jonas Schnelli)
beceac9 Disable the mempool P2P command when bloom filters disabled (Peter Todd)
2016-06-08 12:56:48 +02:00
Wladimir J. van der Laan e012f3cea0 util: Add ParseUInt32 and ParseUInt64
Add error and range-checking parsers for unsigned 32 and 64 bit numbers.
The 32-bit variant is required for parsing sequence numbers from the
command line in `bitcoin-tx` (see #8164 for discussion). I've thrown in
the 64-bit variant as a bonus, as I'm sure it will be needed at some
point.

Also adds tests, and updates `developer-notes.md`.
2016-06-08 10:28:51 +02:00
Pavel Janík c2715d3ab8 Do not shadow local variables 2016-06-07 21:22:48 +02:00
Jonas Schnelli 86efa30ae3
[Bitcoin-Tx] fix missing test fixtures, fix 32bit atoi issue 2016-06-07 21:07:47 +02:00
Wladimir J. van der Laan 79004d4ae6
Merge #7957: [RPC][Bitcoin-TX] Add support for sequence number
ae357d5 [Bitcoin-Tx] Add tests for sequence number support (Jonas Schnelli)
e59336f [bitcoin-tx] allow to set nSequence number over the in= command (Jonas Schnelli)
a946bb6 [RPC] createrawtransaction: add option to set the sequence number per input (Jonas Schnelli)
2016-06-07 18:25:13 +02:00
Jonas Schnelli ae357d5ab9
[Bitcoin-Tx] Add tests for sequence number support 2016-06-07 17:37:35 +02:00
Pieter Wuille 888483098e Use C++11 thread-safe static initializers 2016-06-07 16:29:03 +02:00
Pieter Wuille c31b24f745 Use 64-bit SipHash of netgroups in eviction 2016-06-07 16:20:40 +02:00
Pieter Wuille 9bf156bb9e Support SipHash with arbitrary byte writes 2016-06-07 16:20:40 +02:00
Patrick Strateman 053930ffc4 Avoid recalculating vchKeyedNetGroup in eviction logic.
Lazy calculate vchKeyedNetGroup in CNode::GetKeyedNetGroup.
2016-06-07 16:20:40 +02:00
Wladimir J. van der Laan 22e0b35676
Merge #8136: Log/report in 10% steps during VerifyDB
8b78486 Log/report in 10% steps during VerifyDB (Jonas Schnelli)
2016-06-07 15:25:41 +02:00
Wladimir J. van der Laan 9b6a48c2e9
Merge #8118: Reduce unnecessary hashing in signrawtransaction
bd0f413 Reduce unnecessary hashing in signrawtransaction (Jonas Nick)
2016-06-07 14:34:31 +02:00
Pieter Wuille 288d85ddf2 Get rid of CTxMempool::lookup() entirely 2016-06-07 13:44:56 +02:00
MarcoFalke fa7f4f577c [rpc] fundrawtransaction feeRate: Use BTC/kB
Also introduce UniValueType

UniValueType is a wrapper for UniValue::VType which allows setting
a typeAny flag. This flag indicates the type does not matter.

(Used by RPCTypeCheckObj)
2016-06-07 13:12:57 +02:00
Jonas Schnelli 8b78486d02
Log/report in 10% steps during VerifyDB 2016-06-07 11:04:01 +02:00
MarcoFalke fa51a1d2b7 [init] Make feefilter option debug option 2016-06-07 08:47:43 +02:00
Kaz Wesley d3d02d5145 drop vAddrToSend after sending big addr message
We send a newly-accepted peer a 1000-entry addr message, and then only use
vAddrToSend for small messages. Deallocate vAddrToSend after it's been used for
the big message to save about 40 kB per connected inbound peer.
2016-06-06 15:57:40 -07:00
MarcoFalke faf82e8fc8 [rpc] fundrawtransaction: Fix help text and interface 2016-06-06 19:40:35 +02:00
Luke Dashjr 12c708a4b3 getblocktemplate: Use version/force mutation to support pre-BIP9 clients 2016-06-06 17:10:23 +00:00
Luke Dashjr 98790608a4 getblocktemplate: Explicitly handle the distinction between GBT-affecting softforks vs not 2016-06-06 17:10:23 +00:00
Luke Dashjr d3df40e51a Implement BIP 9 GBT changes
- BIP9DeploymentInfo struct for static deployment info
- VersionBitsDeploymentInfo: Avoid C++11ism by commenting parameter names
- getblocktemplate: Make sure to set deployments in the version if it is LOCKED_IN
- In this commit, all rules are considered required for clients to support
2016-06-06 17:10:22 +00:00
Wladimir J. van der Laan 52c3f348be
Merge #8142: Improve CWallet API with new GetAccountPubkey function.
152ab23 Improve CWallet API  with new GetAccountPubkey function. (Patrick Strateman)
2016-06-06 16:28:41 +02:00
Patrick Strateman 152ab236ea Improve CWallet API with new GetAccountPubkey function.
Remove one more caller that is passing CWalletDB.
2016-06-06 07:02:05 -07:00
Wladimir J. van der Laan 6b781df74f
Merge #8007: Minor locking improvements
f0fdda0 IsInitialBlockDownload: usually avoid locking (Kaz Wesley)
2016-06-06 15:45:40 +02:00
Wladimir J. van der Laan 243ac0c75b
Merge #8137: Improve CWallet API with new AccountMove function.
9dfaa1c Improve CWallet API with new AccountMove function. (Patrick Strateman)
2016-06-06 14:59:10 +02:00
Wladimir J. van der Laan 2e494489c3 tor: Change auth order to only use HASHEDPASSWORD if -torpassword
Change authentication order to make it more clear (see #7700).

- If the `-torpassword` option is provided, force use of
  `HASHEDPASSWORD` auth.

- Give error message if `-torpassword` provided, but
  `HASHEDPASSWORD` auth is not available.

- Give error message if only `HASHEDPASSWORD` available, but
  `-torpassword` not given.
2016-06-06 10:38:54 +02:00
Wladimir J. van der Laan e6b141acf9
qt: translation strings update 2016-06-06 10:34:15 +02:00
Pieter Wuille c2a4724642 Optimization: use usec in expiration and reuse nNow 2016-06-06 02:02:24 +02:00
Pieter Wuille e9b4780b29 Optimization: don't check the mempool at all if no mempool req ever 2016-06-06 02:02:23 +02:00
Pieter Wuille dbfb426b96 Optimize the relay map to use shared_ptr's
* Switch mapRelay to use shared_ptr<CTransaction>
* Switch the relay code to copy mempool shared_ptr's, rather than copying
  the transaction itself.
* Change vRelayExpiration to store mapRelay iterators rather than hashes
  (smaller and faster).
2016-06-06 02:00:23 +02:00
Kaz Wesley f0fdda0181 IsInitialBlockDownload: usually avoid locking
Optimistically test the latch bool before taking the lock.
For all IsInitialBlockDownload calls after the first to return false,
this avoids the need to lock cs_main.
2016-06-04 22:18:59 -07:00
Pieter Wuille 8d39d7a2cf Switch CTransaction storage in mempool to std::shared_ptr 2016-06-05 00:31:43 +02:00
Pieter Wuille 1b9e6d3c1a Add support for unique_ptr and shared_ptr to memusage 2016-06-05 00:31:35 +02:00
Cory Fields 340012d9c9 build: add temporary fix for "bad magic number" error in out-of-tree builds
This was caused by an pyc files hanging around from previous
python2 invocations, when the matching .py missing from that path.

This should not be a problem with python3's tagged caches.
2016-06-03 14:48:21 -04:00
instagibbs e39dc698ad comment nit: miners don't vote 2016-06-03 10:07:14 -04:00
Wladimir J. van der Laan 8c1e49ba13
Merge #7967: [RPC] add feerate option to fundrawtransaction
04eaa90 Add more clear interface for CoinControl.h regarding individual feerate (Jonas Schnelli)
3b35e48 [RPC] add feerate option to fundrawtransaction (Jonas Schnelli)
2016-06-03 15:47:48 +02:00
Wladimir J. van der Laan c141c14c9f
Merge #7942: locking for Misbehave() and other cs_main locking fixes
719de56 lock cs_main for chainActive (Kaz Wesley)
efb54ba lock cs_main for State/Misbehaving (Kaz Wesley)
2016-06-03 15:29:28 +02:00
Pieter Wuille a82f03393a
Merge #7997: replace mapNextTx with slimmer setSpends
9805f4a mapNextTx: use pointer as key, simplify value (Kaz Wesley)
2016-06-03 01:26:50 +02:00
Pieter Wuille f972b04d63
Merge #7825: Prevent multiple calls to ExtractDestination
0bf6f30 Prevent multiple calls to ExtractDestination (Pedro Branco)
2016-06-03 00:45:22 +02:00
Kaz Wesley 9805f4af7e mapNextTx: use pointer as key, simplify value
Saves about 10% of application memory usage once the mempool warms up. Since the
mempool is DynamicUsage-regulated, this will translate to a larger mempool in
the same amount of space.

Map value type: eliminate the vin index; no users of the map need to know which
input of the transaction is spending the prevout.

Map key type: replace the COutPoint with a pointer to a COutPoint. A COutPoint
is 36 bytes, but each COutPoint is accessible from the same map entry's value.
A trivial DereferencingComparator functor allows indirect map keys, but the
resulting syntax is misleading: `map.find(&outpoint)`. Implement an indirectmap
that acts as a wrapper to a map that uses a DereferencingComparator, supporting
a syntax that accurately reflect the container's semantics: inserts and
iterators use pointers since they store pointers and need them to remain
constant and dereferenceable, but lookup functions take const references.
2016-06-02 12:31:51 -07:00
mrbandrews 12c5a16c4e Catch exceptions from non-canonical encoding and print only to log 2016-06-02 14:43:18 -04:00
Pieter Wuille ec45cc5e27
Merge #7992: Extend #7956 with one more test.
269a440 Add test for dbwrapper iterators with same-prefix keys. (Matt Corallo)
6030625 test: Add more thorough test for dbwrapper iterators (Wladimir J. van der Laan)
84c13e7 chain: Add assertion in case of missing records in index db (Wladimir J. van der Laan)
2016-06-02 19:14:34 +02:00
Pieter Wuille 595b22e5c0 Stop treating importaddress'ed scripts as change
Before this, if someone imported a scriptPubKey directly (in hex form) using
importaddress, outputs sending to it would be treated as change, as the
corresponding CTxDestination was not added to the address book.

Fix this by trying to detect scriptPubKeys that are in fact convertible to a
CTxDestination and add them anyway. Add a warning to the RPC help to warn
against importing raw non-standard scripts.
2016-06-02 15:53:04 +02:00
Patrick Strateman 9dfaa1cb70 Improve CWallet API with new AccountMove function. 2016-06-02 06:00:59 -07:00
Jonas Schnelli ee1533e262
Merge #8129: Fix RPC console auto completer
16698cb PR #7772 is not enough to fix the issue with QCompleter, use event filter instead of `connect` (UdjinM6)
2016-06-02 11:11:38 +02:00
Cory Fields fc4ad0c7fc build: more out-of-tree fixups
- clear the __pycache__ during 'make clean'
- Copy the qrc locale file to a temp location and remove it when finished
  (rcc expects everything to be in the same path)
2016-06-01 20:31:55 -04:00
Cory Fields 0cb0f2626e build: out-of-tree fixups
Don't glob the leveldb for dist. That means we need to enumerate the headers.
2016-06-01 20:31:55 -04:00
Pieter Wuille 715e9fd745
Merge #8077: Consensus: Decouple from chainparams.o and timedata.o
ee9f4a5 Consensus: Decouple from chainparams.o and timedata.o (Jorge Timón)
2016-06-01 20:52:27 +02:00
Jonas Schnelli c022e5b15d
[Wallet] use constant for bip32 hardened key limit 2016-06-01 20:29:39 +02:00
Pieter Wuille a886dbf8e7 Use std::atomic for fRequestShutdown and fReopenDebugLog 2016-06-01 19:18:25 +02:00
Pieter Wuille 16cf85fa2c Revert "Include signal.h for sig_atomic_t in WIN32"
This reverts commit 88f14b999c.
2016-06-01 19:18:06 +02:00
Pieter Wuille 7fa8d75859
Merge #8112: Include signal.h for sig_atomic_t in WIN32
88f14b9 Include signal.h for sig_atomic_t in WIN32 (Pieter Wuille)
2016-06-01 18:47:45 +02:00
Pieter Wuille 6a22373771
Merge #7960: Only use AddInventoryKnown for transactions
383fc10 Only use AddInventoryKnown for transactions (Suhas Daftuar)
2016-06-01 18:36:11 +02:00
Alex Morcos c2dd5a3c39 FIX: correctly measure size of priority block 2016-06-01 12:29:03 -04:00
Pieter Wuille b89ef13114
Merge #7689: Replace OpenSSL AES with ctaes-based version
723779c build: Enumerate ctaes rather than globbing (Cory Fields)
34ed64a crypter: add tests for crypter (Cory Fields)
0a36b9a crypter: shuffle Makefile so that crypto can be used by the wallet (Cory Fields)
976f9ec crypter: add a BytesToKey clone to replace the use of openssl (Cory Fields)
9049cde crypter: hook up the new aes cbc classes (Cory Fields)
fb96831 crypter: constify encrypt/decrypt (Cory Fields)
1c391a5 crypter: fix the stored initialization vector size (Cory Fields)
daa3841 crypto: add aes cbc tests (Cory Fields)
27a212d crypto: add AES 128/256 CBC classes (Cory Fields)
6bec172 Add ctaes-based constant time AES implementation (Pieter Wuille)
a545127 Squashed 'src/crypto/ctaes/' content from commit cd3c3ac (Pieter Wuille)
2016-06-01 18:22:34 +02:00
Gregory Maxwell 4d8993b346 Defer inserting into maprelay until just before relaying.
This reduces the rate of not founds by better matching the far
 end expectations, it also improves privacy by removing the
 ability to use getdata to probe for a node having a txn before
 it has been relayed.
2016-05-31 15:35:45 +00:00
Wladimir J. van der Laan 862fd24b40
Merge #8080: Do not use mempool for GETDATA for tx accepted after the last mempool req.
7e908c7 Do not use mempool for GETDATA for tx accepted after the last mempool req. (Gregory Maxwell)
2016-05-31 15:47:32 +02:00
Wladimir J. van der Laan a2df115249
Merge #8090: Adding P2SH(p2pkh) script test case
b682960 Adding P2SH(p2pkh) script test case (Chris Stewart)
2016-05-31 15:27:14 +02:00
Wladimir J. van der Laan 0026e0ef34
Merge #8115: Avoid integer division in the benchmark inner-most loop.
63ff57d Avoid integer division in the benchmark inner-most loop. (Gregory Maxwell)
2016-05-31 15:10:03 +02:00
Jonas Schnelli f19025106d
[Wallet] Add simplest BIP32/deterministic key generation implementation 2016-05-31 14:47:00 +02:00
UdjinM6 16698cb77e PR #7772 is not enough to fix the issue with QCompleter, use event filter instead of connect 2016-05-31 06:33:34 +03:00
Gregory Maxwell 63ff57db4b Avoid integer division in the benchmark inner-most loop.
Previously the benchmark code used an integer division (%) with
 a non-constant in the inner-loop.  This is quite slow on many
 processors, especially ones like ARM that lack a hardware divide.

Even on fairly recent x86_64 like haswell an integer division can
 take something like 100 cycles-- making it comparable to the
 runtime of siphash.

This change avoids the division by using bitmasking instead. This
 was especially easy since the count was only increased by doubling.

This change also restarts the timing when the execution time was
 very low this avoids mintimes of zero in cases where one execution
 ends up below the timer resolution. It also reduces the impact of
 the overhead on the final result.

The formatting of the prints is changed to not use scientific
 notation make it more machine readable (in particular, gnuplot
 croaks on the non-fixedpoint, and it doesn't sort correctly).

This also hoists out all the floating point divisions out of the
 semi-hot path because it was easy to do so.

It might be prudent to break out the critical test into a macro
 just to guarantee that it gets inlined.  It might also make sense
 to just save out the intermediate counts and times and get the
 floating point completely out of the timing loop (because e.g.
 on hardware without a fast hardware FPU like some ARM it will
 still be slow enough to distort the results). I haven't done
 either of these in this commit.
2016-05-30 22:07:56 +00:00
Pieter Wuille 950be19727
Merge #7891: Always require OS randomness when generating secret keys
628cf14 Don't use assert for catching randomness failures (Pieter Wuille)
fa2637a Always require OS randomness when generating secret keys (Pieter Wuille)
2016-05-30 15:59:52 +02:00
Chris Stewart b682960a28 Adding P2SH(p2pkh) script test case
Fixing formatting

Adding test case into automatically generated test case set

Clean up commits

removing extra whitespace from eol

Removing extra whitespace on macro line
2016-05-30 08:51:37 -05:00
Wladimir J. van der Laan 52b803e09b
Merge #8107: bench: Added base58 encoding/decoding benchmarks
5fac1f3 bench: Added base58 encoding/decoding benchmarks (Yuri Zhykin)
2016-05-30 13:05:57 +02:00
Wladimir J. van der Laan 989df7ecf3
Merge #7896: fix typo in help text
fc95f6e fix typo in help text (Chris Moore)
2016-05-30 12:39:56 +02:00
Wladimir J. van der Laan 61b86848b1
Merge #8111: Benchmark SipHash
619d569 Benchmark SipHash (Pieter Wuille)
2016-05-30 12:39:23 +02:00
Jonas Nick bd0f413877 Reduce unnecessary hashing in signrawtransaction 2016-05-30 11:43:53 +02:00
Pieter Wuille 628cf1440a Don't use assert for catching randomness failures 2016-05-29 01:52:25 +02:00
Pieter Wuille fa2637a3be Always require OS randomness when generating secret keys 2016-05-29 01:52:17 +02:00
Pieter Wuille 619d5691c2 Benchmark SipHash 2016-05-28 20:04:32 +02:00
Cory Fields 723779c650 build: Enumerate ctaes rather than globbing 2016-05-27 14:14:44 -04:00
Pieter Wuille 88f14b999c Include signal.h for sig_atomic_t in WIN32 2016-05-27 13:31:04 +02:00
MarcoFalke a80de15113
Merge #8108: Trivial: Remove unused local variable shadowing upper local
13c4558 Remove unused local variable shadowing upper local (Pavel Janík)
2016-05-27 08:49:00 +02:00
Pavel Janík 13c455823f Remove unused local variable shadowing upper local 2016-05-27 07:46:36 +02:00
Yuri Zhykin 5fac1f33fb bench: Added base58 encoding/decoding benchmarks 2016-05-27 05:32:58 +03:00
Pieter Wuille 52b02ecd6d Use global ::fRelayTxes instead of CNode one 2016-05-26 20:04:43 +02:00
Pieter Wuille c028c7b755
Merge #8049: Expose information on whether transaction relay is enabled in getnetwork
1ab1dc3 rpc: Add `relaytxes` flag to `getnetworkinfo` (Wladimir J. van der Laan)
581ddff net: Add fRelayTxes flag (Wladimir J. van der Laan)
2016-05-26 15:02:16 +02:00
Gregory Maxwell 6182d10503 Do not increment nAttempts by more than one for every Good connection.
This slows the increase of the nAttempts in addrman while partitioned,
 even if the node hasn't yet noticed the partitioning.
2016-05-26 12:56:32 +00:00
Gregory Maxwell c769c4af11 Avoid counting failed connect attempts when probably offline.
If a node is offline failed outbound connection attempts will crank up
 the addrman counter and effectively blow away our state.

This change reduces the problem by only counting attempts made while
 the node believes it has outbound connections to at least two
 netgroups.

Connect and addnode connections are also not counted, as there is no
 reason to unequally penalize them for their more frequent
 connections -- though there should be no real effect from this
 unless their addnode configureation is later removed.

Wasteful repeated connection attempts while only a few connections are
 up are avoided via nLastTry.

This is still somewhat incomplete protection because our outbound
 peers could be down but not timed out or might all be on 'local'
 networks (although the requirement for multiple netgroups helps).
2016-05-26 12:56:27 +00:00
Wladimir J. van der Laan 6fc6325f77
Merge #8015: CCoinsViewErrorCatcher raison-d-etre
a4d5855 CCoinsViewErrorCatcher raison-d-etre (21E14)
2016-05-26 07:32:50 +02:00
Wladimir J. van der Laan eb2f6f72db
Merge #8073: qt: askpassphrasedialog: Clear pass fields on accept
02ce2a3 qt: askpassphrasedialog: Clear pass fields on accept (Pavel Vasin)
2016-05-26 07:22:48 +02:00
Gregory Maxwell 7e908c7b82 Do not use mempool for GETDATA for tx accepted after the last mempool req.
The ability to GETDATA a transaction which has not (yet) been relayed
 is a privacy loss vector.

The use of the mempool for this was added as part of the mempool p2p
 message and is only needed to fetch transactions returned by it.
2016-05-25 18:05:58 +00:00
Pieter Wuille 47a7cfb0aa
Merge #7795: UpdateTip: log only one line at most per block
f20d42e UpdateTip: log only one line at most per block (Wladimir J. van der Laan)
2016-05-25 18:18:56 +02:00
Pieter Wuille f6b7df3155
Merge #8061: [Wallet] Improve Wallet encapsulation
380498a Move BackupWallet to CWallet::BackupWallet (Patrick Strateman)
ecb9741 Move GetAccountBalance from rpcwallet.cpp into CWallet::GetAccountBalance (Patrick Strateman)
2016-05-25 18:08:06 +02:00
Pieter Wuille d72098038f
Merge #8076: VerifyDB: don't check blocks that have been pruned
bd477f4 VerifyDB: don't check blocks that have been pruned (Suhas Daftuar)
2016-05-25 16:28:22 +02:00
Pieter Wuille c49c825bd9
Merge #8063: Acquire lock to check for genesis block.
46b0c3b Acquire lock to check for genesis block. (Patrick Strateman)
2016-05-25 16:12:20 +02:00
Jonas Schnelli 2d83013dc5
Add support for dnsseeds with option to filter by servicebits 2016-05-25 14:57:24 +02:00
Alex Morcos a278764748 FIX: Account for txs already added to block in addPriorityTxs 2016-05-24 15:01:14 -04:00
Jonas Schnelli 77b49acc85
Merge #8014: Qt: Sort transactions by date
2d5603c Qt: Sort transactions by date (Tyler Hardin)
2016-05-23 21:50:38 +02:00
Jonas Schnelli 692971193a
Merge #8042: [Qt] Don't allow to open the debug window during splashscreen & verification state
276ce84 [Qt] Disable some menu items during splashscreen/verification state (Jonas Schnelli)
2016-05-23 21:49:46 +02:00
Suhas Daftuar bd477f4e8b VerifyDB: don't check blocks that have been pruned 2016-05-22 09:15:21 -04:00
Peter Todd beceac9bbf
Disable the mempool P2P command when bloom filters disabled
Only useful to SPV peers, and attackers... like bloom is a DoS vector as far
more data is sent than received.
2016-05-20 16:40:37 +02:00
Jorge Timón ee9f4a5b15 Consensus: Decouple from chainparams.o and timedata.o
Do it for the consensus-critical functions:

- CheckBlockHeader
- CheckBlock
- ContextualCheckBlockHeader
2016-05-20 14:53:03 +02:00
Pavel Vasin 02ce2a3ca7 qt: askpassphrasedialog: Clear pass fields on accept
This is usability improvement in a case if user gets re-asked
passphrase. (e.g. made a typo)
2016-05-19 14:52:08 +03:00
Wladimir J. van der Laan 7771aa57bd
Merge #8070: Remove non-determinism which is breaking net_tests #8069
2a8b358 Fix typo adddrman to addrman as requested in #8070 (Ethan Heilman)
f4119c6 Remove non-determinism which is breaking net_tests #8069 (EthanHeilman)
2016-05-19 09:56:05 +02:00
Wladimir J. van der Laan 18436d8896
Merge #8033: Fix Socks5() connect failures to be less noisy and less unnecessarily scary
bf9266e Use Socks5ErrorString() to decode error responses from socks proxy. (Warren Togami)
94fd1d8 Make Socks5() InterruptibleRecv() timeout/failures informative. (Warren Togami)
0d9af79 SOCKS5 connecting and connected messages with -debug=net. (Warren Togami)
00678bd Make failures to connect via Socks5() more informative and less unnecessarily scary. (Warren Togami)
2016-05-19 08:45:58 +02:00
Warren Togami bf9266e017 Use Socks5ErrorString() to decode error responses from socks proxy. 2016-05-19 14:21:22 +09:00
Ethan Heilman 2a8b3589b5 Fix typo adddrman to addrman as requested in #8070 2016-05-18 20:14:26 -04:00
Alex Morcos 4dc94d1036 Refactor CreateNewBlock to be a method of the BlockAssembler class 2016-05-18 14:11:12 -04:00
EthanHeilman f4119c6c98 Remove non-determinism which is breaking net_tests #8069 2016-05-18 12:26:41 -04:00
Wladimir J. van der Laan 239d419864
Merge #7917: Optimize reindex
b4d24e1 Report reindexing progress in GUI (Pieter Wuille)
d3d7547 Add -reindex-chainstate that does not rebuild block index (Pieter Wuille)
fb8fad1 Optimize ActivateBestChain for long chains (Pieter Wuille)
316623f Switch reindexing to AcceptBlock in-loop and ActivateBestChain afterwards (Pieter Wuille)
d253ec4 Make ProcessNewBlock dbp const and update comment (Pieter Wuille)
2016-05-18 12:31:32 +02:00
Wladimir J. van der Laan 8e8bebc040
Merge #8054: net: Avoid duplicate getheaders requests.
f93c2a1 net: Avoid duplicate getheaders requests. (Daniel Kraft)
2016-05-18 12:28:19 +02:00
Wladimir J. van der Laan 83121cca75
Merge #7906: net: prerequisites for p2p encapsulation changes
5d5e7a0 net: No need to export ConnectNode (Cory Fields)
e9ed620 net: No need to export DumpBanlist (Cory Fields)
8b8f877 net: make Ban/Unban/ClearBan functionality consistent (Cory Fields)
cca221f net: Drop CNodeRef for AttemptToEvictConnection (Cory Fields)
563f375 net: use the exposed GetNodeSignals() rather than g_signals directly (Cory Fields)
9faa490 net: remove unused set (Cory Fields)
52cbce2 net: don't import std namespace (Cory Fields)
2016-05-18 12:13:05 +02:00
Wladimir J. van der Laan ed749bdb64
Merge #7932: CAddrMan::Deserialize handle corrupt serializations better.
fb26bf0 CAddrMan::Deserialize handle corrupt serializations better. (Patrick Strateman)
2016-05-18 11:53:48 +02:00
Wladimir J. van der Laan 5e374f7306
Merge #8020: Use SipHash-2-4 for various non-cryptographic hashes
a68ec21 Use SipHash-2-4 for address relay selection (Pieter Wuille)
8cc9cfe Switch CTxMempool::mapTx to use a hash index for txids (Pieter Wuille)
382c871 Use SipHash-2-4 for CCoinsCache index (Pieter Wuille)
0b1295b Add SipHash-2-4 primitives to hash (Pieter Wuille)
2016-05-18 11:01:42 +02:00
Matt Corallo 269a4402a8 Add test for dbwrapper iterators with same-prefix keys. 2016-05-17 19:44:58 -07:00
Pieter Wuille a68ec21f7e Use SipHash-2-4 for address relay selection 2016-05-17 20:04:46 +02:00
Pieter Wuille 8cc9cfe160 Switch CTxMempool::mapTx to use a hash index for txids 2016-05-17 20:04:46 +02:00
Pieter Wuille 382c871d28 Use SipHash-2-4 for CCoinsCache index
This is ~1.7x slower than the Lookup3-of-Xor-with-salt construct we were
using before, but it is a primitive designed for exactly this.
2016-05-17 20:04:46 +02:00
Pieter Wuille 0b1295b066 Add SipHash-2-4 primitives to hash 2016-05-17 20:04:42 +02:00
Suhas Daftuar 8f7b5dc4af Add getmempoolancestors RPC call 2016-05-17 13:12:11 -04:00
Suhas Daftuar 5ec0cde371 Refactor logic for converting mempool entries to JSON 2016-05-17 08:06:37 -04:00
Pieter Wuille 5c3f8ddcaa
Merge #7696: Fix de-serialization bug where AddrMan is left corrupted
1475ecf Fix de-serialization bug where AddrMan is corrupted after exception * CAddrDB modified so that when de-serialization code throws an exception Addrman is reset to a clean state * CAddrDB modified to make unit tests possible * Regression test created to ensure bug is fixed * StartNode modifed to clear adrman if CAddrDB::Read returns an error code. (EthanHeilman)
2016-05-17 10:53:00 +02:00
Warren Togami 94fd1d8d53 Make Socks5() InterruptibleRecv() timeout/failures informative.
Before:
2016-05-16 06:10:45 ERROR: Error reading proxy response

After:
2016-05-16 06:10:45 Socks5() connect to k7s5d6jqig4ej4v4.onion:18333 failed: InterruptibleRecv() timeout or other failure
2016-05-17 16:43:23 +09:00
MarcoFalke e2bf830bb6
Merge #8038: [qa, doc] Various minor fixes
fa83a5d [qa] wallet: Temporarily disable salvagewallet test (MarcoFalke)
fadd048 [doc] Link to clang-format in the developer notes (MarcoFalke)
fa72f7d [doc] Remove outdated line from listunspent RPC help, fix typo (MarcoFalke)
ac40ed7 Increase timeout waiting for pruned blk00000.dat (error10)
2016-05-17 09:27:25 +02:00
Patrick Strateman 46b0c3b688 Acquire lock to check for genesis block. 2016-05-16 20:33:32 -07:00
Patrick Strateman 380498aba4 Move BackupWallet to CWallet::BackupWallet 2016-05-16 17:48:25 -07:00
Patrick Strateman ecb9741ec3 Move GetAccountBalance from rpcwallet.cpp into CWallet::GetAccountBalance 2016-05-16 17:48:25 -07:00
Pieter Wuille 1f01443567
Merge #7994: Add op csv tests to script_tests.json
10e83d7 Adding basic tests for OP_CSV inside of script_tests.json (Chris Stewart)
2016-05-17 01:32:35 +02:00
Pieter Wuille b4d24e142e Report reindexing progress in GUI 2016-05-17 00:45:58 +02:00
Pieter Wuille d3d7547911 Add -reindex-chainstate that does not rebuild block index 2016-05-17 00:45:57 +02:00
Pieter Wuille fb8fad1586 Optimize ActivateBestChain for long chains 2016-05-17 00:45:57 +02:00
Pieter Wuille 316623f2c1 Switch reindexing to AcceptBlock in-loop and ActivateBestChain afterwards 2016-05-17 00:45:49 +02:00
Pieter Wuille d253ec4baa Make ProcessNewBlock dbp const and update comment 2016-05-17 00:40:55 +02:00
Gregory Maxwell d87b198b73 Remove unneeded feerate param from RelayTransaction/AcceptToMemoryPool. 2016-05-16 04:10:06 +00:00
Daniel Kraft f93c2a1b7e net: Avoid duplicate getheaders requests.
The current logic for syncing headers may lead to lots of duplicate
getheaders requests being sent:  If a new block arrives while the node
is in headers sync, it will send getheaders in response to the block
announcement.  When the headers arrive, the message will be of maximum
size and so a follow-up request will be sent---all of that in addition
to the existing headers syncing.  This will create a second "chain" of
getheaders requests.  If more blocks arrive, this may even lead to
arbitrarily many parallel chains of redundant requests.

This patch changes the behaviour to only request more headers after a
maximum-sized message when it contained at least one unknown header.
This avoids sustaining parallel chains of redundant requests.

Note that this patch avoids the issues raised in the discussion of
https://github.com/bitcoin/bitcoin/pull/6821:  There is no risk of the
node being permanently blocked.  At the latest when a new block arrives
this will trigger a new getheaders request and restart syncing.
2016-05-15 20:15:02 +02:00
Cory Fields 34ed64a404 crypter: add tests for crypter
Verify that results correct (match known values), consistent (encrypt->decrypt
matches the original), and compatible with the previous openssl implementation.

Also check that failed encrypts/decrypts fail the exact same way as openssl.
2016-05-13 10:23:04 +02:00
Cory Fields 0a36b9af28 crypter: shuffle Makefile so that crypto can be used by the wallet
Wallet must come before crypto, otherwise linking fails on some platforms.

Includes a tangentially-related general cleanup rather than making the Makefile
sloppier.
2016-05-13 10:23:04 +02:00
Cory Fields 976f9ec264 crypter: add a BytesToKey clone to replace the use of openssl
BytesToKeySHA512AES should be functionally identical to EVP_BytesToKey, but
drops the dependency on openssl.
2016-05-13 10:23:04 +02:00
Cory Fields 9049cde4d9 crypter: hook up the new aes cbc classes 2016-05-13 10:23:04 +02:00
Cory Fields fb96831c1f crypter: constify encrypt/decrypt
This makes CCrypter easier to pass aroundf for tests
2016-05-13 10:23:04 +02:00
Cory Fields 1c391a5866 crypter: fix the stored initialization vector size
AES IV's are 16bytes, not 32. This was harmless but confusing.

Add WALLET_CRYPTO_IV_SIZE to make its usage explicit.
2016-05-13 10:23:03 +02:00
Cory Fields daa384120a crypto: add aes cbc tests 2016-05-13 10:23:03 +02:00
Cory Fields 27a212dcb4 crypto: add AES 128/256 CBC classes
The output should always match openssl's, even for failed operations. Even for
a decrypt with broken padding, the output is always deterministic (and attemtps
to be constant-time).
2016-05-13 10:23:03 +02:00
Pieter Wuille 6bec172eb9 Add ctaes-based constant time AES implementation 2016-05-13 10:22:54 +02:00
Wladimir J. van der Laan 1ab1dc3140 rpc: Add relaytxes flag to getnetworkinfo
Re-work of PR #7841 by dragongem45.
Closes #7771.
2016-05-12 14:26:49 +02:00
Wladimir J. van der Laan 581ddff05c net: Add fRelayTxes flag
Add a fRelayTxes to keep track of the relay transaction flag
we send to other peers.
2016-05-12 14:12:46 +02:00
Jonas Schnelli 169d379c98
Merge #8046: [Qt][OSX] Fix Cmd-Q / Menu Quit shutdown on OSX
34ebceb [Qt][OSX] Fix Cmd-Q / Menu Quit shutdown on OSX (Jonas Schnelli)
2016-05-12 13:15:39 +02:00
Wladimir J. van der Laan 7c8558da36
Merge #8006: Qt: Add option to disable the system tray icon
8b0e497 Qt: Add option to hide the system tray icon (Tyler Hardin)
2016-05-12 11:56:21 +02:00
Wladimir J. van der Laan 2efe38b832
Merge #8004: signal handling: fReopenDebugLog and fRequestShutdown should be type sig_atomic_t
3262316 fReopenDebugLog and fRequestShutdown should be type sig_atomic_t (Chirag Davé)
2016-05-12 11:46:10 +02:00
Jonas Schnelli 34ebceb25a
[Qt][OSX] Fix Cmd-Q / Menu Quit shutdown on OSX 2016-05-12 11:42:31 +02:00
Jonas Schnelli 276ce84fd3
[Qt] Disable some menu items during splashscreen/verification state 2016-05-12 10:45:03 +02:00
Tyler Hardin 8b0e497028 Qt: Add option to hide the system tray icon
My changes leave all tray icon and menu creation/initialization logic
untouched. It only shows or hides the icon according to the setting.

A new checkbox was added to the OptionsDialog under the Window tab. A
bool option named "hideTrayIcon" was added to OptionsModel. This
checkbox was mapped like other all options to the OptionsModel.

A signal was added to the OptionsModel for broadcasting changes the the
hideTrayIcon option. This signal was connected to a new slot added to
BitcoinGUI named setTrayIconVisible(bool). The slot simply hides or
shows the trayIcon in BitcoinGUI according to the parameter recieved.
2016-05-11 22:28:02 -04:00
Wladimir J. van der Laan 32114dd634 bench: Add crypto hash benchmarks
Add benchmarks for the cryptographic hash algorithms:

- RIPEMD160
- SHA1
- SHA256
- SHA512

Continues work on #7883.
2016-05-11 19:47:25 +02:00
Pieter Wuille cd2be4419e
Merge commit 'a545127fbccef4ee674d18d43732ce00ba97f782' as 'src/crypto/ctaes' 2016-05-11 19:37:02 +02:00
Chris Stewart 10e83d7956 Adding basic tests for OP_CSV inside of script_tests.json
Changing NOP3 op name to OP_CHECKSEQUENCEVERIFY, renaming instances of OP_NOP3 in script_tests.json to CHECKSEQUENCEVERIFY

Cleaning up NOP3 comment

Re-adding test cases that were accidentally deleted, removing dupicated test case, fixing formatting

Removing re-labeling of OP_NOP3 to OP_CSV

Fixing whitespace issues
2016-05-11 08:00:48 -05:00
Cory Fields 5d5e7a097a net: No need to export ConnectNode 2016-05-10 12:28:23 -04:00
Cory Fields e9ed6206b3 net: No need to export DumpBanlist 2016-05-10 12:28:22 -04:00
Cory Fields 8b8f87714d net: make Ban/Unban/ClearBan functionality consistent
- Ban/Unban/ClearBan call uiInterface.BannedListChanged() as necessary
- Ban/Unban/ClearBan sync to disk if the operation is user-invoked
- Mark node for disconnection automatically when banning
- Lock cs_vNodes while setting disconnected
- Don't spin in a tight loop while setting disconnected
2016-05-10 12:28:22 -04:00
MarcoFalke fa72f7d99d [doc] Remove outdated line from listunspent RPC help, fix typo 2016-05-10 17:59:02 +02:00
Wladimir J. van der Laan 373b50deba
Merge #8028: Fix insanity of CWalletDB::WriteTx and CWalletTx::WriteToDisk
0fd5997 Fix insanity of CWalletDB::WriteTx and CWalletTx::WriteToDisk (Patrick Strateman)
2016-05-10 15:51:34 +02:00
Wladimir J. van der Laan 3e2c946cfd init: Move berkeleydb version reporting to wallet
Move the version reporting to Wallet::Verify, before starting
verification of the wallet.

This removes the dependency of init on a specific wallet database
library.

A further, trivial step towards resolving #7965.
2016-05-10 12:57:07 +02:00
Wladimir J. van der Laan f7a21dae5d
Merge #8019: Remove state arg from ReconsiderBlock, rename to ResetBlockFailureFlags
657e07e Rename ReconsiderBlock func to reflect real behavior (instagibbs)
addb9d2 Remove state arg from ReconsiderBlock (instagibbs)
2016-05-10 12:43:22 +02:00
Wladimir J. van der Laan 5767e80dda
Merge #8016: Fix multithread CScheduler and reenable test
166e4b0 Notify other serviceQueue thread we are finished to prevent deadlocks. (Pavel Janík)
db18ab2 Reenable multithread scheduler test. (Pavel Janík)
2016-05-10 12:08:08 +02:00
Jonas Schnelli b33824b76c
Merge #8012: Qt: Delay user confirmation of send
3902a29 Qt: Delay user confirmation of send (Tyler Hardin)
2016-05-10 10:33:21 +02:00
Tyler Hardin 2d5603c7e8 Qt: Sort transactions by date
Conflicted transactions can get stuck at the top. This fixes that.
2016-05-09 22:46:33 -04:00
Tyler Hardin 3902a291ab Qt: Delay user confirmation of send
I made a subclass of QMessageBox that disables the send button in
exec() and starts a timer that calls a slot to re-enable it after a
configurable delay.

It also has a countdown in the send/yes button while it is disabled
to hint to the user why the send button is disabled (and that it is
actually supposed to be disabled).
2016-05-09 22:26:57 -04:00
Warren Togami 0d9af79e50 SOCKS5 connecting and connected messages with -debug=net.
They were too noisy and not necessary for normal operation.
2016-05-09 18:13:55 -07:00
Warren Togami 00678bdb0a Make failures to connect via Socks5() more informative and less unnecessarily scary.
* The "ERROR" was printed far too often during normal operation for what was not an error.
* Makes the Socks5() connect failure similar to the IP connect failure in debug.log.

Before:
`2016-05-09 00:15:00 ERROR: Proxy error: host unreachable`

After:
`2016-05-09 00:15:00 Socks5() connect to t6xj6wilh4ytvcs7.onion:18333 failed: host unreachable"`
2016-05-09 18:13:55 -07:00
instagibbs 657e07efa3 Rename ReconsiderBlock func to reflect real behavior 2016-05-09 11:26:37 -04:00
Chirag Davé 326231611b fReopenDebugLog and fRequestShutdown should be type sig_atomic_t
This allows access as an atomic variable in the presence
of async interrupts.

See issue #7433 for more details
fixes: #7433
2016-05-09 08:20:58 -07:00
Wladimir J. van der Laan a68f56e727
Merge #7958: Remove useless argument to AlertNotify.
b02119e Remove useless argument to AlertNotify. (Pavel Janík)
2016-05-09 13:34:00 +02:00
Wladimir J. van der Laan e29cfc48fc
Merge #7976: Remove obsolete reference to CValidationState from UpdateCoins.
c8b9248 Remove obsolete reference to CValidationState from UpdateCoins. (21E14)
2016-05-09 11:59:03 +02:00
Patrick Strateman 0fd599767d Fix insanity of CWalletDB::WriteTx and CWalletTx::WriteToDisk 2016-05-09 00:20:17 -07:00
Wladimir J. van der Laan f17032f703
Merge #7934: Improve rolling bloom filter performance and benchmark
1953c40 More efficient bitsliced rolling Bloom filter (Pieter Wuille)
aa62b68 Benchmark rolling bloom filter (Pieter Wuille)
2016-05-09 08:52:31 +02:00
Pavel Janík 166e4b0dfa Notify other serviceQueue thread we are finished to prevent deadlocks. 2016-05-06 20:44:40 +02:00
Pavel Janík db18ab28c7 Reenable multithread scheduler test. 2016-05-06 20:44:39 +02:00
instagibbs addb9d2a09 Remove state arg from ReconsiderBlock 2016-05-06 12:53:23 -04:00
Pedro Branco 0bf6f30262 Prevent multiple calls to ExtractDestination 2016-05-06 10:50:02 +01:00
Jonas Schnelli 04eaa90958
Add more clear interface for CoinControl.h regarding individual feerate 2016-05-06 11:01:50 +02:00
Wladimir J. van der Laan 65aecda52d
Merge #8011: don't run ThreadMessageHandler at lowered priority
e53e7c5 don't run ThreadMessageHandler at lowered priority (Kaz Wesley)
2016-05-06 10:04:09 +02:00
Wladimir J. van der Laan efee32f381
Merge #7815: Break circular dependency main ↔ txdb
99e7075 Break circular dependency main ↔ txdb (Wladimir J. van der Laan)
2016-05-06 10:03:09 +02:00
21E14 a4d5855a25 CCoinsViewErrorCatcher raison-d-etre 2016-05-06 00:10:49 -04:00
Kaz Wesley e53e7c5473 don't run ThreadMessageHandler at lowered priority
There's no clear reason ThreadMessageHandler should be low priority.
Fixes #8010 (priority inversion).
2016-05-05 13:25:35 -07:00
Cory Fields cca221fd21 net: Drop CNodeRef for AttemptToEvictConnection
Locking for each operation here is unnecessary, and solves the wrong problem.
Additionally, it introduces a problem when cs_vNodes is held in an owning
class, to which invididual CNodeRefs won't have access.

These should be weak pointers anyway, once vNodes contain shared pointers.

Rather than using a refcounting class, use a 3-step process instead.

1. Lock vNodes long enough to snapshot the fields necessary for comparing
2. Unlock and do the comparison
3. Re-lock and mark the resulting node for disconnection if it still exists
2016-05-05 13:22:25 -04:00
Cory Fields 563f375cde net: use the exposed GetNodeSignals() rather than g_signals directly 2016-05-05 13:22:25 -04:00
Cory Fields 9faa4902cd net: remove unused set 2016-05-05 13:22:24 -04:00
Cory Fields 52cbce287a net: don't import std namespace
This file is about to be broken up into chunks and moved around. Drop the
namespace now rather than requiring other files to use it.
2016-05-05 13:22:24 -04:00
Wladimir J. van der Laan 006cdf64dc
Merge #7907: Optimize and Cleanup CScript::FindAndDelete
d1d7775 Improve worst-case behavior of CScript::FindAndDelete (Patrick Strateman)
e2a30bc Unit test for CScript::FindAndDelete (Gavin Andresen)
c0f660c Replace c-style cast with c++ style static_cast. (Patrick Strateman)
ec9ad5f Replace memcmp with std::equal in CScript::FindAndDelete (Patrick Strateman)
2016-05-05 19:01:32 +02:00
Wladimir J. van der Laan 3b9a0bf41f
Merge #7840: Several performance and privacy improvements to inv/mempool handling
b559914 Move bloom and feerate filtering to just prior to tx sending. (Gregory Maxwell)
4578215 Return mempool queries in dependency order (Pieter Wuille)
ed70683 Handle mempool requests in send loop, subject to trickle (Pieter Wuille)
dc13dcd Split up and optimize transaction and block inv queues (Pieter Wuille)
f2d3ba7 Eliminate TX trickle bypass, sort TX invs for privacy and priority. (Gregory Maxwell)
2016-05-05 13:14:40 +02:00
Wladimir J. van der Laan d51618e481
Merge #7966: http: Do a pending c++11 simplification handling work items
f0188f9 http: use std::move to move HTTPRequest into HTTPWorkItem (Wladimir J. van der Laan)
37b2137 http: Change boost::scoped_ptr to std::unique_ptr in HTTPRequest (Wladimir J. van der Laan)
f97b410 http: Add log message when work queue is full (Wladimir J. van der Laan)
091d6e0 http: Do a pending c++11 simplification (Wladimir J. van der Laan)
2016-05-05 12:57:31 +02:00
Wladimir J. van der Laan 0630353323
Merge #7953: Create signmessagewithprivkey rpc
7db0ecb Test for signing messages (Andrew Chow)
f90efbf Create signmessagewithprivkey rpc (Andrew)
2016-05-05 12:54:14 +02:00
Wladimir J. van der Laan e8d917591f
Merge #7977: [trivial] Add missing const qualifiers.
f7c4f79 [trivial] Add missing const qualifiers. (Daniel Kraft)
2016-05-05 12:52:34 +02:00
Wladimir J. van der Laan f0188f9178 http: use std::move to move HTTPRequest into HTTPWorkItem
Thanks to Cory Fields for the idea.
2016-05-05 08:27:12 +02:00
Wladimir J. van der Laan 37b21372a0 http: Change boost::scoped_ptr to std::unique_ptr in HTTPRequest
No need for boost here.
2016-05-05 08:27:12 +02:00
Wladimir J. van der Laan f97b410fdd http: Add log message when work queue is full
More useful error reporting.
2016-05-05 08:27:12 +02:00
Wladimir J. van der Laan 091d6e0499 http: Do a pending c++11 simplification
Use std::unique_ptr for handling work items.

This makes the code more RAII and, as mentioned in the comment, is what
I planned when I wrote the code in the first place.
2016-05-05 08:27:12 +02:00
Wladimir J. van der Laan 42a6753382
Merge #8000: tinyformat: force USE_VARIADIC_TEMPLATES
08d7b56 util: switch LogPrint and error to variadic templates (Wladimir J. van der Laan)
9eaa0af tinyformat: force USE_VARIADIC_TEMPLATES (Wladimir J. van der Laan)
2016-05-05 08:20:03 +02:00
EthanHeilman 1475ecf611 Fix de-serialization bug where AddrMan is corrupted after exception
* CAddrDB modified so that when de-serialization code throws an exception Addrman is reset to a clean state
* CAddrDB modified to make unit tests possible
* Regression test created to ensure bug is fixed
* StartNode modifed to clear adrman if CAddrDB::Read returns an error code.
2016-05-04 18:55:01 -04:00
Wladimir J. van der Laan 8206835cc1
Merge #7974: More comments on the design of AttemptToEvictConnection.
d90351f More comments on the design of AttemptToEvictConnection. (Gregory Maxwell)
2016-05-04 15:52:13 +02:00
Wladimir J. van der Laan 08d7b563e9 util: switch LogPrint and error to variadic templates 2016-05-04 14:21:04 +02:00
Wladimir J. van der Laan 9eaa0afa6e tinyformat: force USE_VARIADIC_TEMPLATES
Now that we started using c++11, force use of variadic templates.

The autodetection may be wonky on some compilers, see discussion
[here](https://github.com/bitcoin/bitcoin/pull/7982#issuecomment-216222357)
and is unnecessary for us anyhow.
2016-05-04 11:37:10 +02:00
Wladimir J. van der Laan 559fbae8c6
Merge #7982: build: No need to check for leveldb atomics
de98290 build: No need to check for leveldb atomics (Cory Fields)
2016-05-04 11:34:42 +02:00
Puru 9a8a7d0115 bitcoin-cli.cpp: Use symbolic constant for exit code 2016-05-02 22:33:04 +05:45
Wladimir J. van der Laan 03cf6e8675
Merge #7959: fix race that could fail to persist a ban
f4ac02e fix race that could fail to persist a ban (Kaz Wesley)
2016-05-02 14:48:50 +02:00
Wladimir J. van der Laan 86b800c6a2
Merge #7964: Minor changes for c++11 consistency
07e4edb auto_ptr → unique_ptr (Wladimir J. van der Laan)
073225c chain: define enum used as bit field as uint32_t (Wladimir J. van der Laan)
2016-05-02 13:08:02 +02:00
Cory Fields de98290155 build: No need to check for leveldb atomics
They're guaranteed with c++11
2016-04-30 17:46:35 -04:00
21E14 c8b92486c4 Remove obsolete reference to CValidationState from UpdateCoins. 2016-04-30 15:14:22 -04:00
Daniel Kraft f7c4f79f07 [trivial] Add missing const qualifiers.
Add some const qualifiers to references that are not modified and should
be marked as const.
2016-04-30 19:25:00 +02:00
Gregory Maxwell d90351f050 More comments on the design of AttemptToEvictConnection.
Some developers clearly don't get this and have been posting
 "improvements" that create clear vulnerabilities.  It should
 have been better explained in the code, since the design
 is somewhat subtle and getting it right is important.
2016-04-29 23:15:23 +00:00
MarcoFalke 0ad1041904
Merge #7807: Fixed miner test values, gave constants for less error-prone values.
f8536a6 Corrected values (instagibbs)
617deeb Gave miner test values constants for less error-prone values. (instagibbs)
2016-04-29 22:02:59 +02:00
Jonas Schnelli 3b35e4896b
[RPC] add feerate option to fundrawtransaction 2016-04-28 22:04:07 +02:00
Wladimir J. van der Laan 20f9ecd343
Merge #7962: CalculateNextWorkRequired Cleanup
c7aac2d Deprecating the remaining LogPrintf dependencies that were made obsolete in PR #7459. (21E14)
2016-04-28 15:33:28 +02:00
Pieter Wuille 1953c40aa9 More efficient bitsliced rolling Bloom filter
This patch changes the implementation from one that stores 16 2-bit integers
in one uint32_t's, to one that stores the first bit of 64 2-bit integers in
one uint64_t and the second bit in another. This allows for 450x faster
refreshing and 2.2x faster average speed.
2016-04-28 14:56:32 +02:00
Pieter Wuille aa62b68745 Benchmark rolling bloom filter 2016-04-28 14:56:32 +02:00
Wladimir J. van der Laan 5725807402
Merge #7926: [RPC] push back getaddednodeinfo dead value
9c0bcb6 push back getaddednodeinfo dead value (instagibbs)
2016-04-28 14:35:40 +02:00
Wladimir J. van der Laan a9c8b744e8
Merge #7952: Log invalid block hash to make debugging easier.
61c0170 Log invalid block hash to make debugging easier. (Pavel Janík)
2016-04-28 13:53:01 +02:00
Wladimir J. van der Laan 07e4edb056 auto_ptr → unique_ptr
Change the few occurrences of the deprecated `auto_ptr` to c++11 `unique_ptr`.
Silences the deprecation warnings.

Also add a missing `std::` for consistency.
2016-04-28 13:43:32 +02:00
Wladimir J. van der Laan 073225cb01 chain: define enum used as bit field as uint32_t
Bitwise logic combined with `<` with undefined signedness will
potentially results in undefined behavior. Fix this by defining the type
as a c++11 typed enum.

Fixes #6017.
2016-04-28 13:35:16 +02:00
Wladimir J. van der Laan d9594bfe0c
Merge #7514: Fix IsInitialBlockDownload for testnet
8aa7226 Fix IsInitialBlockDownload to play nice with testnet (jmacwhyte)
2016-04-28 12:55:35 +02:00
Wladimir J. van der Laan 574ddc63d6
Merge #7939: qt: Make it possible to show details for multiple transactions
f135e3c qt: Add transaction hash to details window title (Wladimir J. van der Laan)
17a6a21 qt: Make it possible to show details for multiple transactions (Wladimir J. van der Laan)
2016-04-28 12:21:29 +02:00
21E14 c7aac2d557 Deprecating the remaining LogPrintf dependencies that were made obsolete in PR #7459. 2016-04-27 22:36:45 -04:00
Kaz Wesley f4ac02ee7c fix race that could fail to persist a ban
DumpBanList currently does this:
  - with lock: take a copy of the banmap
  - perform I/O (write out the banmap)
  - with lock: mark the banmap non-dirty
If a new ban is added during the I/O operation, it may never be persisted to
disk.

Reorder operations so that the data to be persisted cannot be older than the
time at which the banmap was marked non-dirty.
2016-04-27 09:41:13 -07:00
Pavel Janík b02119e463 Remove useless argument to AlertNotify.
It is always 'true', so useless.
2016-04-27 18:04:02 +02:00
Suhas Daftuar 383fc10ebb Only use AddInventoryKnown for transactions
filterInventoryKnown is only used when relaying transactions,
so stop adding block hashes to the filter.
2016-04-27 09:57:02 -04:00
Jonas Schnelli e59336fbf9
[bitcoin-tx] allow to set nSequence number over the in= command 2016-04-27 15:42:17 +02:00
Jonas Schnelli a946bb6b18
[RPC] createrawtransaction: add option to set the sequence number per input 2016-04-27 15:42:14 +02:00
Andrew f90efbfeef Create signmessagewithprivkey rpc
New rpc 'signmessagewithprivkey' which takes a private key to sign a message without using the wallet.
2016-04-27 06:43:39 -04:00
Wladimir J. van der Laan 6030625631 test: Add more thorough test for dbwrapper iterators
I made a silly mistake in a database wrapper where keys
were sorted by char instead of uint8_t. As x86 char is signed
the sorting for the block index database was messed up, resulting
in a segfault due to missing records.

Add a test to catch:
- Wrong sorting
- Seeking errors
- Iteration result not complete
2016-04-27 11:11:36 +02:00
Wladimir J. van der Laan 84c13e759d chain: Add assertion in case of missing records in index db 2016-04-27 11:11:36 +02:00
Pavel Janík 61c01706cd Log invalid block hash to make debugging easier. 2016-04-26 22:22:59 +02:00
Wladimir J. van der Laan f135e3c943 qt: Add transaction hash to details window title 2016-04-26 16:05:10 +02:00
Wladimir J. van der Laan e26b62093a
Merge #7933: Fix OOM when deserializing UTXO entries with invalid length
1e44169 Add tests for CCoins deserialization (Pieter Wuille)
5d0434d Fix OOM bug: UTXO entries with invalid script length (Pieter Wuille)
4bf631e CDataStream::ignore Throw exception instead of assert on negative nSize. (Patrick Strateman)
4f87af6 Treat overly long scriptPubKeys as unspendable (Pieter Wuille)
f8e6fb1 Introduce constant for maximum CScript length (Pieter Wuille)
2016-04-26 13:23:05 +02:00
Kaz Wesley 719de56ab2 lock cs_main for chainActive
ActivateBestChain uses chainActive after releasing the lock; reorder operations
to move all access to synchronized object into existing LOCK(cs_main) block.
2016-04-25 18:12:30 -07:00
Kaz Wesley efb54ba065 lock cs_main for State/Misbehaving
ProcessMessage calls State(...) and Misbehaving(...) without holding the
required lock; add LOCK(cs_main) blocks.
2016-04-25 18:06:44 -07:00
Chris Stewart 62a9abd12b Fixing comment in script_test.json test case 2016-04-25 11:08:10 -05:00
Wladimir J. van der Laan 17a6a21786 qt: Make it possible to show details for multiple transactions
A small GUI annoyance for me has always been that it's impossible to
have multiple transaction detail windows open, for example to compare
transactions.

This patch makes the window non-modal so that it is possible to open
transaction details at will.
2016-04-25 16:06:07 +02:00
Wladimir J. van der Laan 46880ed2fd
Merge #7688: List solvability in listunspent output and improve help
c3932b3 List solvability in listunspent output and improve help (Pieter Wuille)
2016-04-25 14:46:29 +02:00
Pieter Wuille 1e44169f0e Add tests for CCoins deserialization 2016-04-25 14:42:07 +02:00
Pieter Wuille 5d0434d13d Fix OOM bug: UTXO entries with invalid script length 2016-04-25 14:42:07 +02:00
Patrick Strateman 4bf631e5e4 CDataStream::ignore Throw exception instead of assert on negative nSize.
Previously disk corruption would cause an assert instead of an exception.
2016-04-25 14:42:07 +02:00
Pieter Wuille 4f87af6fc7 Treat overly long scriptPubKeys as unspendable 2016-04-25 14:22:30 +02:00
Pieter Wuille f8e6fb1800 Introduce constant for maximum CScript length 2016-04-25 14:22:30 +02:00
Wladimir J. van der Laan f9c2ac7232
Merge #7927: Minor changes to dbwrapper to simplify support for other databases
869cf12 dbwrapper: Move `HandleError` to `dbwrapper_private` (Wladimir J. van der Laan)
b69836d dbwrapper: Pass parent CDBWrapper into CDBBatch and CDBIterator (Wladimir J. van der Laan)
878bf48 dbwrapper: Remove CDBWrapper::GetObfuscateKeyHex (Wladimir J. van der Laan)
74f7b12 dbwrapper: Remove throw keywords in function signatures (Wladimir J. van der Laan)
2016-04-25 12:46:23 +02:00
Patrick Strateman fb26bf0ea3 CAddrMan::Deserialize handle corrupt serializations better. 2016-04-24 01:30:47 -07:00
Wladimir J. van der Laan 869cf1234a dbwrapper: Move HandleError to dbwrapper_private
HandleError is implementation-specific.
2016-04-23 09:32:25 +02:00
Wladimir J. van der Laan b69836d6ff dbwrapper: Pass parent CDBWrapper into CDBBatch and CDBIterator
Pass parent wrapper directly instead of obfuscation key. This
makes it possible for other databases which re-use this code
to use other properties from the database.

Add a namespace dbwrapper_private for private functions to be used
only in dbwrapper.h/cpp and dbwrapper_tests.
2016-04-23 09:32:25 +02:00
Wladimir J. van der Laan 878bf480a3 dbwrapper: Remove CDBWrapper::GetObfuscateKeyHex
It is an unnecessary method as it is used only two times
and only internally, and the whole implementation is
HexStr(obfuscate_key).
2016-04-23 09:32:25 +02:00
Wladimir J. van der Laan 74f7b1273c dbwrapper: Remove throw keywords in function signatures
Using throw() specifications in function signatures is not only
not required in C++, it is considered deprecated for
[various reasons](https://stackoverflow.com/questions/1055387/throw-keyword-in-functions-signature).
It is not implemented by any of the common C++ compilers. The usage is
also inconsistent with the rest of the source code.
2016-04-23 09:32:25 +02:00
instagibbs 9c0bcb617b push back getaddednodeinfo dead value 2016-04-22 11:20:06 -07:00
Wladimir J. van der Laan f59dceb44f qt: Fix out-of-tree GUI builds
Without this patch:

- When I compile the GUI from the bitcoin directory itself, it works as
  expected.

- When I build the GUI in an out-of-tree build, I cannot get it to
  select tabs. When I click, say the "Receive" tab nothing happens,
  the button selects but it doesn't switch the page. The rest - even
  the debug window - seems to work.

See full discussion here:
https://github.com/bitcoin/bitcoin/pull/7911#issuecomment-212413442

This turned out to be caused by a mismatch in the arguments to moc,
preventing it from finding `bitcoin-config.h`. Fix this by passing
`$(DEFAULT_INCLUDES)` to it, which gets set to the appropriate
path by autoconf itself.
2016-04-22 09:21:09 +02:00
Wladimir J. van der Laan 351abf9e03
Merge #7911: leveldb: integrate leveldb into our buildsystem
a4625ac leveldb: integrate leveldb into our buildsystem (Cory Fields)
2016-04-22 09:16:17 +02:00
Wladimir J. van der Laan 90653bc91d
Merge #7922: CBase58Data::SetString: cleanse the full vector
5770449 CBase58Data::SetString: cleanse the full vector (Kaz Wesley)
2016-04-22 09:04:16 +02:00
Wladimir J. van der Laan 76176823ba
Merge #7919: Fix headers announcements edge case
3a99fb2 Fix headers announcements edge case (Suhas Daftuar)
2016-04-22 08:40:22 +02:00
Wladimir J. van der Laan 0c95ebce7e
Merge #7816: [Wallet] slighly refactor GetOldestKeyPoolTime()
9f7336b [Wallet] slightly refactor GetOldestKeyPoolTime() (Jonas Schnelli)
2016-04-22 08:36:56 +02:00
Kaz Wesley 57704499be CBase58Data::SetString: cleanse the full vector
SetString seems to be passing the length of the wrong variable to
memory_cleanse, resulting in the last byte of the temporary buffer not being
securely erased.
2016-04-21 18:28:57 -07:00
Patrick Strateman d1d7775587 Improve worst-case behavior of CScript::FindAndDelete
Thanks to Sergio Lerner for identifying this issue and suggesting this kind of solution.
2016-04-21 17:24:36 -07:00
Wladimir J. van der Laan 3689ac4634
Merge #7916: Explicitly pass CChainParams& to DisconnectTip()
176869f Explicitly pass CChainParams to ConnectBlock (face)
d0a6353 Pass CChainParams to DisconnectTip() (face)
764d237 Globals: Explicitly pass const CChainParams& to UpdateTip() (Jorge Timón)
2016-04-21 14:54:31 +02:00
Pieter Wuille bafd075c5e
Merge #7913: Fix for incorrect locking in GetPubKey() (keystore.cpp)
220f950 Fix for incorrect locking in GetPubKey() (keystore.cpp) (Yuri Zhykin)
2016-04-21 13:57:07 +02:00
Pieter Wuille 7daa3adb24
Merge #7868: net: Split DNS resolving functionality out of net structures
d39f5b4 net: disable resolving from storage structures (Cory Fields)
3675699 net: resolve outside of storage structures (Cory Fields)
a98cd1f net: manually resolve dns seed sources (Cory Fields)
e9fc71e net: require lookup functions to specify all arguments (Cory Fields)
2016-04-21 13:48:13 +02:00
Gregory Maxwell b559914753 Move bloom and feerate filtering to just prior to tx sending.
This will avoid sending more pointless INVs around updates, and
 prevents using filter updates to timetag transactions.

Also adds locking for fRelayTxes.
2016-04-21 00:33:56 +02:00
Pieter Wuille 4578215e7f Return mempool queries in dependency order 2016-04-21 00:33:56 +02:00
Pieter Wuille ed7068302c Handle mempool requests in send loop, subject to trickle
By eliminating queued entries from the mempool response and responding only at
trickle time, this makes the mempool no longer leak transaction arrival order
information (as the mempool itself is also sorted)-- at least no more than
relay itself leaks it.
2016-04-21 00:33:56 +02:00
Pieter Wuille dc13dcd2be Split up and optimize transaction and block inv queues 2016-04-21 00:33:51 +02:00
Suhas Daftuar 3a99fb2cb1 Fix headers announcements edge case
Previously we would assert that if every block in vBlockHashesToAnnounce is in
chainActive, then the blocks to be announced must connect.  However, there are
edge cases where this assumption could be violated (eg using invalidateblock /
reconsiderblock), so just check for this case and revert to inv-announcement
instead.
2016-04-20 14:19:03 -04:00
Cory Fields d39f5b425d net: disable resolving from storage structures
CNetAddr/CService/CSubnet can no longer resolve DNS.
2016-04-20 13:08:19 -04:00
Cory Fields 367569926a net: resolve outside of storage structures
Rather than allowing CNetAddr/CService/CSubNet to launch DNS queries, require
that addresses are already resolved.

This greatly simplifies async resolve logic, and makes it harder to
accidentally leak DNS queries.
2016-04-20 13:08:19 -04:00
Cory Fields a98cd1fc86 net: manually resolve dns seed sources
Note: Some seeds aren't actually returning an IP for their name entries, so
they're being added to addrman with a source of [::].

This commit shouldn't change that behavior, for better or worse.
2016-04-20 13:07:19 -04:00
face 176869f9b3 Explicitly pass CChainParams to ConnectBlock 2016-04-20 17:05:15 +03:00
Yuri Zhykin 220f950ab1 Fix for incorrect locking in GetPubKey() (keystore.cpp) 2016-04-20 16:04:28 +03:00
Gregory Maxwell f2d3ba7386 Eliminate TX trickle bypass, sort TX invs for privacy and priority.
Previously Bitcoin would send 1/4 of transactions out to all peers
 instantly.  This causes high overhead because it makes >80% of
 INVs size 1.  Doing so harms privacy, because it limits the
 amount of source obscurity a transaction can receive.

These randomized broadcasts also disobeyed transaction dependencies
 and required use of the orphan pool.  Because the orphan pool is
 so small this leads to poor propagation for dependent transactions.

When the bypass wasn't in effect, transactions were sent in the
 order they were received.  This avoided creating orphans but
 undermines privacy fairly significantly.

This commit:
 Eliminates the bypass. The bypass is replaced by halving the
  average delay for outbound peers.

 Sorts candidate transactions for INV by their topological
  depth then by their feerate (then hash); removing the
  information leakage and providing priority service to
  higher fee transactions.

 Limits the amount of transactions sent in a single INV to
  7tx/sec (and twice that for outbound); this limits the
  harm of low fee transaction floods, gives faster relay
  service to higher fee transactions. The 7 sounds lower
  than it really is because received advertisements need
  not be sent, and because the aggregate rate is multipled
  by the number of peers.
2016-04-20 10:26:37 +02:00
Gavin Andresen e2a30bc9a9 Unit test for CScript::FindAndDelete 2016-04-19 13:22:45 -07:00
Patrick Strateman c0f660c3a3 Replace c-style cast with c++ style static_cast. 2016-04-19 13:22:20 -07:00
Patrick Strateman ec9ad5f199 Replace memcmp with std::equal in CScript::FindAndDelete
Function is stl; std::equal just makes more sense.
2016-04-19 13:22:03 -07:00
Cory Fields a4625acbf8 leveldb: integrate leveldb into our buildsystem
leveldb's buildsystem causes us a few problems:
- breaks out-of-tree builds
- forces flags used for some tools
- limits cross builds

Rather than continuing to add wrappers around it, simply integrate it into our
build.
2016-04-19 14:37:15 -04:00
face d0a6353dec Pass CChainParams to DisconnectTip() 2016-04-19 20:33:04 +03:00
Jorge Timón 764d237772 Globals: Explicitly pass const CChainParams& to UpdateTip() 2016-04-19 20:33:04 +03:00
Wladimir J. van der Laan 04a2937357
Merge #7787: [Moveonly] Create ui_interface.cpp
fa10ce6 Move ui_interface.cpp to libbitcoin_server_a_SOURCES (MarcoFalke)
fabbf80 [ui] Move InitError, InitWarning, AmountErrMsg (MarcoFalke)
2016-04-19 16:10:57 +02:00
MarcoFalke fa10ce6a6d Move ui_interface.cpp to libbitcoin_server_a_SOURCES
It is only needed by bitcoind and bitcoin-qt
2016-04-19 16:07:46 +02:00
Wladimir J. van der Laan a1eb344ba8
Merge #7762: [ZMQ] append a message sequence number to every ZMQ notification
0b25a9f [ZMQ] append a message sequence number to every ZMQ notification (Jonas Schnelli)
de821d5 [ZMQ] refactor message string (Jonas Schnelli)
2016-04-19 15:44:38 +02:00
Jonas Schnelli 0b25a9fb42
[ZMQ] append a message sequence number to every ZMQ notification 2016-04-19 15:32:11 +02:00
Wladimir J. van der Laan 187186b0fe
Merge #7905: test: move accounting_tests and rpc_wallet_tests to wallet/test
b30fb42 test: Rename wallet.dat to wallet_test.dat (Wladimir J. van der Laan)
a25a4f5 wallet_ismine.h → script/ismine.h (Wladimir J. van der Laan)
f4eae2d test: Create test fixture for wallet (Wladimir J. van der Laan)
de39c95 test: move accounting_tests and rpc_wallet_tests to wallet/test (Wladimir J. van der Laan)
2016-04-19 10:49:48 +02:00
Wladimir J. van der Laan 4205ad7ca2
Merge #7827: Speed up getchaintips.
87049e8 Speed up getchaintips. (mrbandrews)
2016-04-19 10:44:47 +02:00
Wladimir J. van der Laan fc9e3346e6
Merge #7904: txdb: Fix assert crash in new UTXO set cursor
a3310b4 txdb: Fix assert crash in new UTXO set cursor (Wladimir J. van der Laan)
2016-04-19 10:23:38 +02:00
mrbandrews 87049e832d Speed up getchaintips. 2016-04-18 12:10:47 -04:00
Wladimir J. van der Laan b30fb42e49 test: Rename wallet.dat to wallet_test.dat
Indicate that the file name is not hardcoded, and a little bit of safety
so that it never nukes the main wallet.

Suggestion by Marco Falke.
2016-04-18 15:17:08 +02:00
Wladimir J. van der Laan a25a4f5b04 wallet_ismine.h → script/ismine.h
Removes conditional dependency of `src/test` on wallet.

Makes multisig and P2SH tests complete without wallet built-in.
2016-04-18 15:14:36 +02:00
Wladimir J. van der Laan f4eae2d910 test: Create test fixture for wallet
Removes all the `#ifdef ENABLE_WALLET` from `test_bitcoin` by
making the wallet tests use their own fixture.
2016-04-18 14:57:42 +02:00
Wladimir J. van der Laan d289950180
Merge #7900: fix spelling mistake
3107c47 fix spelling mistake (Chris Moore)
2016-04-18 14:15:12 +02:00
Wladimir J. van der Laan 9eb7565cdd
Merge #7897: add missing newline
dc0693f add missing newline (Chris Moore)
2016-04-18 14:14:30 +02:00
Wladimir J. van der Laan de39c95c24 test: move accounting_tests and rpc_wallet_tests to wallet/test
Move the two other wallet tests to where they belong.
2016-04-18 14:04:40 +02:00
Wladimir J. van der Laan 88616d2008
Merge #7848: Divergence between 32- and 64-bit when hashing >4GB affects gettxoutsetinfo
28b400f doc: update release-notes for `gettxoutsetinfo` change (Wladimir J. van der Laan)
76212bb rpc: make sure `gettxoutsetinfo` hash has txids (Wladimir J. van der Laan)
9ad1a51 crypto: bytes counts are 64 bit (Wladimir J. van der Laan)
2016-04-18 12:48:09 +02:00
Wladimir J. van der Laan a3310b4d48 txdb: Fix assert crash in new UTXO set cursor
Remove the mistaken assumption that GetKey returning false signifies
an internal database issue. It will return false when the key cannot
be deserialized into the (char,uint256) stanza, which indicates
that the cursor has reached a different kind of key.

Fixes bug #7890 introduced in #7756.
2016-04-18 12:05:32 +02:00
Cory Fields e9fc71e5fa net: require lookup functions to specify all arguments
To make it clear where DNS resolves are happening
2016-04-17 17:37:36 -04:00
Chris Moore 3107c475a7 fix spelling mistake 2016-04-17 00:01:49 -07:00
Chris Moore dc0693f637 add missing newline
Without the newline I see "bein" where the two lines are concatenated:

Note that all inputs selected must be of standard form and P2SH scripts must *bein* the wallet using importaddress or addmultisigaddress (to calculate fees).
2016-04-16 13:42:28 -07:00
Chris Moore fc95f6ecb6 fix typo in help text
'in which the transaction is included in'
2016-04-16 13:35:42 -07:00
Kaz Wesley a7af72a697 prevector::swap: fix (unreached) data corruption
swap was using an incorrect condition to determine when to apply an optimization
(not swapping the full direct[] when swapping two indirect prevectors).

Rather than correct the optimization I'm removing it for simplicity. Removing
this optimization minutely improves performance in the typical (currently only)
usage of member swap(), which is swapping with a freshly value-initialized
object.
2016-04-16 08:05:11 -07:00
Kaz Wesley 4ed41a2b61 test prevector::swap
- add a swap operation to prevector tests (fails due to broken prevector::swap)
- fix 2 prevector test operation conditions that were impossible
2016-04-16 08:05:11 -07:00
Kaz Wesley 1e2c29f263 prevector: destroy elements only via erase()
Fixes a bug in which pop_back did not call the deleted item's destructor.

Using the most general erase() implementation to implement all the others
prevents similar bugs because the coupling between deallocation and destructor
invocation only needs to be maintained in one place.
Also reduces duplication of complex memmove logic.
2016-04-16 08:05:11 -07:00
Wladimir J. van der Laan 76212bbc6a rpc: make sure gettxoutsetinfo hash has txids
The key (transaction id for the following outputs) should be serialized
to the HashWriter.

This is a problem as it means different transactions in the same
position with the same outputs will potentially result in the same hash.

Fixes primary concern of #7758.
2016-04-15 18:03:05 +02:00
Wladimir J. van der Laan 99e70751f2 Break circular dependency main ↔ txdb
Break the circular dependency between main and txdb by:

- Moving `CBlockFileInfo` from `main.h` to `chain.h`. I think this makes
  sense, as the other block-file stuff is there too.

- Moving `CDiskTxPos` from `main.h` to `txdb.h`. This type seems
  specific to txdb.

- Pass a functor `insertBlockIndex` to `LoadBlockIndexGuts`. This leaves
  it up to the caller how to insert block indices.
2016-04-15 17:48:38 +02:00
Wladimir J. van der Laan 9ad1a51857 crypto: bytes counts are 64 bit
Byte counts for SHA256, SHA512, SHA1 and RIPEMD160 must be 64 bits.
`size_t` has a different size per platform, causing divergent results
when hashing more than 4GB of data.
2016-04-15 16:44:23 +02:00
Wladimir J. van der Laan 9e47fcec17
Merge #7756: Add cursor to iterate over utxo set, use this in gettxoutsetinfo
509cb00 txdb: Add Cursor() method to CCoinsView to iterate over UTXO set (Wladimir J. van der Laan)
2016-04-15 16:43:21 +02:00
Wladimir J. van der Laan 509cb006d5 txdb: Add Cursor() method to CCoinsView to iterate over UTXO set
Add a method Cursor() to CCoinsView that returns a cursor which can be
used to iterate over the whole UTXO set.

- rpc: Change gettxoutsetinfo to use new Cursor method

- txdb: Remove GetStats method - Now that GetStats is implemented in
  terms of Cursor, remove it.
2016-04-15 16:33:05 +02:00
João Barbosa f2d0944eb3 Add lockUnspents option to fundrawtransaction 2016-04-15 15:36:05 +02:00
João Barbosa af4fe7fd12 Add change options to fundrawtransaction 2016-04-15 15:36:05 +02:00
João Barbosa 41e835dd50 Add strict flag to RPCTypeCheckObj
Strict flag forces type check on all object keys.
2016-04-15 14:55:52 +02:00
Jonas Schnelli de821d56e1
[ZMQ] refactor message string 2016-04-15 13:23:16 +02:00
Wladimir J. van der Laan 64e71b3721
Merge #7856: Only send one GetAddr response per connection.
66b0724 Only send one GetAddr response per connection. (Gregory Maxwell)
2016-04-15 09:03:17 +02:00
Wladimir J. van der Laan efc059322c
Merge #7877: Change mapRelay to store CTransactions
38c3102 Change mapRelay to store CTransactions (Pieter Wuille)
2016-04-15 08:59:40 +02:00
Wladimir J. van der Laan 48c5adfbce
Merge #6215: add bip32 pub key serialization
90604f1 add bip32 pubkey serialization (Jonas Schnelli)
2016-04-15 07:59:38 +02:00
Jonas Schnelli 90604f16af
add bip32 pubkey serialization
CExtPubKey should be serializable like CPubKey
2016-04-14 20:56:33 +02:00
MarcoFalke fa7abe0a00 [test] bctest.py: Revert faa41ee 2016-04-14 19:39:53 +02:00
Wladimir J. van der Laan e6a4d48a9b
Merge #7874: Improve AlreadyHave
c6cb6f7 Avoid unnecessary database access for unknown transactions (Alex Morcos)
2016-04-14 17:54:42 +02:00
Wladimir J. van der Laan 6ef5e000a2
Merge #7853: [qa] py2: Unfiddle strings into bytes explicitly
faa41ee [qa] py2: Unfiddle strings into bytes explicitly (MarcoFalke)
2016-04-14 17:40:31 +02:00
Wladimir J. van der Laan 430fffefaa
Merge #7812: Tiny refactor of IsRBFOptIn, avoid exception
4f7c959 Refactor IsRBFOptIn, avoid exception (Jonas Schnelli)
2016-04-14 16:35:02 +02:00
Pieter Wuille 38c310299c Change mapRelay to store CTransactions 2016-04-14 16:24:56 +02:00
Wladimir J. van der Laan d97101e5a8
Merge #7842: RPC: do not print minping time in getpeerinfo when no ping received yet
62a6486 RPC: do not print ping info in getpeerinfo when no ping received yet, fix help (Pavel Janík)
2016-04-14 16:09:53 +02:00
Wladimir J. van der Laan 491171f929
Merge #7846: Clean up lockorder data of destroyed mutexes
5eeb913 Clean up lockorder data of destroyed mutexes (Pieter Wuille)
2016-04-14 15:47:08 +02:00
Wladimir J. van der Laan 97d0b9889f
Merge #7862: Use txid as key in mapAlreadyAskedFor
7e91f63 Use txid as key in mapAlreadyAskedFor (Suhas Daftuar)
2016-04-14 14:55:01 +02:00
Wladimir J. van der Laan ab8586e667
Merge #7849: tests: add varints_bitpatterns test
4521f00 tests: add varints_bitpatterns test (Wladimir J. van der Laan)
2016-04-14 14:46:13 +02:00
Wladimir J. van der Laan 229a17ca91
Merge #7850: Removed call to TryCreateDirectory from GetDefaultDataDir in src/util.cpp.
41dbc48 Removed call to `TryCreateDirectory` from `GetDefaultDataDir` in `src/util.cpp`. (Alexander Regueiro)
2016-04-14 13:38:49 +02:00
Wladimir J. van der Laan 3911a0a1b7
Merge #7818: Refactor script tests
dde46d3 Merge script_valid and script_invalid tests (Pieter Wuille)
009b503 Get rid of expect in script_tests as it's implied by scripterror (Pieter Wuille)
76da761 Make script_error a mandatory 4th field for script_tests (Pieter Wuille)
269281b Fix some misconstructed tests (Pieter Wuille)
d03e466 Fix formatting of NOPs for generated script tests (Pieter Wuille)
c7c6641 Fix JSON pretty printing in script_tests (Pieter Wuille)
2016-04-14 13:27:41 +02:00
Wladimir J. van der Laan 72c54e3883
Merge #7863: getblockchaininfo: make bip9_softforks an object, not an array.
d12760b rpc-tests: handle KeyError nicely in test_framework.py (Rusty Russell)
85c807c getblockchaininfo: make bip9_softforks an object, not an array. (Rusty Russell)
2016-04-14 12:14:42 +02:00
Wladimir J. van der Laan 536b75e946
Merge #7796: [amount] Add support for negative fee rates
facf5a4 [amount] tests: Fix off-by-one mistake (MarcoFalke)
fa2da2c [amount] Add support for negative fee rates (MarcoFalke)
11114a6 [amount] test negative fee rates and full constructor (MarcoFalke)
2016-04-14 12:07:52 +02:00
Alex Morcos c6cb6f7d4c Avoid unnecessary database access for unknown transactions 2016-04-13 16:02:46 -04:00
Rusty Russell 85c807c9ea getblockchaininfo: make bip9_softforks an object, not an array.
We can't change "softforks", but it seems far more logical to use tags
in an object rather than using an "id" field in an array.

For example, to get the csv status before, you need to iterate the
array to find the entry with 'id' field equal to "csv":

   jq '.bip9_softforks | map(select(.id == "csv"))[] | .status'

Now:
   jq '.bip9_softforks.csv.status'

There is no issue with fork names being incompatible with JSON tags,
since we're selecting them ourselves.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-04-13 16:53:52 +09:30
Alexander Regueiro 41dbc4849e Removed call to TryCreateDirectory from GetDefaultDataDir in src/util.cpp.
See https://github.com/bitcoin/bitcoin/issues/7845#issuecomment-207684728.
Also refactored `GetDefaultDataDir` function to return path for Mac in one expression.
2016-04-13 00:11:47 +01:00
Pieter Wuille 514993554c
Merge #7828: Trivial: Globals: Explicitly pass const CChainParams& to ProcessMessage()
bf477bc Trivial: Globals: Explicitly pass const CChainParams& to ProcessMessage() (Jorge Timón)
2016-04-12 15:51:16 +02:00
Suhas Daftuar 7e91f632c7 Use txid as key in mapAlreadyAskedFor
Previously we used the CInv that would be sent to the peer announcing the
transaction as the key, but using the txid instead allows us to decouple the
p2p layer from the application logic (which relies on this map to avoid
duplicate tx requests).
2016-04-11 15:58:01 -04:00
Gregory Maxwell 66b07247a7 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-04-11 01:09:34 +00:00
MarcoFalke faa41ee204 [qa] py2: Unfiddle strings into bytes explicitly 2016-04-10 20:35:57 +02:00
Pieter Wuille 5eeb913d6c Clean up lockorder data of destroyed mutexes
The lockorder potential deadlock detection works by remembering for each
lock A that is acquired while holding another B the pair (A,B), and
triggering a warning when (B,A) already exists in the table.

A and B in the above text are represented by pointers to the CCriticalSection
object that is acquired. This does mean however that we need to clean up the
table entries that refer to any critical section which is destroyed, as it
memory address can potentially be used for another unrelated lock in the future.

Implement this clean up by remembering not only the pairs in forward direction,
but also backward direction. This allows for fast iteration over all pairs that
use a deleted CCriticalSection in either the first or the second position.
2016-04-10 14:27:10 +02:00
MarcoFalke facf5a4947 [amount] tests: Fix off-by-one mistake 2016-04-09 15:28:22 +02:00
Wladimir J. van der Laan 065c6b443f
Merge #7786: Doc: Update isStandardTx comment
03c77fd Doc: Update isStandardTx comment (Matthew English)
2016-04-09 12:13:21 +02:00
Pavel Janík 62a6486058 RPC: do not print ping info in getpeerinfo when no ping received yet, fix help 2016-04-09 09:51:57 +02:00
Wladimir J. van der Laan 4521f005a1 tests: add varints_bitpatterns test
The current tests for varint only check that
serialization-deserialization is a roundtrip. That is a useful test, but
it is also good to check for some exact bit patterns, to prevent a code
change that changes the serialization format from going undetected.

As the varint functions are templated, also check with different types.
2016-04-09 09:17:51 +02:00
Matthew English 03c77fdc14 Doc: Update isStandardTx comment 2016-04-08 23:22:39 +02:00
MarcoFalke fa2da2cb60 [amount] Add support for negative fee rates
Currently negative fee rates are not supported on archs of 64-bit or
more
2016-04-08 19:59:53 +02:00
MarcoFalke 11114a69c8 [amount] test negative fee rates and full constructor 2016-04-08 19:59:44 +02:00
Wladimir J. van der Laan 0afac87e81
Merge #7835: Version 2 transactions remain non-standard until CSV activates
da5fdbb Test relay of version 2 transactions (Suhas Daftuar)
5cb1d8a Tests: move get_bip9_status to util.py (Suhas Daftuar)
e4ba9f6 Version 2 transactions remain non-standard until CSV activates (Suhas Daftuar)
2016-04-08 14:17:54 +02:00
Wladimir J. van der Laan 232592a71f
Merge #7570: Net: Add IPv6 Link-Local Address Support
eda3d92 Net: Add IPv6 Link-Local Address Support (mruddy)
2016-04-08 14:12:54 +02:00
Suhas Daftuar e4ba9f6b04 Version 2 transactions remain non-standard until CSV activates
Before activation, such transactions might not be mined, so don't
allow into the mempool.
2016-04-07 14:33:08 -04:00
instagibbs f8536a62c3 Corrected values 2016-04-07 10:14:49 -04:00
instagibbs 617deeb06e Gave miner test values constants for less error-prone values. 2016-04-07 10:14:44 -04:00
Wladimir J. van der Laan 62b9a557fc Reduce block timeout to 10 minutes
Now that #7804 fixed the timeout handling, reduce the block timeout from
20 minutes to 10 minutes. 20 minutes is overkill.
2016-04-07 13:22:27 +02:00
Wladimir J. van der Laan 1ddf0cee67
Merge #7804: Track block download times per individual block
0e24bbf Self check after the last peer is removed (Pieter Wuille)
2d1d658 Track block download times per individual block (Pieter Wuille)
2016-04-07 13:07:11 +02:00
Pieter Wuille 0e24bbf679 Self check after the last peer is removed 2016-04-07 12:13:10 +02:00
Pieter Wuille 2d1d6581ec Track block download times per individual block
Currently, we're keeping a timeout for each requested block, starting
from when it is requested, with a correction factor for the number of
blocks in the queue.

That's unnecessarily complicated and inaccurate.

As peers process block requests in order, we can make the timeout for each
block start counting only when all previous ones have been received, and
have a correction based on the number of peers, rather than the total number
of blocks.
2016-04-07 12:13:10 +02:00
Jorge Timón bf477bcc79 Trivial: Globals: Explicitly pass const CChainParams& to ProcessMessage() 2016-04-06 16:00:25 +02:00
Jonas Schnelli 9f7336b457
[Wallet] slightly refactor GetOldestKeyPoolTime() 2016-04-06 11:06:25 +02:00
Jonas Schnelli 4f7c959af1
Refactor IsRBFOptIn, avoid exception 2016-04-06 10:59:03 +02:00
Wladimir J. van der Laan 07398e8e9d init: allow shutdown during 'Activating best chain...'
Two-line patch to make it possible to shut down bitcoind cleanly during
the initial ActivateBestChain.

Fixes #6459 (among other complaints).

To reproduce:

- shutdown bitcoind
- copy chainstate
- start bitcoind
- let the chain sync a bit
- shutdown bitcoind
- copy back old chainstate
- start bitcoind
- bitcoind will catch up with all blocks during Init()

(the `boost::this_thread::interruption_point` / `ShutdownRequested()`
dance is ugly, this should be refactored all over bitcoind at some point
when moving from boost::threads to c++11 threads, but it works...)
2016-04-06 10:33:19 +02:00
mruddy eda3d92489 Net: Add IPv6 Link-Local Address Support 2016-04-05 22:26:38 +00:00
Wladimir J. van der Laan 1b2460bd58
Merge #7793: [doxygen] Fix member comments
fada0c4 [doc] Fix doxygen comments for members (MarcoFalke)
2016-04-05 17:49:47 +02:00
Wladimir J. van der Laan 4dc1b3a296
Merge #7788: Use relative paths instead of absolute paths in protoc calls
0087f26 Use relative paths instead of absolute paths (Pavel Janík)
2016-04-05 17:38:41 +02:00
Wladimir J. van der Laan f20d42ed2b UpdateTip: log only one line at most per block
Avoid logging two or more lines per block in UpdateTip by
adding the warning into the UpdateTip log message.
2016-04-05 16:38:01 +02:00
Pieter Wuille dde46d3ae1 Merge script_valid and script_invalid tests 2016-04-05 16:11:47 +02:00
Pieter Wuille 009b503792 Get rid of expect in script_tests as it's implied by scripterror 2016-04-05 15:50:17 +02:00
Pieter Wuille 76da761351 Make script_error a mandatory 4th field for script_tests 2016-04-05 15:46:16 +02:00
Pieter Wuille 269281b7cc Fix some misconstructed tests
They claimed to be testing P2SH scripts with non-push scriptSigs, but
1) they were not enabling P2SH
2) they have push-only scriptSigs

Fix this, and add a few more related cases.
2016-04-05 14:54:37 +02:00
Pieter Wuille d03e46625a Fix formatting of NOPs for generated script tests 2016-04-05 14:54:37 +02:00
Pieter Wuille c7c664191f Fix JSON pretty printing in script_tests 2016-04-05 14:54:33 +02:00
mruddy 92107d574d RPC: add versionHex in getblock and getblockheader JSON results; expand data in getblockchaininfo bip9_softforks field. 2016-04-04 22:21:00 +00:00
Pavel Janík 0087f26848 Use relative paths instead of absolute paths 2016-04-04 19:56:59 +02:00
Jonas Schnelli a9149688f8
Merge #7707: [RPC][QT] UI support for abandoned transactions
8efed3b [Qt] Support for abandoned/abandoning transactions (Jonas Schnelli)
2016-04-04 09:58:33 +02:00
Jonas Schnelli 8efed3bc93
[Qt] Support for abandoned/abandoning transactions 2016-04-04 09:25:34 +02:00
mruddy 60361ca481 RPC: fix generatetoaddress failing to parse address and add unit test 2016-04-03 14:30:00 +00:00
MarcoFalke fada0c422c [doc] Fix doxygen comments for members 2016-04-03 11:58:01 +02:00
MarcoFalke fabbf80f2f [ui] Move InitError, InitWarning, AmountErrMsg 2016-04-02 15:26:21 +02:00
Wladimir J. van der Laan 30c2dd8d05
Merge #7691: [Wallet] refactor wallet/init interaction
25340b7 [Wallet] refactor wallet/init interaction (Jonas Schnelli)
2016-04-02 11:07:39 +02:00
paveljanik a22bde9449 Fix typo: Optimizaton -> Optimization 2016-04-01 21:31:48 +02:00
Jonas Schnelli 6383268893
Merge #7772: Clear the input line after activating autocomplete
ae2156f Clear the input line after activating autocomplete (Pavel Janík)
2016-03-31 14:14:04 +02:00
Wladimir J. van der Laan 3081fb9a31
Merge #7763: Put hex-encoded version in UpdateTip
eff736e Reformat version in UpdateTip and other messages (Pieter Wuille)
2016-03-31 13:24:50 +02:00
Pieter Wuille eff736e55e Reformat version in UpdateTip and other messages
Also remove the hardly-readable nBits from UpdateTip's log message.
2016-03-31 12:28:34 +02:00
Wladimir J. van der Laan 16555b658f
Merge #7766: rpc: Register calls where they are defined
fb8a8cf rpc: Register calls where they are defined (Wladimir J. van der Laan)
2016-03-31 10:55:15 +02:00
Wladimir J. van der Laan fb8a8cf2e6 rpc: Register calls where they are defined
Split out methods to every module, apart from 'help' and 'stop' which
are implemented in rpcserver.cpp itself.

- This makes it easier to add or remove RPC commands - no longer everything that includes
    rpcserver.h has to be rebuilt when there's a change there.
- Cleans up `rpc/server.h` by getting rid of the huge cluttered list of function definitions.
- Removes most of the bitcoin-specific code from rpcserver.cpp and .h.

Continues #7307 for the non-wallet.
2016-03-31 10:48:32 +02:00
Pavel Janík ae2156f123 Clear the input line after activating autocomplete 2016-03-30 20:26:10 +02:00
Wladimir J. van der Laan e8a8f3d4b2
Merge #7648: BIP9 versionbits softfork for BIP68, BIP112 and BIP113
71527a0 Test of BIP9 fork activation of mtp, csv, sequence_lock (NicolasDorier)
19d73d5 Add RPC test for BIP 68/112/113 soft fork. (Alex Morcos)
12c89c9 Policy: allow transaction version 2 relay policy. (BtcDrak)
02c2435 Soft fork logic for BIP68 (BtcDrak)
478fba6 Soft fork logic for BIP113 (BtcDrak)
65751a3 Add CHECKSEQUENCEVERIFY softfork through BIP9 (Pieter Wuille)
2016-03-30 18:59:39 +02:00
Wladimir J. van der Laan 60db51dcb2
Merge #7761: [Qt] remove trailing output-index from transaction-id
7d5e31a [Qt] remove trailing output-index from transaction-id (Jonas Schnelli)
2016-03-30 15:44:43 +02:00
Wladimir J. van der Laan 352fd57729
Merge #7573: P2P: add maxtimeadjustment command line option
e1523ce P2P: add maxtimeadjustment command line option (mruddy)
2016-03-30 09:31:51 +02:00
Wladimir J. van der Laan 5131005e5b
Merge #7723: build: python 3 compatibility
18f05c7 build: python 3 compatibility (Wladimir J. van der Laan)
2016-03-29 17:22:46 +02:00
Wladimir J. van der Laan 18f05c765c build: python 3 compatibility
Ubuntu 16.04 "xenial xerus" does not come with Python 2.x by default.
It is possible to install a python-2.7 package, but this has its own
problem: no `python` or `python2` symlink (see #7717).

This fixes the following scripts to work with python 3:
- `make check` (bctest,py, bitcoin-util-test.py)
- `make translate` (extract_strings_qt.py)
- `make symbols-check` (symbol-check.py)
- `make security-check` (security-check.py)

Explicitly call the python commands using $(PYTHON) instead
of relying on the interpreter line at the top of the scripts.
2016-03-29 17:20:16 +02:00
mruddy e1523cee58 P2P: add maxtimeadjustment command line option 2016-03-29 14:40:00 +00:00
Jonas Schnelli 7d5e31a82b
[Qt] remove trailing output-index from transaction-id
The trailing output-index leads to cases where the user can't look-up the transaction ID in various systems.
2016-03-29 11:23:44 +02:00
Wladimir J. van der Laan b35a591793
Merge #7558: [RPC] Add import/removeprunedfunds rpc call
f1bb13c Added companion removeprunedfunds call. (instagibbs)
7eb7029 Add importprunedfunds rpc call (instagibbs)
2016-03-29 11:15:02 +02:00
Wladimir J. van der Laan 2676e12016
Merge #7742: [Wallet][RPC] add missing abandon status documentation
cef8bdf [Wallet][RPC] add missing abandon status documentation (Jonas Schnelli)
2016-03-29 11:10:57 +02:00
Jonas Schnelli cef8bdf5d7
[Wallet][RPC] add missing abandon status documentation 2016-03-29 08:43:08 +02:00
Wladimir J. van der Laan 0b98dd7939
Merge #7732: [Qt] Debug window: replace "Build date" with "Datadir"
fc737d1 [Qt] remove unused formatBuildDate method (Jonas Schnelli)
4856f1d [Qt] Debug window: replace "Build date" with "Datadir" (Jonas Schnelli)
2016-03-25 11:21:53 +01:00
Jonas Schnelli fc737d127f
[Qt] remove unused formatBuildDate method 2016-03-24 21:48:45 +01:00
Wladimir J. van der Laan b88e0b0c61
Merge #7506: Use CCoinControl selection in CWallet::FundTransaction
d6cc6a1 Use CCoinControl selection in CWallet::FundTransaction (João Barbosa)
2016-03-24 14:59:51 +01:00
João Barbosa df9e9233dc Fix lockunspents help message 2016-03-23 15:44:41 +00:00
Jonas Schnelli 263de3d1c8
[Wallet][RPC] add abandoned status to listtransactions 2016-03-23 15:49:53 +01:00
instagibbs f1bb13c93d Added companion removeprunedfunds call. 2016-03-23 10:40:38 -04:00
instagibbs 7eb702954e Add importprunedfunds rpc call 2016-03-23 10:40:38 -04:00
Wladimir J. van der Laan 3bdc583b3f
Merge #7715: Fix calculation of balances and available coins.
68d4282 Fix calculation of balances and available coins. (Alex Morcos)
2016-03-23 15:09:02 +01:00
Wladimir J. van der Laan e2ebd259fb
Merge #7671: [RPC] Add generatetoaddress rpc to mine to an address
d5c5c71 RPC tests for generatetoaddress (Andrew C)
fe00ca7 Create generatetoaddress rpc (Andrew C)
2016-03-23 13:24:53 +01:00
João Barbosa bb16c8894b Prevent multiple calls to CWallet::AvailableCoins 2016-03-22 08:43:37 +00:00
Jonas Schnelli 4856f1d671
[Qt] Debug window: replace "Build date" with "Datadir"
The build date does only makes sense for custom/self-compiled bitcoin-core versions because we are using static build-dates for our deterministic release builds.
Having a quick option to get the current datadir is much more valuable for debug purposes.
2016-03-22 08:40:10 +01:00
Jonas Schnelli 25340b7cd5
[Wallet] refactor wallet/init interaction 2016-03-22 08:20:59 +01:00
Alex Morcos 9e072a6e66 Implement "feefilter" P2P message.
The "feefilter" p2p message is used to inform other nodes of your mempool min fee which is the feerate that any new transaction must meet to be accepted to your mempool.  This will allow them to filter invs to you according to this feerate.
2016-03-21 10:46:25 -04:00
Andrew C fe00ca758a Create generatetoaddress rpc
Creates the generatetoaddress rpc which is virtually identical to the generate rpc except that it takes an argument for the address to mine to. It does not rely on wallet functionality.

The mining code shared by generate and generatetoaddress has been moved to another method to reduce duplication.
2016-03-21 09:58:40 -04:00
Wladimir J. van der Laan 29b2be6ad7
Merge #7692: Remove p2p alert system
cfd519e Add release note documentation (BtcDrak)
6601ce5 protocol.h/cpp: Removes NetMsgType::ALERT (Thomas Kerin)
ad72104 Formatting (BtcDrak)
1b77471 Remove alert keys (BtcDrak)
01fdfef Remove `-alerts` option (BtcDrak)
9206634 Update alert notification and GUI (BtcDrak)
bbb9d1d Remove p2p alert handling (BtcDrak)
2016-03-21 13:41:05 +01:00
Wladimir J. van der Laan 9af69fa7e7
Merge #7726: Correct importaddress help reference to importpubkey
c5825d2 Correct importaddress help reference to importpubkey (Denis Lukianov)
2016-03-21 12:51:32 +01:00
Wladimir J. van der Laan 3c27067dd2
Merge #7712: Improve COutPoint less operator
0f17692 Improve COutPoint less operator (João Barbosa)
2016-03-21 12:50:47 +01:00
Wladimir J. van der Laan 9426632cb5
Merge #7708: De-neuter NODE_BLOOM
c90036f Always disconnect old nodes which request filtered connections. (Patrick Strateman)
2016-03-21 12:44:19 +01:00
Wladimir J. van der Laan ddfd79659e
Merge #7705: [amount] Add tests and make GetFee() monotonic
fad13b1 [amount] Preempt issues with negative fee rates (MarcoFalke)
faf756a [amount] Make GetFee() monotonic (MarcoFalke)
fab6880 [qa] Add amount tests (MarcoFalke)
2016-03-21 12:40:31 +01:00
Wladimir J. van der Laan 7b832d286b
Merge #7656: Improve EncodeBase58 performance
3252208 Improve EncodeBase58 performance (João Barbosa)
2016-03-21 12:03:59 +01:00
Denis Lukianov c5825d2d73 Correct importaddress help reference to importpubkey 2016-03-21 03:16:19 +00:00
MarcoFalke fad13b1612 [amount] Preempt issues with negative fee rates 2016-03-19 15:15:56 +01:00
Patrick Strateman c90036f664 Always disconnect old nodes which request filtered connections. 2016-03-18 21:26:49 -07:00
Thomas Kerin 6601ce508e protocol.h/cpp: Removes NetMsgType::ALERT 2016-03-18 19:55:16 +00:00
BtcDrak ad7210408c Formatting 2016-03-18 19:55:16 +00:00
BtcDrak 1b77471bd6 Remove alert keys 2016-03-18 19:55:16 +00:00
BtcDrak 01fdfeffc4 Remove -alerts option 2016-03-18 19:33:59 +00:00
BtcDrak 92066344fd Update alert notification and GUI 2016-03-18 19:33:59 +00:00
BtcDrak bbb9d1d123 Remove p2p alert handling 2016-03-18 19:33:59 +00:00
Alex Morcos 68d4282774 Fix calculation of balances and available coins.
No longer consider coins which aren't in our mempool.

Add test for regression in abandonconflict.py
2016-03-18 09:56:30 -04:00
BtcDrak 12c89c9185 Policy: allow transaction version 2 relay policy.
This commit introduces a way to gracefully bump the default
transaction version in a two step process.
2016-03-18 08:09:06 +00:00
BtcDrak 02c2435802 Soft fork logic for BIP68 2016-03-18 08:09:06 +00:00
BtcDrak 478fba6d52 Soft fork logic for BIP113 2016-03-18 08:09:06 +00:00
Pieter Wuille 65751a3cf2 Add CHECKSEQUENCEVERIFY softfork through BIP9 2016-03-18 08:09:06 +00:00
João Barbosa 0f176927f8 Improve COutPoint less operator 2016-03-18 08:03:55 +00:00
Wladimir J. van der Laan 73b7eb501e
Merge #7575: Minimal BIP9 implementation
8c74ced RPC test for BIP9 warning logic (Suhas Daftuar)
7870deb Test versionbits deployments (Suhas Daftuar)
532cbb2 Add testing of ComputeBlockVersion (Suhas Daftuar)
d23f6c6 Softfork status report in RPC (Pieter Wuille)
732e774 Versionbits tests (Pieter Wuille)
6851107 BIP9 Implementation (Pieter Wuille)
2016-03-18 08:50:43 +01:00
MarcoFalke faf756ae4e [amount] Make GetFee() monotonic
This reverts the hard-to-read and buggy code introduced in
d88af56011 and adds documentation
2016-03-17 17:00:45 +01:00
MarcoFalke fab6880494 [qa] Add amount tests 2016-03-17 16:59:37 +01:00
Wladimir J. van der Laan f034bced26
Merge #7686: [qt] Remove 0-fee from send dialog
fae8467 [qt] Remove unneeded "fSendFreeTransactions" check (MarcoFalke)
fa48bb3 [qt] Remove 0-fee from send dialog (MarcoFalke)
2016-03-17 16:21:56 +01:00
MarcoFalke fae8467d41 [qt] Remove unneeded "fSendFreeTransactions" check 2016-03-17 14:48:12 +01:00
Wladimir J. van der Laan 01f4267623
Merge #7594: Mempool: Add tracking of ancestor packages
ce019bf Check all ancestor state in CTxMemPool::check() (Suhas Daftuar)
e2eeb5d Add ancestor feerate index to mempool (Suhas Daftuar)
72abd2c Add ancestor tracking to mempool (Suhas Daftuar)
76a7632 Remove work limit in UpdateForDescendants() (Suhas Daftuar)
5de2baa Rename CTxMemPool::remove -> removeRecursive (Suhas Daftuar)
7659438 CTxMemPool::removeForBlock now uses RemoveStaged (Suhas Daftuar)
2016-03-17 13:33:54 +01:00
Wladimir J. van der Laan 14d6324a24
Merge #7187: Keep reorgs fast for SequenceLocks checks
982670c Add LockPoints (Alex Morcos)
2016-03-16 21:20:04 +01:00
Alex Morcos 982670c333 Add LockPoints
Obtain LockPoints to store in CTxMemPoolEntry and during a reorg, evaluate whether they are still valid and if not, recalculate them.
2016-03-16 16:11:46 -04:00
Wladimir J. van der Laan 3d0dfdbf9f
Merge #7684: [qa] Extend tests
fad8cfb [qa] mininode: Add and use CONSTs (MarcoFalke)
fa8cd46 [qa] Move create_tx() to util.py (MarcoFalke)
fad7dc8 [qa] wallet: speed up tests (MarcoFalke)
fa3a81a [tests] Extend util_ParseMoney test case (MarcoFalke)
2016-03-16 17:32:05 +01:00
Suhas Daftuar 7870debceb Test versionbits deployments 2016-03-15 16:54:39 +01:00
Suhas Daftuar 532cbb22b5 Add testing of ComputeBlockVersion 2016-03-15 16:54:39 +01:00
Pieter Wuille d23f6c6a0d Softfork status report in RPC 2016-03-15 16:54:38 +01:00
Pieter Wuille 732e774c06 Versionbits tests 2016-03-15 16:54:38 +01:00
Pieter Wuille 6851107b3a BIP9 Implementation
Inspired by former implementations by Eric Lombrozo and Rusty Russell, and
based on code by Jorge Timon.
2016-03-15 16:54:38 +01:00
Wladimir J. van der Laan a6a860796a
Merge #7621: Fixes ZMQ startup with bad arguments.
0040118 Fixes ZMQ startup with bad arguments. (mrbandrews)
2016-03-15 09:29:58 +01:00
Pieter Wuille c3932b3270 List solvability in listunspent output and improve help 2016-03-14 19:22:11 +01:00
MarcoFalke fa48bb3148 [qt] Remove 0-fee from send dialog 2016-03-14 18:32:09 +01:00
Suhas Daftuar ce019bf90f Check all ancestor state in CTxMemPool::check() 2016-03-14 12:13:34 -04:00
Suhas Daftuar e2eeb5dda7 Add ancestor feerate index to mempool 2016-03-14 12:13:34 -04:00
Suhas Daftuar 72abd2ce3c Add ancestor tracking to mempool
This implements caching of ancestor state to each mempool entry, similar to
descendant tracking, but also including caching sigops-with-ancestors (as that
metric will be helpful to future code that implements better transaction
selection in CreatenewBlock).
2016-03-14 12:13:33 -04:00
Suhas Daftuar 76a76321d2 Remove work limit in UpdateForDescendants()
The work limit served to prevent the descendant walking algorithm from doing
too much work by marking the parent transaction as dirty.  However to implement
ancestor tracking, it's not possible to similarly mark those descendant
transactions as dirty without having to calculate them to begin with.

This commit removes the work limit altogether.  With appropriate
chain limits (-limitdescendantcount) the concern about doing too much
work inside this function should be mitigated.
2016-03-14 12:13:31 -04:00
Suhas Daftuar 5de2baa138 Rename CTxMemPool::remove -> removeRecursive
remove is no longer called non-recursively, so simplify the logic
and eliminate an unnecessary parameter
2016-03-14 12:11:09 -04:00
Suhas Daftuar 7659438a63 CTxMemPool::removeForBlock now uses RemoveStaged 2016-03-14 12:11:08 -04:00
Jonas Schnelli 3d7e97376a
Fix torcontrol.cpp unused private field warning 2016-03-14 16:07:42 +01:00
MarcoFalke fa3a81af18 [tests] Extend util_ParseMoney test case 2016-03-14 15:49:33 +01:00
Wladimir J. van der Laan 0735c0ca7c
Merge #7608: [wallet] Move hardcoded file name out of log messages
fa19b18 [wallet] Move hardcoded file name out of log messages (MarcoFalke)
2016-03-14 13:56:23 +01:00
MarcoFalke fa19b18c63 [wallet] Move hardcoded file name out of log messages 2016-03-14 13:54:05 +01:00
Wladimir J. van der Laan 322a7a2fe0 qt: Remove reflection from about icon
While trying to find a black/white version of the Bitcoin
logo for the organization I noticed the about.png is not
entirely black - it has some reflection. Remove this to make
it the same as other icons.

Also ran the icons through `contrib/devtools/optimize-pngs.py`,
so `chevron.png` was optimized too.
2016-03-14 12:46:59 +01:00
Wladimir J. van der Laan c9a1265754
Merge #7670: use cached block hash in blockToJSON()
a6ee0ca use cached block hash in blockToJSON() (Pavel Vasin)
2016-03-14 12:22:40 +01:00
Wladimir J. van der Laan c87f51e55b
Merge #7663: Make the generate RPC call function for non-regtest
8a253b3 Make the generate RPC call function for non-regtest (Pieter Wuille)
2016-03-14 11:36:20 +01:00
Wladimir J. van der Laan 11c769966a
Merge #7507: Remove internal miner
8d1de43 Remove internal miner (Leviathn)
2016-03-14 11:35:41 +01:00
Wladimir J. van der Laan 5b3b5a7d71
Merge #7577: [Wallet] move "load wallet phase" to CWallet
15e6e13 [Wallet] optimize return value of InitLoadWallet() (Jonas Schnelli)
fc7c60d [Wallet] move "load wallet phase" to CWallet (Jonas Schnelli)
2016-03-14 11:34:50 +01:00
Wladimir J. van der Laan f1ca8915bb
Merge #7517: test: script_error checking in script_invalid tests
0ecb340 test: Script_error checking in script_invalid tests (Wladimir J. van der Laan)
2317ad7 test: Re-introduce JSON pretty printing in test builder (Wladimir J. van der Laan)
b0ff857 test: Move non-generated script_invalid test to the correct place (Wladimir J. van der Laan)
2016-03-14 11:30:06 +01:00
Wladimir J. van der Laan 56d2c4e0fe
Merge #7667: Move GetTempPath() to testutil
2fdaa25 Move GetTempPath() to testutil. (Mustafa)
393b22e Add a source file for unit test utils. (Mustafa)
2016-03-14 11:26:52 +01:00
Jonas Schnelli 15e6e13624
[Wallet] optimize return value of InitLoadWallet() 2016-03-14 09:33:27 +01:00
Jonas Schnelli b24266c207
Merge #7668: Fix history deletion bug after font size change
21e45a0 Fix history deletion bug after font change (Andrew C)
2016-03-14 09:24:39 +01:00
Jonas Schnelli 3798e5de33
Merge #7613: Add autocomplete to bitcoin-qt's console window.
ce7413f Add autocomplete to bitcoin-qt's console window. (Luv Khemani)
2016-03-14 09:20:29 +01:00
Pavel Vasin a6ee0caa4e use cached block hash in blockToJSON() 2016-03-12 17:11:59 +03:00
Luv Khemani ce7413fcb7 Add autocomplete to bitcoin-qt's console window.
Removed externs
Added listCommands() to CRPCTable

Move autocomplete init to RPCConsole::setClientModel()
2016-03-12 13:04:23 +08:00
Andrew C 21e45a097e Fix history deletion bug after font change
The history is no longer cleared after the font size is changed
2016-03-11 13:19:19 -05:00
Mustafa 2fdaa25529 Move GetTempPath() to testutil. 2016-03-11 15:04:05 +00:00
Jonas Schnelli fc7c60d699
[Wallet] move "load wallet phase" to CWallet 2016-03-11 14:31:06 +01:00
Mustafa 393b22eacb Add a source file for unit test utils. 2016-03-11 12:03:45 +00:00
Wladimir J. van der Laan 86a1ec5b2c
Merge #7576: [Wallet] move wallet help string creation to CWallet
72c2651 [Wallet] move wallet help string creation to CWallet (Jonas Schnelli)
2016-03-11 08:40:37 +01:00
Wladimir J. van der Laan 9f14e5ad91
Merge #7553: Remove vfReachable and modify IsReachable to only use vfLimited.
110b62f Remove vfReachable and modify IsReachable to only use vfLimited. (Patrick Strateman)
2016-03-11 08:25:28 +01:00
Wladimir J. van der Laan 26a2a7214f
Merge #7592: mempool: Re-remove ERROR logging for mempool rejects
8fc81e0 mempool: Reduce ERROR logging for mempool rejects (Wladimir J. van der Laan)
2016-03-11 08:20:42 +01:00
Wladimir J. van der Laan 3da5d1bc2e
Merge #7637: Fix memleak in TorController [rework]
e219503 Fix memleak in TorController [rework] (Wladimir J. van der Laan)
2016-03-11 08:19:55 +01:00
Pieter Wuille 8a253b342c Make the generate RPC call function for non-regtest 2016-03-09 22:30:15 +01:00
Pieter Wuille c8d2473e6c
Merge #7642: Avoid "Unknown command" messages when receiving getaddr on outbound c…
9988554 No "Unknown command" for getaddr command. (R E Broadley)
2016-03-09 21:52:17 +01:00
Pavel Vasin 7d2f84c72f remove unused NOBLKS_VERSION_{START,END} constants 2016-03-09 19:29:23 +03:00
João Barbosa 3252208cb1 Improve EncodeBase58 performance 2016-03-09 10:10:36 +00:00
João Barbosa d6cc6a1830 Use CCoinControl selection in CWallet::FundTransaction 2016-03-08 15:14:47 +00:00
Jonas Schnelli 87d6562299
Merge #7628: QT: Add 'copy full transaction details' option
b51ed40 QT: Add 'copy full transaction details' option (Eric Shaw)
2016-03-08 10:15:22 +01:00
R E Broadley 9988554fc7 No "Unknown command" for getaddr command. 2016-03-08 08:49:42 +00:00
Eric Shaw b51ed4036e QT: Add 'copy full transaction details' option
Adds feature from issue #7484

modifies the ctrl-c binding to copy full transaction details in transaction view.

Added translation
2016-03-07 19:50:57 -05:00
Jonas Schnelli 72c2651581
[Wallet] move wallet help string creation to CWallet 2016-03-05 13:27:04 -05:00
Pieter Wuille 9f33dba05c
Merge #7539: Add tags to mempool's mapTx indices
086da92 Add tags to mempool's mapTx indices (Suhas Daftuar)
2016-03-05 06:56:33 +01:00
Wladimir J. van der Laan 3368895c3b
Merge #7521: Don't resend wallet txs that aren't in our own mempool
5a2b1c0 Don't resend wallet txs that aren't in our own mempool (Alex Morcos)
2016-03-03 15:09:50 +01:00
Wladimir J. van der Laan 7f001bdf64
Merge #7605: Remove openssl info from init/log and from Qt debug window
5ecfa36 Remove openssl info from init/log and from Qt debug window (Jonas Schnelli)
2016-03-03 13:55:56 +01:00
Wladimir J. van der Laan e219503711 Fix memleak in TorController [rework]
It looks like, TorController::disconnected_cb(TorControlConnection&
conn) gets called multiple times which results in multiple event_new().

Avoid this by creating the event only once in the constructore, and
deleting it only once in the destructor (thanks to Cory Fields for the
idea).

Replaces the fix by Jonas Schnelli in #7610, see discussion there.
2016-03-03 13:31:26 +01:00
Wladimir J. van der Laan e5121eb951
Merge #7617: [doc/log] Fix markdown syntax and line terminate LogPrint
fa26652 Make sure LogPrintf strings are line-terminated (MarcoFalke)
fa97f95 [doc] Fix markdown (MarcoFalke)
fa06ce0 Fix doxygen comment for payTxFee (MarcoFalke)
2016-03-01 18:39:21 +01:00
MarcoFalke fa26652459 Make sure LogPrintf strings are line-terminated 2016-03-01 14:59:30 +01:00
mrbandrews 0040118959 Fixes ZMQ startup with bad arguments. 2016-02-29 13:34:09 -05:00
Wladimir J. van der Laan 78e81b0bc5
Merge #7537: wallet: Warn on unexpected EOF while salvaging wallet
ca8fb59 wallet: Warn on unexpected EOF while salvaging wallet (Wladimir J. van der Laan)
2016-02-29 10:05:07 +01:00
MarcoFalke fa06ce0949 Fix doxygen comment for payTxFee 2016-02-27 18:14:57 +01:00
Jonas Schnelli 5ecfa36fd0
Remove openssl info from init/log and from Qt debug window 2016-02-26 09:35:39 +01:00
Wladimir J. van der Laan 8fc81e0983 mempool: Reduce ERROR logging for mempool rejects
Continues "Make logging for validation optional" from #6519.

The idea there was to remove all ERROR logging of rejected transaction,
and move it to one message in the class 'mempoolrej' which logs the
state message (and debug info). The superfluous ERRORs in the log
"terrify" users, see for example issue #5794.

Unfortunately a lot of new logging was introduced in #6871 (RBF) and
 #7287 (misc refactoring). This pull updates that new code.
2016-02-24 19:40:29 +01:00
Wladimir J. van der Laan 8b958ab15b
Merge #7550: rpc: Input-from-stdin mode for bitcoin-cli
f22f14c doc: mention bitcoin-cli -stdin in release notes (Wladimir J. van der Laan)
92bcca3 rpc: Input-from-stdin mode for bitcoin-cli (Wladimir J. van der Laan)
2016-02-24 11:33:25 +01:00
Wladimir J. van der Laan 92bcca37ab rpc: Input-from-stdin mode for bitcoin-cli
Implements #7442 by adding an option `-stdin` which reads
additional arguments from stdin, one per line.

For example

```bash
echo -e "mysecretcode\n120" | src/bitcoin-cli -stdin walletpassphrase
echo -e "walletpassphrase\nmysecretcode\n120" | src/bitcoin-cli -stdin
```
2016-02-24 10:12:25 +01:00
Matthew Zipkin 7eef1d0dad Clarify description of blockindex
see issues:

https://github.com/bitcoin-dot-org/bitcoin.org/issues/1237

https://github.com/bitcoin/bitcoin/issues/7532
2016-02-18 12:42:59 -08:00
Patrick Strateman 110b62f069 Remove vfReachable and modify IsReachable to only use vfLimited.
We do not know that a class of Network is reachable, only that it is not.
2016-02-17 23:21:27 -08:00
Suhas Daftuar 086da92ea7 Add tags to mempool's mapTx indices 2016-02-16 12:35:16 -05:00
Wladimir J. van der Laan 8b70a64d62
Merge #7526: fix spelling of advertise (shows up in the debug log)
37767fd fix spelling of advertise in src and doc (jloughry)
2016-02-16 12:37:03 +01:00
Wladimir J. van der Laan 93c85d458a
Merge #7524: BIP-112: Mempool-only CHECKSEQUENCEVERIFY
a381076 Code style fix. (BtcDrak)
c3c3752 Separate CheckLockTime() and CheckSequence() logic (BtcDrak)
53e53a3 BIP112: Implement CHECKSEQUENCEVERIFY (Mark Friedenbach)
2016-02-16 10:46:34 +01:00
BtcDrak a38107643f Code style fix.
This if statement is a little obtuse and using braces here
improves readability.
2016-02-16 09:39:44 +00:00
Wladimir J. van der Laan 2d4f73f47e
Merge #7509: Common argument defaults for NODE_BLOOM stuff and -wallet
1fb91b3 Common argument defaults for NODE_BLOOM stuff and -wallet (Luke Dashjr)
2016-02-16 10:00:21 +01:00
Wladimir J. van der Laan ce5fc02e61
Merge #7536: test: test leading spaces for ParseHex
f31b6b8 test: test leading space for ParseHex (Wladimir J. van der Laan)
2016-02-16 09:26:53 +01:00
Wladimir J. van der Laan 19324cf09c
Merge #7504: Crystal clean make clean
ae6eca0 make clean should clean .a files (Pavel Janík)
2016-02-15 17:18:41 +01:00
Wladimir J. van der Laan f31b6b8995 test: test leading space for ParseHex
BerkeleyDB dump files have key and value lines indented.
The salvage code passes these to ParseHex as-is.
Check this in the tests (should just pass with current code).
2016-02-15 17:14:30 +01:00
Wladimir J. van der Laan ca8fb59ae1 wallet: Warn on unexpected EOF while salvaging wallet
Check for EOF before every getline, and warn when reading gets to EOF
before the end of the data.

Stricter error checking could shed more light on issues such as #7463
and #7379.
2016-02-15 16:35:12 +01:00
BtcDrak c3c375226e Separate CheckLockTime() and CheckSequence() logic
For the sake of a little repetition, make code more readable.
2016-02-14 11:29:40 +00:00
Mark Friedenbach 53e53a33c9 BIP112: Implement CHECKSEQUENCEVERIFY
- Replace NOP3 with CHECKSEQUENCEVERIFY (BIP112)
  <nSequence> CHECKSEQUENCEVERIFY -> <nSequence>
- Fails if txin.nSequence < nSequence, allowing funds of a txout to be locked for a number of blocks or a duration of time after its inclusion in a block.
- Pull most of CheckLockTime() out into VerifyLockTime(), a local function that will be reused for CheckSequence()
- Add bitwise AND operator to CScriptNum
- Enable CHECKSEQUENCEVERIFY as a standard script verify flag
- Transactions that fail CSV verification will be rejected from the mempool, making it easy to test the feature. However blocks containing "invalid" CSV-using transactions will still be accepted; this is *not* the soft-fork required to actually enable CSV for production use.
2016-02-14 11:29:38 +00:00
jloughry 37767fd46f fix spelling of advertise in src and doc 2016-02-12 12:51:54 -07:00
instagibbs c372572595 Fix and cleanup listreceivedbyX documentation 2016-02-12 14:06:59 -05:00
Wladimir J. van der Laan 80d1f2e483
Merge #7184: Implement SequenceLocks functions for BIP 68
b043c4b fix sdaftuar's nits again (Alex Morcos)
a51c79b Bug fix to RPC test (Alex Morcos)
da6ad5f Add RPC test exercising BIP68 (mempool only) (Suhas Daftuar)
c6c2f0f Implement SequenceLocks functions (Alex Morcos)
2016-02-12 17:03:46 +01:00
Wladimir J. van der Laan 621940e040
Merge #7520: LibreSSL doesn't define OPENSSL_VERSION, use LIBRESSL_VERSION_TEXT instead
a0a17b3 LibreSSL doesn't define OPENSSL_VERSION, use LIBRESSL_VERSION_TEXT instead (Pavel Janík)
2016-02-12 13:06:02 +01:00
Pavel Janík a0a17b3e44 LibreSSL doesn't define OPENSSL_VERSION, use LIBRESSL_VERSION_TEXT instead 2016-02-12 07:01:33 +01:00
jmacwhyte 8aa722609d Fix IsInitialBlockDownload to play nice with testnet 2016-02-11 18:02:46 -08:00
Alex Morcos 5a2b1c0c8b Don't resend wallet txs that aren't in our own mempool 2016-02-11 17:34:55 -05:00
Alex Morcos b043c4b746 fix sdaftuar's nits again
it boggles the mind why these nits can't be delivered on a more timely basis
2016-02-11 15:34:04 -05:00
Wladimir J. van der Laan 0ecb3401fe test: Script_error checking in script_invalid tests
Check the returned script_error. Add expected script_error
for generated as well as custom tests.

The specific error is not part of consensus, however
it could avoid unclear reporting issues such as #6862 in the future.

Fixes #7513.
2016-02-11 17:33:28 +01:00
Wladimir J. van der Laan 2317ad7c56 test: Re-introduce JSON pretty printing in test builder 2016-02-11 17:33:28 +01:00
Wladimir J. van der Laan b0ff8572ae test: Move non-generated script_invalid test to the correct place
This test was introduced in 9fadf1c874,
but accidentally added in the autogenerated area.
2016-02-11 16:16:40 +01:00
Luke Dashjr 1fb91b3496 Common argument defaults for NODE_BLOOM stuff and -wallet 2016-02-11 06:38:04 +00:00
Leviathn 8d1de43f0c Remove internal miner
This code removes the internal miner which is only useful on Testnet.
This leaves the internal miner that is useful on RegTest intact.
2016-02-10 18:29:13 -08:00
Alex Morcos c6c2f0fd78 Implement SequenceLocks functions
SequenceLocks functions are used to evaluate sequence lock times or heights per BIP 68.

The majority of this code is copied from maaku in #6312
Further credit: btcdrak, sipa, NicolasDorier
2016-02-10 15:35:33 -05:00
Pavel Janík ae6eca0f49 make clean should clean .a files 2016-02-10 21:03:51 +01:00
Wladimir J. van der Laan 2f3f4af4cc
Merge #7500: Correctly report high-S violations
9d95187 Correctly report high-S violations (Pieter Wuille)
2016-02-10 20:32:13 +01:00
Wladimir J. van der Laan b93f078496
Merge #7502: Update the wallet best block marker when pruning
e4eebb6 Update the wallet best block marker when pruning (Pieter Wuille)
2016-02-10 19:39:54 +01:00
Wladimir J. van der Laan c9da9c4bd8
Merge #7491: wallet: Ignore MarkConflict if block hash is not known
40e7b61 wallet: Ignore MarkConflict if block hash is not known (Wladimir J. van der Laan)
2016-02-10 18:56:51 +01:00
Pieter Wuille e4eebb604e Update the wallet best block marker when pruning 2016-02-10 17:11:13 +01:00
Pieter Wuille 9d95187d5d Correctly report high-S violations 2016-02-10 14:19:20 +01:00
Wladimir J. van der Laan 40e7b61835 wallet: Ignore MarkConflict if block hash is not known
If number of conflict confirms cannot be determined, this means
that the block is still unknown or not yet part of the main chain,
for example during a reindex. Do nothing in that case,
instead of crash with an assertion.

Fixes #7234.
2016-02-09 20:38:31 +01:00
Wladimir J. van der Laan acf5983502 tests: Remove May15 test
This test is no longer relevant.

It was introduced in 8c222dca4f to check
the switch to 1MB blocks after the BDB too-many-locks issue back in
2013. The switching code has been long since removed.

It also needs a specific data file that is hard to find. I've verified
in #6320 that it still passes, however I think there is zero reason to
keep it.

Closes #6320.
2016-02-09 16:23:52 +01:00
Wladimir J. van der Laan b49a623799
Merge #7480: Changed getnetworkhps value to double to avoid overflow.
993d089 Changed getnetworkhps value to double to avoid overflow. (instagibbs)
2016-02-09 11:08:40 +01:00
Wladimir J. van der Laan 3ffe4b241e
Merge #7482: [P2P] Ensure headers count is correct
301bc7b Update nQueuedValidatedHeaders after peer disconnection (Suhas Daftuar)
2016-02-09 08:54:25 +01:00
Wladimir J. van der Laan 3db828f951
Merge #7472: rpc: Add WWW-Authenticate header to 401 response
7c06fbd rpc: Add WWW-Authenticate header to 401 response (Wladimir J. van der Laan)
2016-02-09 08:52:02 +01:00
Suhas Daftuar 301bc7bc7e Update nQueuedValidatedHeaders after peer disconnection 2016-02-08 15:50:52 -05:00
instagibbs 993d089e82 Changed getnetworkhps value to double to avoid overflow. 2016-02-08 10:49:27 -05:00
Wladimir J. van der Laan 7c06fbd8f5 rpc: Add WWW-Authenticate header to 401 response
A WWW-Authenticate header must be present in the 401
response to make clients know that they can authenticate,
and how.

    WWW-Authenticate: Basic realm="jsonrpc"

Fixes #7462.
2016-02-08 09:16:29 +01:00
Wladimir J. van der Laan e7ea5db0c1
Merge #7459: Consensus: Decouple pow.o from util.o
f3757a0 Consensus: Decouple pow.cpp from util.h (Jorge Timón)
2016-02-05 11:19:45 +01:00
Matt 0830552673 Fix spelling: misbeha{b,v}ing 2016-02-04 17:15:20 -06:00
Jorge Timón f3757a0391 Consensus: Decouple pow.cpp from util.h 2016-02-04 19:21:55 +01:00
Wladimir J. van der Laan 152a8216cc
Merge #7349: Build against system UniValue when available
42407ed build-unix: Update UniValue build conditions (Luke Dashjr)
cdcad9f LDADD dependency order shuffling (Luke Dashjr)
62f7f2e Bugfix: Always include univalue in DIST_SUBDIRS (Luke Dashjr)
2356515 Change default configure option --with-system-univalue to "no" (Luke Dashjr)
5d3b29b doc: Add UniValue to build instructions (Luke Dashjr)
ab22705 Build against system UniValue when available (Luke Dashjr)
2adf7e2 Bugfix: The var is LIBUNIVALUE,not LIBBITCOIN_UNIVALUE (Luke Dashjr)
2016-02-04 17:43:19 +01:00
Wladimir J. van der Laan d2228384de
Merge #6480: include the chaintip blockindex in the SyncTransaction signal, add signal UpdateTip()
7d0bf0b include the chaintip *blockIndex in the SyncTransaction signal (Jonas Schnelli)
2016-02-04 17:03:09 +01:00
Wladimir J. van der Laan 4f4dc5ef72
Merge #7070: Move maxTxFee out of mempool
fad6244 ATMP: make nAbsurdFee const (MarcoFalke)
fa762d0 [wallet.h] Remove main.h include (MarcoFalke)
fa79db2 Move maxTxFee out of mempool (MarcoFalke)
2016-02-04 14:54:23 +01:00
Wladimir J. van der Laan 2cdbf28cf3
Merge #7192: Unify product name to as few places as possible
027fdb8 When/if the copyright line does not mention Bitcoin Core developers, add a second line to copyrights in -version, About dialog, and splash screen (Luke Dashjr)
cc2095e Rewrite FormatParagraph to handle newlines within input strings correctly (Luke Dashjr)
cddffaf Bugfix: Include COPYRIGHT_HOLDERS_SUBSTITUTION in Makefile substitutions so it gets passed to extract-strings correctly (Luke Dashjr)
29598e4 Move PACKAGE_URL to configure.ac (Luke Dashjr)
78ec83d splashscreen: Resize text to fit exactly (Luke Dashjr)
3cae140 Bugfix: Actually use _COPYRIGHT_HOLDERS_SUBSTITUTION everywhere (Luke Dashjr)
4d5a3df Bugfix: gitian-descriptors: Add missing python-setuptools requirement for OS X (biplist module) (Luke Dashjr)
e4ab5e5 Bugfix: Correct copyright year in Mac DMG background image (Luke Dashjr)
917b1d0 Set copyright holders displayed in notices separately from the package name (Luke Dashjr)
c39a6ff Travis & gitian-osx: Use depends for ds_store and mac_alias modules (Luke Dashjr)
902ccde depends: Add mac_alias to depends (Luke Dashjr)
82a2d98 depends: Add ds_store to depends (Cory Fields)
de619a3 depends: Pass PYTHONPATH along to configure (Cory Fields)
e611b6e macdeploy: Use rsvg-convert rather than cairosvg (Luke Dashjr)
63bcdc5 More complicated package name substitution for Mac deployment (Luke Dashjr)
1a6c67c Parameterise 2009 in translatable copyright strings (Luke Dashjr)
d5f4683 Unify package name to as few places as possible without major changes (Luke Dashjr)
2016-02-04 13:42:24 +01:00
Wladimir J. van der Laan 898fedf42f
Merge #7458: [Net] peers.dat, banlist.dat recreated when missing
c77c662 peers.dat, banlist.dat recreated when missing (kirkalx)
2016-02-04 08:54:21 +01:00
kirkalx c77c6625f3 peers.dat, banlist.dat recreated when missing 2016-02-04 11:46:24 +13:00
Wladimir J. van der Laan eb331794a2
Merge #7225: Eliminate unnecessary call to CheckBlock
dbb89dc Eliminate unnecessary call to CheckBlock (Suhas Daftuar)
2016-02-03 13:23:49 +01:00
MarcoFalke fad6244879 ATMP: make nAbsurdFee const 2016-02-03 13:14:23 +01:00
MarcoFalke fa762d0f00 [wallet.h] Remove main.h include 2016-02-03 12:44:43 +01:00
Wladimir J. van der Laan 4cdbd4255b
Merge #7444: Improve block validity/ConnectBlock() comments
2f19905 Improve block validity/ConnectBlock() comments (Peter Todd)
2016-02-03 12:29:37 +01:00
Wladimir J. van der Laan 5fd95b4490
Merge #7431: Rename permitrbf to mempoolreplacement and provide minimal string-list forward compatibility (needs 0.12 backport)
b922fbe Rename replacebyfee=opt-in to mempoolreplacement=fee (Luke Dashjr)
3b66e54 Simplify check for replacebyfee=opt-in (Luke Dashjr)
d65dee9 Accept replacebyfee=opt-in for turning on opt-in RBF (Luke Dashjr)
77b55a0 Rename permitrbf to replacebyfee (Luke Dashjr)
2016-02-03 10:27:32 +01:00
Luke Dashjr a68bb9f5e7 Merge branch 'master' into single_prodname 2016-02-03 05:41:13 +00:00
Luke Dashjr 027fdb83b4 When/if the copyright line does not mention Bitcoin Core developers, add a second line to copyrights in -version, About dialog, and splash screen 2016-02-03 05:38:51 +00:00
Luke Dashjr cc2095ecae Rewrite FormatParagraph to handle newlines within input strings correctly 2016-02-03 05:38:43 +00:00
MarcoFalke fa79db2641 Move maxTxFee out of mempool
Also, remove default values in CMerkleTx::AcceptToMemoryPool()
2016-02-02 20:08:51 +01:00
Wladimir J. van der Laan fd13fe7ca0
Merge #7091: Consensus build package
cf82d05 Build: Consensus: Make libbitcoinconsensus_la_SOURCES fully dynamic and dependend on both crypto and consensus packages (Jorge Timón)
4feadec Build: Libconsensus: Move libconsensus-ready files to the consensus package (Jorge Timón)
a3d5eec Build: Consensus: Move consensus files from common to its own module/package (Jorge Timón)
2016-02-02 19:02:22 +01:00
Wladimir J. van der Laan 11d74f6a6b
Merge #7084: mempool: Replace maxFeeRate of 10000*minRelayTxFee with maxTxFee
fa1193e [doxygen] Actually display comment (MarcoFalke)
fa331db mempool: Replace maxFeeRate of 10000*minRelayTxFee with maxTxFee (MarcoFalke)
2016-02-02 15:18:07 +01:00
Wladimir J. van der Laan 47ac04e8b1
Merge #7311: MOVEONLY: Move non-consensus functions out of pow
e867561 MOVEONLY: non-consensus: from pow to chain: (Jorge Timón)
2016-02-02 14:16:16 +01:00
MarcoFalke fa1193e254 [doxygen] Actually display comment 2016-02-02 13:39:23 +01:00
Luke Dashjr b922fbe063 Rename replacebyfee=opt-in to mempoolreplacement=fee 2016-02-01 19:30:37 +00:00
Suhas Daftuar dbb89dc793 Eliminate unnecessary call to CheckBlock
ProcessNewBlock would return failure early if CheckBlock failed, before
calling AcceptBlock.  AcceptBlock also calls CheckBlock, and upon failure
would update mapBlockIndex to indicate that a block was failed.  By returning
early in ProcessNewBlock, we were not marking blocks that fail a check in
CheckBlock as permanently failed, and thus would continue to re-request and
reprocess them.
2016-02-01 14:29:45 -05:00
Gregory Maxwell 1e05727072 Decide eviction group ties based on time.
This corrects a bug the case of tying group size where the code may
 fail to select the group with the newest member. Since newest time
 is the final selection criteria, failing to break ties on it
 on the step before can undermine the final selection.

Tied netgroups are very common.

(cherry picked from commit 8e09f914f8ec66301257358b250e9a61befadd95)
2016-02-01 15:31:21 +01:00
Gregory Maxwell 1e9613ac09 Do not absolutely protect local peers from eviction.
With automatic tor HS support in place we should probably not be providing
 absolute protection for local peers, since HS inbound could be used to
 attack pretty easily.  Instead, this counts on the latency metric inside
 AttemptToEvictConnection to privilege actually local peers.

(cherry picked from commit 46dbcd4833115401fecbb052365b4c7725874414)
2016-02-01 15:31:17 +01:00
Pieter Wuille 5d743099b5 Get rid of inaccurate ScriptSigArgsExpected
(cherry picked from commit 52b29dca7670c3f6d2ab918c0fff1d17c4e494ad)
2016-02-01 15:28:25 +01:00
Wladimir J. van der Laan 58a8574400
Merge #7439: Add whitelistforcerelay to control forced relaying. [#7099 redux]
89d113e Blacklist -whitelistalwaysrelay; replaced by -whitelistrelay. (Gregory Maxwell)
325c725 Add whitelistforcerelay to control forced relaying. (Gregory Maxwell)
2016-02-01 14:11:15 +01:00
Gregory Maxwell 89d113e02a Blacklist -whitelistalwaysrelay; replaced by -whitelistrelay. 2016-02-01 12:32:57 +00:00
Wladimir J. van der Laan 31ec14b74b
Merge #7287: Consensus: Remove calls to error() and FormatStateMessage()
93fc58c Consensus: Remove calls to error() and FormatStateMessage() from some consensus code in main (Jorge Timón)
2016-02-01 10:21:53 +01:00
Peter Todd 2f19905324
Improve block validity/ConnectBlock() comments
Previously didn't make clear that the ContextualCheckBlock* functions
meant the block headers as context - not the UTXO set itself - and that
ConnectBlock() also did UTXO-related validity checks (in the future we
may split that functionality into a separate UTXO-specific contextual
check block function).

Also, reordered to put validity checks first for better readability.
2016-01-31 00:40:23 -05:00
Luke Dashjr cdcad9fc5f LDADD dependency order shuffling 2016-01-31 02:32:55 +00:00
Luke Dashjr 62f7f2ee21 Bugfix: Always include univalue in DIST_SUBDIRS 2016-01-31 02:32:00 +00:00
MarcoFalke fa331db68b mempool: Replace maxFeeRate of 10000*minRelayTxFee with maxTxFee 2016-01-30 11:29:22 +01:00
Jorge Timón 93fc58c742 Consensus: Remove calls to error() and FormatStateMessage() from some consensus code in main 2016-01-29 18:38:39 +01:00
Wladimir J. van der Laan 019280617a
Merge #6842: limitfreerelay edge case bugfix
2dfeaa1 limitfreerelay edge case bugfix: (ptschip)
2016-01-29 13:12:02 +01:00
Luke Dashjr 3b66e54457 Simplify check for replacebyfee=opt-in 2016-01-29 01:28:54 +00:00
Gregory Maxwell 325c725fb6 Add whitelistforcerelay to control forced relaying.
Also renames whitelistalwaysrelay.

Nodes relay all transactions from whitelisted peers, this
 gets in the way of some useful reasons for whitelisting
 peers-- for example, bypassing bandwidth limitations.

The purpose of this forced relaying is for specialized gateway
 applications where a node is being used as a P2P connection
 filter and multiplexer, but where you don't want it getting
 in the way of (re-)broadcast.

This change makes it configurable with whitelistforcerelay.
2016-01-28 22:26:21 +00:00
Kefkius 8b3d8e3991
GUI: Disable tab navigation for peers tables.
Fix a bug in which the Peers tab of the debug window
does not allow navigation to other tabs via Ctrl[+Shift]+Tab.
2016-01-28 15:26:54 -05:00
Wladimir J. van der Laan 326ffed09b
Merge #7212: Adds unittests for CAddrMan and CAddrinfo, removes source of non-determinism.
40c87b6 Increase test coverage for addrman and addrinfo (Ethan Heilman)
2016-01-28 13:14:07 +01:00
Wladimir J. van der Laan 62f2d769e4
Merge #7348: MOVE ONLY: move rpc* to rpc/
d13f65e rpc: update inline comments to refer to new file paths (Daniel Cousens)
a0eaff8 move rpc* to rpc/ (Daniel Cousens)
2016-01-28 11:28:24 +01:00
Wladimir J. van der Laan 4a46bdc0fe
Merge #7415: net: Hardcoded seeds update January 2016
4818dba net: Hardcoded seeds update January 2016 (Wladimir J. van der Laan)
2016-01-28 10:54:14 +01:00
Jonas Schnelli cdcbc59a42
Merge #7396: [Qt] Add option to increase/decrease font size in the console window
43abb02 [Qt] Add a new chevron/arrow icon for the console prompt line (Jonas Schnelli)
56c9e66 [Qt] keep scroll position in GUI console after changing font size (Jonas Schnelli)
3a3a927 [Qt] Add option to increase/decrease font size in the console window (Jonas Schnelli)
2016-01-28 10:23:31 +01:00
Luke Dashjr d65dee961e Accept replacebyfee=opt-in for turning on opt-in RBF
Basic forward-compatibility with more flexible parameters like fss
2016-01-28 06:10:35 +00:00
Luke Dashjr 77b55a00ed Rename permitrbf to replacebyfee
"permit" is currently used to configure transaction filtering, whereas replacement is more to do with the memory pool state than the transaction itself.
2016-01-28 05:11:06 +00:00