Commit graph

8866 commits

Author SHA1 Message Date
Wladimir J. van der Laan 7884956414
Merge #9511: Don't overwrite validation state with corruption check
116419e Don't overwrite validation state with corruption check (Alex Morcos)
2017-01-23 13:18:16 +01:00
Wladimir J. van der Laan eafba4e273
Merge #9583: Move wallet callbacks into cs_main (this effectively reverts #7946)
9899893 Move wallet callbacks into cs_main (this effectively reverts #7946) (Matt Corallo)
2017-01-23 07:43:47 +01:00
MarcoFalke ff58b1c3bd
Merge #9610: [Trivial] Grammar and typo correction (laudaa)
5c66d41 [Trivial] Grammar and typo correction (Lauda)
2017-01-22 13:28:43 +01:00
Lauda 5c66d41b7f [Trivial] Grammar and typo correction
Minor corrections in src\test\* .
2017-01-22 13:18:51 +01:00
MarcoFalke 0b96abc35f
Merge #9554: [test] Avoid potential NULL pointer dereference in addrman_tests.cpp
afab9f4 [test] Avoid potential NULL pointer dereference in addrman_tests.cpp (practicalswift)
2017-01-22 13:17:41 +01:00
Matt Corallo 003cd60cc3 Add missing mempool lock for CalculateMemPoolAncestors 2017-01-20 18:11:24 -05:00
John Newbery dd5b0114cf [Trivial] add comment about setting peer as HB peer.
This adds a comment to the new logic for setting HB peers based
on block validation (and aligns the code below to reflect the comment).
It's not obvious why we're checking mapBlocksInFlight. Add a comment to
explain.
2017-01-20 15:05:12 -05:00
Alex Morcos de1ae324bf Exclude RBF txs from fee estimation 2017-01-20 15:04:16 -05:00
Wladimir J. van der Laan af01cd3a3d
qt: Periodic translation update 2017-01-20 14:45:12 +01:00
Wladimir J. van der Laan b8d1b81077
trivial: squash missing field 'argNames' initializer warning in qt tests
The additional initializer is for the named arguments, which are unused
in the test (and unfilled global fields will be initialized to 0
anyhow), so this is a no-op apart from the warning.
2017-01-20 14:39:50 +01:00
Wladimir J. van der Laan fb75cd04bb
Merge #9377: fundrawtransaction: Keep change-output keys by default, make it optional
c9f3062 Add fundrawtransactions new reserveChangeKey option to the release notes (Jonas Schnelli)
9eb325d [QA] Add test for fundrawtransactions new reserveChangeKey option (Jonas Schnelli)
9aa4e6a [Wallet] Add an option to keep the change address key, true by default (Jonas Schnelli)
2017-01-20 14:32:42 +01:00
Alex Morcos fe8e8efcf9 [rpc] Add incremental relay fee to getnetworkinfo 2017-01-20 07:40:36 -05:00
Pavel Janík 44f2baac48 Do not shadow local variable named tx. 2017-01-20 10:55:47 +01:00
Gregory Maxwell 8ff8d219c3 Send final alert message to older peers after connecting.
The old Bitcoin alert system has long since been retired.
( See also: https://bitcoin.org/en/alert/2016-11-01-alert-retirement )

This change causes each node to send any old peers that
 it connects with a copy of the final alert.

The alert it hardcode cancels all other alerts including
 other final alerts.
2017-01-20 07:33:58 +00:00
Alex Morcos bd92f2481c [bugfix] save feeDelta instead of priorityDelta in DumpMempool 2017-01-19 23:45:02 -05:00
Alex Morcos 6b331e6cf9 Fix to have miner test aware of new separate block min tx fee 2017-01-19 21:35:39 -05:00
Alex Morcos de6400de5d Fix missing use of dustRelayFee 2017-01-19 20:31:29 -05:00
Alex Morcos 5b158707f2 Use incrementalRelayFee for BIP 125 replacement 2017-01-19 20:31:29 -05:00
MarcoFalke fa4d47814f qt: Use nPowTargetSpacing constant 2017-01-19 20:47:04 +01:00
Jonas Schnelli 9aa4e6a6c2
[Wallet] Add an option to keep the change address key, true by default 2017-01-19 20:38:37 +01:00
Wladimir J. van der Laan 82274c02ed
Merge #9535: Split CNode::cs_vSend: message processing and message sending
376b3c2 Make the cs_sendProcessing a LOCK instead of a TRY_LOCK (Matt Corallo)
d7c58ad Split CNode::cs_vSend: message processing and message sending (Matt Corallo)
2017-01-19 20:20:04 +01:00
Jonas Schnelli b25068697f
Merge #9461: [Qt] Improve progress display during headers-sync and peer-finding
40ec7c7 [Qt] Improve progress display during headers-sync and peer-finding (Jonas Schnelli)
2017-01-19 20:09:49 +01:00
Wladimir J. van der Laan 2ef52d3cf1
Merge #8456: [RPC] Simplified bumpfee command.
cc0243a [RPC] bumpfee (mrbandrews)
52dde66 [wallet] Add include_unsafe argument to listunspent RPC (Russell Yanofsky)
766e8a4 [wallet] Add IsAllFromMe: true if all inputs are from wallet (Suhas Daftuar)
2017-01-19 19:59:24 +01:00
Matt Corallo 989989354b Move wallet callbacks into cs_main (this effectively reverts #7946) 2017-01-19 11:31:05 -05:00
mrbandrews cc0243ad32 [RPC] bumpfee
This command allows a user to increase the fee on a wallet transaction T, creating a "bumper" transaction B.
T must signal that it is BIP-125 replaceable.
T's change output is decremented to pay the additional fee.  (B will not add inputs to T.)
T cannot have any descendant transactions.
Once B bumps T, neither T nor B's outputs can be spent until either T or (more likely) B is mined.

Includes code by @jonasschnelli and @ryanofsky
2017-01-19 11:29:29 -05:00
Russell Yanofsky 52dde66770 [wallet] Add include_unsafe argument to listunspent RPC 2017-01-19 11:29:29 -05:00
Wladimir J. van der Laan 054d664215
Merge #9498: Basic CCheckQueue Benchmarks
aad4cb5 Address ryanofsky feedback on CCheckQueue benchmarks. Eliminated magic numbers, fixed scoping of vectors (and memory movement component of benchmark). (Jeremy Rubin)
9f03110 Add Basic CheckQueue Benchmark (Jeremy Rubin)
2017-01-19 15:29:09 +01:00
Jonas Schnelli 40ec7c7b0d
[Qt] Improve progress display during headers-sync and peer-finding 2017-01-19 09:10:04 +01:00
Wladimir J. van der Laan 9c9af5ab2d
Merge #9499: Use recent-rejects, orphans, and recently-replaced txn for compact-block-reconstruction
c594580 Add braces around AddToCompactExtraTransactions (Matt Corallo)
1ccfe9b Clarify comment about mempool/extra conflicts (Matt Corallo)
fac4c78 Make PartiallyDownloadedBlock::InitData's second param const (Matt Corallo)
b55b416 Add extra_count lower bound to compact reconstruction debug print (Matt Corallo)
863edb4 Consider all (<100k memusage) txn for compact-block-extra-txn cache (Matt Corallo)
7f8c8ca Consider all orphan txn for compact-block-extra-txn cache (Matt Corallo)
93380c5 Use replaced transactions in compact block reconstruction (Matt Corallo)
1531652 Keep shared_ptrs to recently-replaced txn for compact blocks (Matt Corallo)
edded80 Make ATMP optionally return the CTransactionRefs it replaced (Matt Corallo)
c735540 Move ORPHAN constants from validation.h to net_processing.h (Matt Corallo)
2017-01-19 09:03:46 +01:00
Wladimir J. van der Laan 6012967c47
Merge #9512: Fix various things -fsanitize complains about
82e8baa Avoid boost dynamic_bitset in rest_getutxos (Pieter Wuille)
99f001e Fix memory leak in multiUserAuthorized (Pieter Wuille)
5a0b7e4 Fix memory leak in net_tests (Pieter Wuille)
6b03bfb Fix memory leak in wallet tests (Pieter Wuille)
f94f3e0 Avoid integer overflows in scriptnum tests (Pieter Wuille)
843c560 Avoid unaligned access in crypto i/o (Pieter Wuille)
2017-01-18 20:05:30 +01:00
MarcoFalke b0b57a1730
Merge #9508: Remove unused Python imports
95bab82 Remove unused Python imports (practicalswift)
2017-01-18 10:48:52 +01:00
Karl-Johan Alm ee5c1ce5a6 Bug-fix: listsinceblock: use closest common ancestor when a block hash was provided for a chain that was not the main chain. 2017-01-18 12:07:13 +09:00
Matt Corallo c5945804ca Add braces around AddToCompactExtraTransactions 2017-01-16 23:00:58 -05:00
Matt Corallo 1ccfe9b1c9 Clarify comment about mempool/extra conflicts 2017-01-16 22:58:06 -05:00
Pieter Wuille 6696b4635c
Merge #9561: Wake message handling thread when we receive a new block
241d893 Wake message handling thread when we receive a new block (Matt Corallo)
f13914a Make WakeMessageHandler public (Matt Corallo)
2017-01-16 19:54:52 -08:00
Pieter Wuille 812714fd80
Merge #9484: Introduce assumevalid setting to skip validation presumed valid scripts.
7b5e3fe Add assumevalid testcase (John Newbery)
e440ac7 Introduce assumevalid setting to skip presumed valid scripts. (Gregory Maxwell)
2017-01-16 14:07:30 -08:00
Wladimir J. van der Laan b0819c7e9b
qt: periodic translations update 2017-01-16 20:59:50 +01:00
Wladimir J. van der Laan dd98f04538
Merge #9380: Separate different uses of minimum fees
eb30d1a Introduce -dustrelayfee (Alex Morcos)
7b1add3 Introduce -incrementalrelayfee (Alex Morcos)
daec955 Introduce -blockmintxfee (Alex Morcos)
2017-01-16 19:33:08 +01:00
Alex Morcos eb30d1a5b2 Introduce -dustrelayfee 2017-01-16 08:40:40 -05:00
Alex Morcos 7b1add3c28 Introduce -incrementalrelayfee 2017-01-16 08:39:03 -05:00
Pieter Wuille 8a445c5651
Merge #9400: Set peers as HB peers upon full block validation
d4781ac Set peers as HB peers upon full block validation (Gregory Sanders)
2017-01-15 09:44:33 -08:00
Wladimir J. van der Laan f62bc10a60
Merge #9486: Make peer=%d log prints consistent
e6111b2 Make peer id logging consistent ("peer=%d" instead of "peer %d") (Matt Corallo)
2017-01-15 06:44:54 +01:00
Matt Corallo 241d8938f4 Wake message handling thread when we receive a new block
This forces the message handling thread to make another full
iteration of SendMessages prior to going back to sleep, ensuring
we announce the new block to all peers before sleeping.
2017-01-14 16:00:16 -08:00
Matt Corallo f13914a0e9 Make WakeMessageHandler public 2017-01-14 16:00:16 -08:00
practicalswift 8fc698935f Remove redundant semicolons 2017-01-14 21:45:32 +01:00
practicalswift afab9f47f6 [test] Avoid potential NULL pointer dereference in addrman_tests.cpp 2017-01-14 20:18:20 +01:00
MarcoFalke 8daf103fa1
Merge #9528: [qt] Rename formateNiceTimeOffset(qint64) to formatNiceTimeOffset(qint64)
988d300 [qt] Rename formateNiceTimeOffset(qint64) to formatNiceTimeOffset(qint64) (practicalswift)
2017-01-14 11:24:11 +01:00
Pieter Wuille e126d0c12c
Merge #9490: Replace FindLatestBefore used by importmuti with FindEarliestAtLeast.
4b06e41 Add unit test for FindEarliestAtLeast (Suhas Daftuar)
997a98a Replace FindLatestBefore used by importmuti with FindEarliestAtLeast. (Gregory Maxwell)
2017-01-13 16:06:05 -08:00
Pieter Wuille 3908fc4728
Merge #9375: Relay compact block messages prior to full block connection
02ee4eb Make most_recent_compact_block a pointer to a const (Matt Corallo)
73666ad Add comment to describe callers to ActivateBestChain (Matt Corallo)
962f7f0 Call ActivateBestChain without cs_main/with most_recent_block (Matt Corallo)
0df777d Use a temp pindex to avoid a const_cast in ProcessNewBlockHeaders (Matt Corallo)
c1ae4fc Avoid holding cs_most_recent_block while calling ReadBlockFromDisk (Matt Corallo)
9eb67f5 Ensure we meet the BIP 152 old-relay-types response requirements (Matt Corallo)
5749a85 Cache most-recently-connected compact block (Matt Corallo)
9eaec08 Cache most-recently-announced block's shared_ptr (Matt Corallo)
c802092 Relay compact block messages prior to full block connection (Matt Corallo)
6987219 Add a CValidationInterface::NewPoWValidBlock callback (Matt Corallo)
180586f Call AcceptBlock with the block's shared_ptr instead of CBlock& (Matt Corallo)
8baaba6 [qa] Avoid race in preciousblock test. (Matt Corallo)
9a0b2f4 [qa] Make compact blocks test construction using fetch methods (Matt Corallo)
8017547 Make CBlockIndex*es in net_processing const (Matt Corallo)
2017-01-13 14:52:26 -08:00
Matt Corallo 02ee4eb263 Make most_recent_compact_block a pointer to a const 2017-01-13 16:28:15 -05:00
Matt Corallo 376b3c2c6e Make the cs_sendProcessing a LOCK instead of a TRY_LOCK
Technically cs_sendProcessing is entirely useless now because it
is only ever taken on the one MessageHandler thread, but because
there may be multiple of those in the future, it is left in place
2017-01-13 10:34:38 -08:00
Matt Corallo d7c58ad514 Split CNode::cs_vSend: message processing and message sending
cs_vSend is used for two purposes - to lock the datastructures used
to queue messages to place on the wire and to only call
SendMessages once at a time per-node. I believe SendMessages used
to access some of the vSendMsg stuff, but it doesn't anymore, so
these locks do not need to be on the same mutex, and also make
deadlocking much more likely.
2017-01-13 10:34:37 -08:00
practicalswift 95bab821b3 Remove unused Python imports 2017-01-13 19:03:20 +01:00
Pieter Wuille 8b66bf74e2
Merge #9441: Net: Massive speedup. Net locks overhaul
e60360e net: remove cs_vRecvMsg (Cory Fields)
991955e net: add a flag to indicate when a node's send buffer is full (Cory Fields)
c6e8a9b net: add a flag to indicate when a node's process queue is full (Cory Fields)
4d712e3 net: add a new message queue for the message processor (Cory Fields)
c5a8b1b net: rework the way that the messagehandler sleeps (Cory Fields)
c72cc88 net: remove useless comments (Cory Fields)
ef7b5ec net: Add a simple function for waking the message handler (Cory Fields)
f5c36d1 net: record bytes written before notifying the message processor (Cory Fields)
60befa3 net: handle message accounting in ReceiveMsgBytes (Cory Fields)
56212e2 net: set message deserialization version when it's actually time to deserialize (Cory Fields)
0e973d9 net: remove redundant max sendbuffer size check (Cory Fields)
6042587 net: wait until the node is destroyed to delete its recv buffer (Cory Fields)
f6315e0 net: only disconnect if fDisconnect has been set (Cory Fields)
5b4a8ac net: make GetReceiveFloodSize public (Cory Fields)
e5bcd9c net: make vRecvMsg a list so that we can use splice() (Cory Fields)
53ad9a1 net: fix typo causing the wrong receive buffer size (Cory Fields)
2017-01-13 10:02:18 -08:00
practicalswift 988d300932 [qt] Rename formateNiceTimeOffset(qint64) to formatNiceTimeOffset(qint64) 2017-01-13 18:58:15 +01:00
practicalswift 90fd29bd0d Remove unused int64_t nSinceLastSeen 2017-01-13 18:55:10 +01:00
Gregory Maxwell e440ac7ef3 Introduce assumevalid setting to skip presumed valid scripts.
This disentangles the script validation skipping from checkpoints.

A new option is introduced "assumevalid" which specifies a block whos
 ancestors we assume all have valid scriptsigs and so we do not check
 them when they are also burried under the best header by two weeks
 worth of work.

Unlike checkpoints this has no influence on consensus unless you set
 it to a block with an invalid history.  Because of this it can be
 easily be updated without risk of influencing the network consensus.

This results in a massive IBD speedup.

This approach was independently recommended by Peter Todd and Luke-Jr
 since POW based signature skipping (see PR#9180) does not have the
 verifiable properties of a specific hash and may create bad incentives.

The downside is that, like checkpoints, the defaults bitrot and older
 releases will sync slower.  On the plus side users can provide their
 own value here, and if they set it to something crazy all that will
 happen is more time will be spend validating signatures.

Checkblocks and checklevel are also moved to the hidden debug options:
 Especially now that checkblocks has a low default there is little need
 to change these settings, and users frequently misunderstand them as
 influencing security or IBD speed.  By hiding them we offset the
 space added by this new option.
2017-01-13 15:42:24 +00:00
Cory Fields e60360e139 net: remove cs_vRecvMsg
vRecvMsg is now only touched by the socket handler thread.

The accounting vars (nRecvBytes/nLastRecv/mapRecvBytesPerMsgCmd) are also
only used by the socket handler thread, with the exception of queries from
rpc/gui. These accesses are not threadsafe, but they never were. This needs to
be addressed separately.

Also, update comment describing data flow
2017-01-12 23:08:08 -05:00
Cory Fields 991955ee81 net: add a flag to indicate when a node's send buffer is full
Similar to the recv flag, but this one indicates whether or not the net's send
buffer is full.

The socket handler checks the send queue when a new message is added and pauses
if necessary, and possibly unpauses after each message is drained from its buffer.
2017-01-12 23:05:59 -05:00
Cory Fields c6e8a9bcff net: add a flag to indicate when a node's process queue is full
Messages are dumped very quickly from the socket handler to the processor, so
it's the depth of the processing queue that's interesting.

The socket handler checks the process queue's size during the brief message
hand-off and pauses if necessary, and the processor possibly unpauses each time
a message is popped off of its queue.
2017-01-12 23:05:47 -05:00
Cory Fields 4d712e366c net: add a new message queue for the message processor
This separates the storage of messages from the net and queued messages for
processing, allowing the locks to be split.
2017-01-12 23:05:25 -05:00
Cory Fields c5a8b1b946 net: rework the way that the messagehandler sleeps
In order to sleep accurately, the message handler needs to know if _any_ node
has more processing that it should do before the entire thread sleeps.

Rather than returning a value that represents whether ProcessMessages
encountered a message that should trigger a disconnnect, interpret the return
value as whether or not that node has more work to do.

Also, use a global fProcessWake value that can be set by other threads,
which takes precedence (for one cycle) over the messagehandler's decision.

Note that the previous behavior was to only process one message per loop
(except in the case of a bad checksum or invalid header). That was changed in
PR #3180.

The only change here in that regard is that the current node now falls to the
back of the processing queue for the bad checksum/invalid header cases.
2017-01-12 23:05:24 -05:00
Cory Fields c72cc88ed3 net: remove useless comments 2017-01-12 23:05:09 -05:00
Cory Fields ef7b5ecbb7 net: Add a simple function for waking the message handler
This may be used publicly in the future
2017-01-12 23:05:09 -05:00
Cory Fields f5c36d19b6 net: record bytes written before notifying the message processor 2017-01-12 23:05:09 -05:00
Cory Fields 60befa3997 net: handle message accounting in ReceiveMsgBytes
This allows locking to be pushed down to only where it's needed

Also reuse the current time rather than checking multiple times.
2017-01-12 23:05:09 -05:00
Matt Corallo fac4c78028 Make PartiallyDownloadedBlock::InitData's second param const 2017-01-12 12:20:11 -08:00
Matt Corallo b55b416346 Add extra_count lower bound to compact reconstruction debug print 2017-01-12 12:19:14 -08:00
Matt Corallo 73666ad059 Add comment to describe callers to ActivateBestChain 2017-01-12 12:15:17 -08:00
Pieter Wuille 82e8baab3c Avoid boost dynamic_bitset in rest_getutxos 2017-01-12 12:06:32 -08:00
Pieter Wuille 99f001eb52 Fix memory leak in multiUserAuthorized 2017-01-12 11:52:53 -08:00
Pieter Wuille 5a0b7e4106 Fix memory leak in net_tests 2017-01-12 11:52:53 -08:00
Pieter Wuille 6b03bfb840 Fix memory leak in wallet tests 2017-01-12 11:52:53 -08:00
Pieter Wuille f94f3e0df8 Avoid integer overflows in scriptnum tests 2017-01-12 11:52:53 -08:00
Pieter Wuille 843c560003 Avoid unaligned access in crypto i/o 2017-01-12 11:52:45 -08:00
Suhas Daftuar 4b06e41c30 Add unit test for FindEarliestAtLeast 2017-01-12 14:22:15 +00:00
Gregory Maxwell 997a98a674 Replace FindLatestBefore used by importmuti with FindEarliestAtLeast.
In spite of the name FindLatestBefore used std::lower_bound to try
 to find the earliest block with a nTime greater or equal to the
 the requested value.  But lower_bound uses bisection and requires
 the input to be ordered with respect to the comparison operation.
 Block times are not well ordered.

I don't know what lower_bound is permitted to do when the data
 is not sufficiently ordered, but it's probably not good.
 (I could construct an implementation which would infinite loop...)

To resolve the issue this commit introduces a maximum-so-far to the
 block indexes and searches that.

For clarity the function is renamed to reflect what it actually does.

An issue that remains is that there is no grace period in importmulti:
 If a address is created at time T and a send is immediately broadcast
 and included by a miner with a slow clock there may not yet have been
 any block with at least time T.

The normal rescan has a grace period of 7200 seconds, but importmulti
 does not.
2017-01-12 14:21:43 +00:00
MarcoFalke 02e5308c1b
Merge #9525: test: Include tx data in EXTRA_DIST
fa29736 test: Include tx data in EXTRA_DIST (MarcoFalke)
2017-01-12 13:41:32 +01:00
MarcoFalke fa2973678e test: Include tx data in EXTRA_DIST 2017-01-12 13:13:07 +01:00
Wladimir J. van der Laan 7cb024eba6
Merge #9222: Add 'subtractFeeFromAmount' option to 'fundrawtransaction'.
453bda6 Add 'subtractFeeFromOutputs' option to 'fundrawtransaction'. (Chris Moore)
2017-01-12 12:49:10 +01:00
Wladimir J. van der Laan 2742568a00
Merge #9261: Add unstored orphans with rejected parents to recentRejects
dfbe0d5 Add unstored orphans with rejected parents to recentRejects (Alex Morcos)
2017-01-12 12:34:44 +01:00
Wladimir J. van der Laan d5d4ad87af
Merge #8883: Add all standard TXO types to bitcoin-tx
0c50909 testcases: explicitly specify transaction version 1 (John Newbery)
b7e144b Add test cases to test new bitcoin-tx functionality (jnewbery)
61a1534 Add all transaction output types to bitcoin-tx. (jnewbery)
1814b08 add p2sh and segwit options to bitcoin-tx outscript command (Stanislas Marion)
2017-01-12 12:24:35 +01:00
Wladimir J. van der Laan fac0f30482
Merge #9472: Disentangle progress estimation from checkpoints and update it
df36371 Update estimated transaction count data (Pieter Wuille)
e356d9a Shorten variable names and switch to tx/s (Pieter Wuille)
6dd8116 Remove SIGCHECK_VERIFICATION_FACTOR (Pieter Wuille)
3641141 Move tx estimation data out of CCheckPointData (Pieter Wuille)
a4bac66 [MOVEONLY] Move progress estimation out of checkpoints (Pieter Wuille)
2017-01-12 12:13:14 +01:00
MarcoFalke a65ced1a66
Merge #9518: Return height of last block pruned by pruneblockchain RPC
918d1fb Return height of last block pruned by pruneblockchain RPC (Russell Yanofsky)
2017-01-12 11:50:14 +01:00
MarcoFalke 2456a835f0
Merge #9520: Deprecate non-txindex getrawtransaction and better warning
db904db Deprecate non-txindex getrawtransaction and better warning (Pieter Wuille)
2017-01-12 10:52:32 +01:00
Matt Corallo 962f7f054f Call ActivateBestChain without cs_main/with most_recent_block
There is still a call to ActivateBestChain with cs_main if a peer
requests the block prior to it being validated, but this one is
more specifically-gated, so should be less of an issue.
2017-01-11 21:18:48 -08:00
MarcoFalke 0b738075bd
Merge #9297: Various RPC help outputs updated
54ee3fc RPC help updated (Michael Rotarius)
2017-01-12 02:11:04 +01:00
Pieter Wuille db904db7e6 Deprecate non-txindex getrawtransaction and better warning 2017-01-11 15:34:13 -08:00
Matt Corallo 0df777db6d Use a temp pindex to avoid a const_cast in ProcessNewBlockHeaders 2017-01-11 14:47:52 -08:00
Jeremy Rubin aad4cb5059 Address ryanofsky feedback on CCheckQueue benchmarks. Eliminated magic numbers, fixed scoping of vectors (and memory movement component of benchmark). 2017-01-11 17:05:06 -05:00
Pieter Wuille 05950427d3
Merge #9507: Fix use-after-free in CTxMemPool::removeConflicts()
fe7e593 Fix use-after-free in CTxMemPool::removeConflicts() (Suhas Daftuar)
2017-01-11 13:59:00 -08:00
Michael Rotarius 54ee3fcb8f RPC help updated 2017-01-11 22:05:23 +01:00
Russell Yanofsky 918d1fb86b Return height of last block pruned by pruneblockchain RPC
Change suggested by Jonas Schnelli <dev@jonasschnelli.ch> in
https://github.com/bitcoin/bitcoin/pull/7871#discussion_r95577623
2017-01-11 14:25:32 -05:00
Pieter Wuille df3637177a Update estimated transaction count data 2017-01-11 08:21:40 -08:00
Pieter Wuille e356d9a758 Shorten variable names and switch to tx/s 2017-01-11 08:21:37 -08:00
Wladimir J. van der Laan e2e624d9ce
Merge #7871: Manual block file pruning.
afffeea fixup! Add pruneblockchain RPC to enable manual block file pruning. (Russell Yanofsky)
1fc4ec7 Add pruneblockchain RPC to enable manual block file pruning. (mrbandrews)
2017-01-11 14:26:00 +01:00
Wladimir J. van der Laan bbf193fef0
Merge #9513: build: fix qt distdir builds (retry)
67ca130 build: fix for out-of-tree/distdir qt builds (Cory Fields)
2017-01-11 13:45:28 +01:00
Cory Fields 67ca130f73 build: fix for out-of-tree/distdir qt builds 2017-01-10 20:03:38 -05:00
Alex Morcos 116419e58d Don't overwrite validation state with corruption check
AcceptToMemoryPool has several classes of return false statements.
- return state.Invalid or state.DoS directly itself
- return false and set fMissingInputs (state is valid)
- return false and state is set by failed CheckTransaction
- return false and state is set by failed CheckInputs.

This commit patches the last case where the state variable was reused for additional calls to CheckInputs to identify witness stripping as cause of validation failure.  After this commit, it should be the case that if !fMissingInputs, state is always Invalid if AcceptToMemoryPool returns false.
2017-01-10 16:53:10 -05:00
Suhas Daftuar fe7e593b24 Fix use-after-free in CTxMemPool::removeConflicts() 2017-01-10 15:21:21 -05:00
Matt Corallo 863edb45b9 Consider all (<100k memusage) txn for compact-block-extra-txn cache 2017-01-10 14:48:42 -05:00
Matt Corallo 7f8c8cab1e Consider all orphan txn for compact-block-extra-txn cache 2017-01-10 14:48:42 -05:00
Matt Corallo 93380c5247 Use replaced transactions in compact block reconstruction 2017-01-10 14:48:42 -05:00
Matt Corallo 1531652e02 Keep shared_ptrs to recently-replaced txn for compact blocks 2017-01-10 14:48:42 -05:00
Suhas Daftuar 766e8a40b4 [wallet] Add IsAllFromMe: true if all inputs are from wallet 2017-01-10 08:14:50 -05:00
Wladimir J. van der Laan 5754e0341b
Merge #8811: rpc: Add support for JSON-RPC named arguments
4e7e2e1 Update RPC argument names (John Newbery)
481f289 rpc: Named argument support for bitcoin-cli (Wladimir J. van der Laan)
9adb4e1 rpc: Argument name consistency (Wladimir J. van der Laan)
8d713f7 rpc: Named arguments for rawtransaction calls (Wladimir J. van der Laan)
37a166f rpc: Named arguments for wallet calls (Wladimir J. van der Laan)
78b684f rpc: Named arguments for mining calls (Wladimir J. van der Laan)
b8ebc59 rpc: Named arguments for net calls (Wladimir J. van der Laan)
2ca9dcd test: Add test for RPC named arguments (Wladimir J. van der Laan)
fba1a61 rpc: Named arguments for misc calls (Wladimir J. van der Laan)
286ec08 rpc: Add 'echo' call for testing (Wladimir J. van der Laan)
495eb44 rpc: Named arguments for blockchain calls (Wladimir J. van der Laan)
6f1c76a rpc: Support named arguments (Wladimir J. van der Laan)
5865d41 authproxy: Add support for RPC named arguments (Wladimir J. van der Laan)
2017-01-10 14:14:50 +01:00
Russell Yanofsky afffeea7d9 fixup! Add pruneblockchain RPC to enable manual block file pruning.
Extend pruneblockchain RPC to accept block timestamps as well as block indices.
2017-01-10 08:14:50 -05:00
mrbandrews 1fc4ec7bf2 Add pruneblockchain RPC to enable manual block file pruning. 2017-01-10 08:14:50 -05:00
Wladimir J. van der Laan 68eb56203b
qt: periodic translations update 2017-01-10 12:52:02 +01:00
John Newbery 4e7e2e16e4 Update RPC argument names 2017-01-10 12:04:54 +01:00
Wladimir J. van der Laan 481f289765 rpc: Named argument support for bitcoin-cli
Usage e.g.:

    $ src/bitcoin-cli -testnet -named echo arg0="dfdf"
    [
    "dfdf"
    ]

Argument conversion also works, for arguments thus flagged in the table in
`src/rpc/client.cpp`.

    $ src/bitcoin-cli -testnet -named echojson arg0="[1,2,3]"
    [
      [
        1,
        2,
        3
      ]
    ]

Unknown parameter (detected server-side):

    $ src/bitcoin-cli -testnet -named getinfo arg0="dfdf"
    error code: -8
    error message:
    Unknown named parameter arg0
2017-01-10 12:04:54 +01:00
MarcoFalke 98c80e374b
Merge #9496: Rename lambda argument name to prevent shadowing
7df5e38 Rename lambda argument name to prevent shadowing. (Pavel Janík)
2017-01-10 10:14:22 +01:00
John Newbery 0c50909347 testcases: explicitly specify transaction version 1 2017-01-09 16:42:45 -05:00
Matt Corallo edded808fc Make ATMP optionally return the CTransactionRefs it replaced 2017-01-09 14:15:18 -05:00
Matt Corallo c735540428 Move ORPHAN constants from validation.h to net_processing.h 2017-01-09 14:15:18 -05:00
Jeremy Rubin 9f03110f32 Add Basic CheckQueue Benchmark 2017-01-09 14:07:02 -05:00
Pavel Janík 7df5e382e5 Rename lambda argument name to prevent shadowing. 2017-01-09 19:31:19 +01:00
Pieter Wuille 07fd147b9f
Merge #9353: Add data() method to CDataStream (and use it)
5113474 wallet: Use CDataStream.data() (Wladimir J. van der Laan)
e2300ff bench: Use CDataStream.data() (Wladimir J. van der Laan)
adff950 dbwrapper: Use new .data() method of CDataStream (Wladimir J. van der Laan)
a2141e4 streams: Remove special cases for ancient MSVC (Wladimir J. van der Laan)
af4c44c streams: Add data() method to CDataStream (Wladimir J. van der Laan)
2017-01-09 08:47:47 -08:00
Pieter Wuille 12e3112794
Merge #9404: Smarter coordination of change and fee in CreateTransaction.
20449ef Don't overpay fee if we have selected new coins that result in a smaller transaction. (Alex Morcos)
42f5ce4 Try to reduce change output to make needed fee in CreateTransaction (Alex Morcos)
2017-01-09 08:37:35 -08:00
Pieter Wuille 8c87f175d3
Merge #9310: Assert FRESH validity in CCoinsViewCache::BatchWrite
dd44ea3 Check FRESH validity in CCoinsViewCache::BatchWrite (Russell Yanofsky)
2017-01-09 08:01:08 -08:00
Matt Corallo e6111b2398 Make peer id logging consistent ("peer=%d" instead of "peer %d") 2017-01-07 16:19:34 -05:00
Douglas Roark cc0589639c
Remove stray semicolon (Fix empty body warning)
Empty body introduced by commit #9319 should not be empty.
2017-01-07 09:49:14 -08:00
Pieter Wuille 46b249e578
Merge #9408: Allow shutdown during LoadMempool, dump only when necessary
325e400 [Qt] Do proper shutdown (Jonas Schnelli)
9479f8d Allow shutdown during LoadMempool, dump only when necessary (Jonas Schnelli)
2017-01-06 09:37:43 -08:00
Pieter Wuille a55716abe5
Merge #9319: Break addnode out from the outbound connection limits.
032ba3f RPC help documentation for addnode peerinfo. (Gregory Maxwell)
90f13e1 Add release notes for addnode changes. (Gregory Maxwell)
50bd12c Break addnode out from the outbound connection limits. (Gregory Maxwell)
2017-01-06 08:37:47 -08:00
Alex Morcos 20449ef09e Don't overpay fee if we have selected new coins that result in a smaller transaction.
On repeated calls to SelectCoins we try to meet the fee necessary for the last transaction, the new fee required might be smaller, so increase our change by the difference if we can.
2017-01-06 10:18:56 -05:00
Alex Morcos 42f5ce4093 Try to reduce change output to make needed fee in CreateTransaction
Once we've picked coins and dummy-signed the transaction to calculate fee, if we don't have sufficient fee, then try to meet the fee by reducing change before resorting to picking new coins.
2017-01-06 10:12:05 -05:00
Pieter Wuille f646275b90
Merge #9138: Improve fee estimation
44b64b9 Fix edge case with stale fee estimates (Alex Morcos)
78ae62d Add clarifying comments to fee estimation (Alex Morcos)
5fe0f47 Add extra logging to processBlock in fee estimation. (Alex Morcos)
dc008c4 Add IsCurrentForFeeEstimatation (Alex Morcos)
ebafdca Pass pointers to existing CTxMemPoolEntries to fee estimation (Alex Morcos)
d825838 Always update fee estimates on new blocks. (Alex Morcos)
6f06b26 rename bool to validFeeEstimate (Alex Morcos)
84f7ab0 Remove member variable hadNoDependencies from CTxMemPoolEntry (Alex Morcos)
60ac00d Don't track transactions at all during IBD. (Alex Morcos)
4df4479 Remove extraneous LogPrint from fee estimation (Alex Morcos)
2017-01-05 14:22:19 -08:00
Pieter Wuille c252685aa5
Merge #8610: Share unused mempool memory with coincache
ba3cecf Share unused mempool memory with coincache (Pieter Wuille)
2017-01-05 13:52:24 -08:00
Pieter Wuille a7d55c9338
Merge #9465: [Wallet] Do not perform ECDSA signing in the fee calculation inner loop.
b3d7b1c Wallet: Do not perform ECDSA in the fee calculation inner loop. (Gregory Maxwell)
2017-01-05 13:37:03 -08:00
Matt Corallo c1ae4fcf7d Avoid holding cs_most_recent_block while calling ReadBlockFromDisk 2017-01-05 15:16:34 -05:00
Jonas Schnelli fd7d8c7b35
Merge #9413: [CoinControl] Allow non-wallet owned change addresses
54f8026 [CoinControl] Allow non-wallet owned change addresses (Jonas Schnelli)
2017-01-05 21:00:06 +01:00
Wladimir J. van der Laan a72f76ca3d
Merge #9312: Increase mempool expiry time to 2 weeks
5f0e27f Increase mempool expiry time to 2 weeks (Alex Morcos)
2017-01-05 20:32:57 +01:00
Gregory Maxwell 032ba3f066 RPC help documentation for addnode peerinfo.
Also adds a comment about the netgroup exclusion behavior.
2017-01-05 19:02:15 +00:00
Gregory Maxwell 50bd12ce0c Break addnode out from the outbound connection limits.
Previously addnodes were in competition with outbound connections
 for access to the eight outbound slots.

One result of this is that frequently a node with several addnode
 configured peers would end up connected to none of them, because
 while the addnode loop was in its two minute sleep the automatic
 connection logic would fill any free slots with random peers.
 This is particularly unwelcome to users trying to maintain links
 to specific nodes for fast block relay or purposes.

Another result is that a group of nine or more nodes which are
 have addnode configured towards each other can become partitioned
 from the public network.

This commit introduces a new limit of eight connections just for
 addnode peers which is not subject to any of the other connection
 limitations (including maxconnections).

The choice of eight is sufficient so that under no condition would
 a user find themselves connected to fewer addnoded peers than
 previously.  It is also low enough that users who are confused
 about the significance of more connections and have gotten too
 copy-and-paste happy will not consume more than twice the slot
 usage of a typical user.

Any additional load on the network resulting from this will likely
 be offset by a reduction in users applying even more wasteful
 workaround for the prior behavior.

The retry delays are reduced to avoid nodes sitting around without
 their added peers up, but are still sufficient to prevent overly
 aggressive repeated connections.  The reduced delays also make
 the system much more responsive to the addnode RPC.

Ban-disconnects are also exempted for peers added via addnode since
 the outbound addnode logic ignores bans.  Previously it would ban
 an addnode then immediately reconnect to it.

A minor change was also made to CSemaphoreGrant so that it is
 possible to re-acquire via an object whos grant was moved.
2017-01-05 19:02:09 +00:00
Gregory Maxwell b3d7b1cbe7 Wallet: Do not perform ECDSA in the fee calculation inner loop.
Performing signing in the inner loop has terrible performance
 when many passes through are needed to complete the selection.

Signing before the algorithm is complete also gets in the way
 of correctly setting the fee (e.g. preventing over-payment when
 the fee required goes down on the final selection.)

Use of the dummy might overpay on the signatures by a couple bytes
 in uncommon cases where the signatures' DER encoding is smaller
 than the dummy: Who cares?
2017-01-05 18:15:01 +00:00
Matt Corallo 9eb67f5000 Ensure we meet the BIP 152 old-relay-types response requirements
In order to do this, we must call ActivateBestChain prior to
responding getdata requests for blocks which we announced using
compact blocks.

For getheaders responses we dont need code changes, but do note
that we must reset the bestHeaderSent so that the SendMessages call
re-announces the header in question.

While we could do something smarter for getblocks, calling
ActivateBestChain is simple and more obviously correct, instead of
doing something more similar to getheaders.

See-also the BIP clarifications at
https://github.com/bitcoin/bips/pull/486
2017-01-05 10:32:07 -05:00
Matt Corallo 5749a853b9 Cache most-recently-connected compact block 2017-01-05 10:32:07 -05:00
Matt Corallo 9eaec08dd2 Cache most-recently-announced block's shared_ptr 2017-01-05 10:32:07 -05:00
Matt Corallo c802092142 Relay compact block messages prior to full block connection 2017-01-05 10:32:07 -05:00
Matt Corallo 6987219577 Add a CValidationInterface::NewPoWValidBlock callback 2017-01-05 10:32:07 -05:00
Jonas Schnelli 325e400f9b
[Qt] Do proper shutdown 2017-01-05 12:40:10 +01:00
Wladimir J. van der Laan ce43630d1e
Merge #8747: [rpc] Fix transaction size comments and RPC help text.
d29505d Fix transaction size comments. Size now refers to virtual size as defined in BIP141. (jonnynewbs)
2017-01-05 12:06:42 +01:00
MarcoFalke 4cfd57d2e3
Merge #9281: Refactor: Remove using namespace <xxx> from bench/ & test/ sources
73f4119 Refactoring: Removed using namespace <xxx> from bench/ and test/ source files. (Karl-Johan Alm)
2017-01-05 11:32:05 +01:00
Wladimir J. van der Laan 9adb4e1a59 rpc: Argument name consistency
The meaning is clear from the context, and we're inconsistent here.
Also save typing when using named arguments.

- `bitcoinaddress` -> `address`
- `bitcoinprivkey` -> `privkey`
- `bitcoinpubkey` -> `pubkey`
2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan 8d713f761b rpc: Named arguments for rawtransaction calls 2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan 37a166f146 rpc: Named arguments for wallet calls 2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan 78b684f2ac rpc: Named arguments for mining calls 2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan b8ebc595bb rpc: Named arguments for net calls
Also add a more descriptive message for `setnetworkactive`.
2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan fba1a6150c rpc: Named arguments for misc calls 2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan 286ec08cb0 rpc: Add 'echo' call for testing
This hidden call simply returns what is passed in.
2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan 495eb44a4f rpc: Named arguments for blockchain calls 2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan 6f1c76ae14 rpc: Support named arguments
The [JSON-RPC specification](http://www.jsonrpc.org/specification) allows passing parameters as an Array, for by-position
arguments, or an Object, for by-name arguments.

This implements by-name arguments, but preserves full backwards compatibility. API using by-name arguments are
easier to extend, and easier to use (no need to guess which argument goes where).

Named are mapped to positions by a per-call structure, provided through the RPC command table.

Missing arguments will be replaced by null, except if at the end, then the argument is left out completely.

Currently calls fail (though not crash) on intermediate nulls, but this should be improved on a per-call basis later.
2017-01-05 11:30:20 +01:00
Wladimir J. van der Laan cfe41d7a60
Merge #9387: [Refactor] RAII of libevent stuff using unique ptrs with deleters
05a55a6 Added EVENT_CFLAGS to test makefile to explicitly include libevent headers. (Karl-Johan Alm)
280a559 Added some simple tests for the RAII-style events. (Karl-Johan Alm)
7f7f102 Switched bitcoin-cli.cpp to use RAII unique pointers with deleters. (Karl-Johan Alm)
e5534d2 Added std::unique_ptr<> wrappers with deleters for libevent modules. (Karl-Johan Alm)
2017-01-05 11:11:17 +01:00
Wladimir J. van der Laan c4b7d4f79c
Merge #9417: Do not evaluate hidden LogPrint arguments
407cdd6 Do not evaluate hidden LogPrint arguments (Pieter Wuille)
2017-01-05 10:49:00 +01:00
Wladimir J. van der Laan 48d7e0d5e4
Merge #9474: Mark the minconf parameter to move as ignored
ce370c1 Mark the minconf parameter to move as ignored (Pieter Wuille)
2017-01-05 10:29:26 +01:00
Wladimir J. van der Laan 7014506415
Merge #9475: Let autoconf detect presence of EVP_MD_CTX_new
0388afe Let autoconf detect presence of EVP_MD_CTX_new (Luke Dashjr)
2017-01-05 10:28:47 +01:00
Pieter Wuille 6dd81169fc Remove SIGCHECK_VERIFICATION_FACTOR 2017-01-04 13:18:49 -08:00
Pieter Wuille 3641141c8f Move tx estimation data out of CCheckPointData 2017-01-04 13:18:49 -08:00
Pieter Wuille a4bac66cca [MOVEONLY] Move progress estimation out of checkpoints 2017-01-04 13:18:49 -08:00
Matt Corallo 180586fd44 Call AcceptBlock with the block's shared_ptr instead of CBlock& 2017-01-04 15:56:08 -05:00
Matt Corallo 80175472d1 Make CBlockIndex*es in net_processing const 2017-01-04 15:56:08 -05:00
Russell Yanofsky dd44ea39bb Check FRESH validity in CCoinsViewCache::BatchWrite 2017-01-04 14:56:17 -05:00
Pieter Wuille 7dac1e5e9e
Merge #9107: Safer modify new coins
b50cd7a Fix dangerous condition in ModifyNewCoins. (Alex Morcos)
2017-01-04 11:56:17 -08:00
Luke Dashjr 0388afe69d Let autoconf detect presence of EVP_MD_CTX_new
Fixes LibreSSL compatibility
2017-01-04 18:37:37 +00:00
Alex Morcos daec955fd6 Introduce -blockmintxfee 2017-01-04 13:24:19 -05:00
Alex Morcos 44b64b933d Fix edge case with stale fee estimates 2017-01-04 12:10:18 -05:00
Alex Morcos 78ae62d264 Add clarifying comments to fee estimation 2017-01-04 12:10:18 -05:00
Alex Morcos 5fe0f47aa7 Add extra logging to processBlock in fee estimation. 2017-01-04 12:10:18 -05:00
Alex Morcos dc008c462f Add IsCurrentForFeeEstimatation
Make a more conservative notion of whether the node is caught up to the rest of the network and only count transactions as fee estimation data points if the node is caught up.
2017-01-04 12:10:17 -05:00
Alex Morcos ebafdcabb1 Pass pointers to existing CTxMemPoolEntries to fee estimation 2017-01-04 12:09:34 -05:00
Alex Morcos d825838e64 Always update fee estimates on new blocks.
All decisions about whether the transactions are valid data points are made at the time the transaction arrives. Updating on blocks all the time will now cause stale fee estimates to decay quickly when we restart a node.
2017-01-04 12:09:34 -05:00
Alex Morcos 6f06b268c1 rename bool to validFeeEstimate 2017-01-04 12:09:33 -05:00
Alex Morcos 84f7ab08d2 Remove member variable hadNoDependencies from CTxMemPoolEntry
Fee estimation can just check its own mapMemPoolTxs to determine the same information.  Note that now fee estimation for block processing must happen before those transactions are removed, but this shoudl be a speedup.
2017-01-04 12:09:33 -05:00
Alex Morcos 60ac00de85 Don't track transactions at all during IBD.
This was an oversight, where blocks and mempool tracking were ignored during IBD, but transactions that arrived during IBD but were included in blocks after IBD were not ignored.
2017-01-04 12:05:05 -05:00
Alex Morcos 4df44794c9 Remove extraneous LogPrint from fee estimation
Once priority estimation was removed, not all transactions in the mempool are tracked in the fee estimation mempool tracking.  So there is no error if a transaction is not found for removal.
2017-01-04 12:03:44 -05:00
Pieter Wuille ce370c1811 Mark the minconf parameter to move as ignored 2017-01-04 08:48:21 -08:00
Alex Morcos b50cd7a67e Fix dangerous condition in ModifyNewCoins.
We were marking coins FRESH before being sure they were not overwriting dirty undo data. This condition was never reached in existing code because undo data was always flushed before UpdateCoins was called with new transactions, but could have been exposed in an otherwise safe refactor.
Clarify in the comments the assumptions made in ModifyNewCoins.
Add ability to undo transactions to UpdateCoins unit test.
Thanks to Russ Yanofsky for suggestion on how to make logic clearer and fixing up the ccoins_modify_new test cases.
2017-01-04 11:20:42 -05:00
Wladimir J. van der Laan 123ea73624
Merge #9457: [qt] Select more files for translation
facf3e7 [qt] `make translate` (MarcoFalke)
fae26e8 [qt] Add more sources to translate (MarcoFalke)
2017-01-04 16:41:29 +01:00
Cory Fields 56212e20ac net: set message deserialization version when it's actually time to deserialize
We'll soon no longer have access to vRecvMsg, and this is more intuitive anyway.
2017-01-04 10:10:35 -05:00
Cory Fields 0e973d970a net: remove redundant max sendbuffer size check
This is left-over from before there was proper accounting. Hitting 2x the
sendbuffer size should not be possible.
2017-01-04 10:10:35 -05:00
Cory Fields 60425870d7 net: wait until the node is destroyed to delete its recv buffer
when vRecvMsg becomes a private buffer, it won't make sense to allow other
threads to mess with it anymore.
2017-01-04 09:29:14 -05:00
Cory Fields f6315e07f9 net: only disconnect if fDisconnect has been set
These conditions are problematic to check without locking, and we shouldn't be
relying on the refcount to disconnect.
2017-01-04 09:29:14 -05:00
Cory Fields 5b4a8ac6d6 net: make GetReceiveFloodSize public
This will be needed so that the message processor can cork incoming messages
2017-01-04 09:29:14 -05:00
Cory Fields e5bcd9c84f net: make vRecvMsg a list so that we can use splice() 2017-01-04 09:29:14 -05:00
Cory Fields 53ad9a133a net: fix typo causing the wrong receive buffer size
Surprisingly this hasn't been causing me any issues while testing, probably
because it requires lots of large blocks to be flying around.

Send/Recv corks need tests!
2017-01-04 09:29:14 -05:00
MarcoFalke df1ab5b4d6
Merge #9470: qt: Set (count) placeholder in sendcoinsdialog to notranslate
388ea19 qt: Set (count) placeholder in sendcoinsdialog to notranslate (Wladimir J. van der Laan)
2017-01-04 15:19:00 +01:00
Wladimir J. van der Laan 388ea19bf2 qt: Set (count) placeholder in sendcoinsdialog to notranslate 2017-01-04 14:37:53 +01:00
MarcoFalke c2ea1e6561
Merge #9401: Make rpcauth help message clearer, add example in example .conf
0513c70 Make rpcauth help message clearer, add example in example .conf (Gregory Sanders)
2017-01-04 13:00:12 +01:00
Wladimir J. van der Laan d65a13b773
Merge #9396: Updated listsinceblock rpc documentation
3f67972 updated listsinceblock rpc docs (accraze)
2017-01-04 12:47:56 +01:00
Wladimir J. van der Laan 1ce7ede2a9
Merge #9288: Fix a bug if the min fee is 0 for FeeFilterRounder
f8d43b8 Avoid rollingMinimumFeeRate never being able to decay below half (Alex Morcos)
eab8e1b fix a bug if the min fee is 0 for FeeFilterRounder (Alex Morcos)
2017-01-04 12:33:56 +01:00
Wladimir J. van der Laan 869781c51c
Merge #9283: A few more CTransactionRef optimizations
91335ba Remove unused MakeTransactionRef overloads (Pieter Wuille)
6713f0f Make FillBlock consume txn_available to avoid shared_ptr copies (Pieter Wuille)
62607d7 Convert COrphanTx to keep a CTransactionRef (Pieter Wuille)
c44e4c4 Make AcceptToMemoryPool take CTransactionRef (Pieter Wuille)
2017-01-04 12:23:10 +01:00
Wladimir J. van der Laan d9ae1cefa0
Merge #9289: net: drop boost::thread_group
67ee4ec net: misc header cleanups (Cory Fields)
8b3159e net: make proxy receives interruptible (Cory Fields)
5cb0fce net: remove thread_interrupted catch (Cory Fields)
d3d7056 net: make net processing interruptible (Cory Fields)
0985052 net: make net interruptible (Cory Fields)
799df91 net: add CThreadInterrupt and InterruptibleSleep (Cory Fields)
7325b15 net: a few small cleanups before replacing boost threads (Cory Fields)
2017-01-04 12:21:53 +01:00
MarcoFalke facf3e7608 [qt] make translate 2017-01-04 12:13:03 +01:00
MarcoFalke fae26e8dfc [qt] Add more sources to translate 2017-01-04 12:12:43 +01:00
Wladimir J. van der Laan c0ddd32bf6
Merge #9450: Increment MIT licence copyright header year on files modified in 2016
27765b6 Increment MIT Licence copyright header year on files modified in 2016 (isle2983)
2017-01-04 12:09:05 +01:00
Karl-Johan Alm 05a55a639b Added EVENT_CFLAGS to test makefile to explicitly include libevent headers. 2017-01-04 18:16:55 +09:00
Wladimir J. van der Laan 649cf5fe89
Merge #9462: [qt] Do not translate tilde character
fab6c5f [qt] Do not translate `~` (MarcoFalke)
2017-01-04 08:21:04 +01:00
Cory Fields 67ee4ec901 net: misc header cleanups 2017-01-03 17:56:21 -05:00
Cory Fields 8b3159ef0a net: make proxy receives interruptible 2017-01-03 17:56:21 -05:00
Cory Fields 5cb0fcee81 net: remove thread_interrupted catch
This is now a std::thread, so there's no hope of catching a boost interruption
point.
2017-01-03 17:56:21 -05:00
Cory Fields d3d7056d2a net: make net processing interruptible 2017-01-03 17:56:20 -05:00
Cory Fields 0985052319 net: make net interruptible
Also now that net threads are interruptible, switch them to use std
threads/binds/mutexes/condvars.
2017-01-03 17:53:09 -05:00
Cory Fields 799df9115f net: add CThreadInterrupt and InterruptibleSleep 2017-01-03 17:53:09 -05:00
Cory Fields 7325b15566 net: a few small cleanups before replacing boost threads
- Drop the interruption point directly after the pnode allocation. This would
    be leaky if hit.
- Rearrange thread creation so that the socket handler comes first
2017-01-03 17:53:09 -05:00
Pieter Wuille 2a524b8e8f
Merge #8776: Wallet refactoring leading up to multiwallet
5394b39 Wallet: Split main logic from InitLoadWallet into CreateWalletFromFile (Luke Dashjr)
fb0c934 Wallet: Let the interval-flushing thread figure out the filename (Luke Dashjr)
2017-01-03 14:11:11 -08:00
Pieter Wuille ce5c1f4aca
Merge #9252: Release cs_main before calling ProcessNewBlock, or processing headers (cmpctblock handling)
bd02bdd Release cs_main before processing cmpctblock as header (Suhas Daftuar)
680b0c0 Release cs_main before calling ProcessNewBlock (cmpctblock handling) (Suhas Daftuar)
2017-01-03 13:52:16 -08:00
MarcoFalke fab6c5f46b [qt] Do not translate ~ 2017-01-03 17:51:12 +01:00
Jonas Schnelli 6dc4c43d32
Merge #8877: Qt RPC console: history sensitive-data filter, and saving input line when browsing history
8562792 GUI/RPCConsole: Include importmulti in history sensitive-command filter (Luke Dashjr)
ff77faf Qt/RPCConsole: Use RPCParseCommandLine to perform command filtering (Luke Dashjr)
a79598d Qt/Test: Make sure filtering sensitive data works correctly in nested commands (Luke Dashjr)
629cd42 Qt/RPCConsole: Teach RPCParseCommandLine how to filter out arguments to sensitive commands (Luke Dashjr)
e2d9213 Qt/RPCConsole: Make it possible to parse a command without executing it (Luke Dashjr)
1755c04 Qt/RPCConsole: Truncate filtered commands to just the command name, rather than skip it entirely in history (Luke Dashjr)
d80a006 Qt/RPCConsole: Add signmessagewithprivkey to list of commands filtered from history (Luke Dashjr)
afde12f Qt/RPCConsole: Refactor command_may_contain_sensitive_data function out of RPCConsole::on_lineEdit_returnPressed (Luke Dashjr)
de8980d Bugfix: Do not add sensitive information to history for real (Luke Dashjr)
9044908 Qt/RPCConsole: Don't store commands with potentially sensitive information in the history (Jonas Schnelli)
fc95daa Qt/RPCConsole: Save current command entry when browsing history (Jonas Schnelli)
2017-01-03 16:57:21 +01:00
Wladimir J. van der Laan d45b21e2b3 qt: Fill in English numerusforms
minute/minutes block/blocks and so forth.
2017-01-03 15:03:37 +01:00
Wladimir J. van der Laan a9d6151802 qt,wallet: Fix a few typos in messages
As reported by [yahoe.001](https://www.transifex.com/user/profile/yahoe.001/).
2017-01-03 15:01:46 +01:00
Jonas Schnelli 510c0d9c79
Merge #9446: SetMerkleBranch: remove unused code, remove cs_main lock requirement
9e351c9 SetMerkleBranch: remove unused code, remove cs_main lock requirement (Jonas Schnelli)
2017-01-03 09:31:57 +01:00
Karl-Johan Alm 73f41190b9 Refactoring: Removed using namespace <xxx> from bench/ and test/ source files. 2017-01-02 20:35:23 +09:00
Wladimir J. van der Laan 1d2d67692c
qt: Set transifex slug to 0.14
Also perform update of source translations.
2017-01-02 09:36:03 +01:00
isle2983 27765b6403 Increment MIT Licence copyright header year on files modified in 2016
Edited via:

$ contrib/devtools/copyright_header.py update .
2016-12-31 11:01:21 -07:00
Gregory Sanders d4781ac6c2 Set peers as HB peers upon full block validation 2016-12-30 14:05:13 -05:00
Jonas Schnelli 9e351c9586
SetMerkleBranch: remove unused code, remove cs_main lock requirement 2016-12-30 10:37:13 +01:00
jnewbery b7e144bb73 Add test cases to test new bitcoin-tx functionality
This commit add testcases to test the following functions in bitcoin-tx:

- add a pay to non-standard script output
- add a P2SH output
- add a P2WSH output
- add a P2WSH wrapped in a P2SH output
- add a pay to pub key output
- add a P2WPKH output
- add a P2WPKH wrapped in a P2SH output
- add a bare multisig output
- add a multisig in P2SH output
- add a multisig in a P2WSH output
- add a multisig in a P2WSH wrapped in as P2SH output
2016-12-29 15:40:40 +00:00
jnewbery 61a153443e Add all transaction output types to bitcoin-tx.
This commit enhances bitcoin-tx so all remaining standard TXO types can be created:

- Pay to Pub Key
- Multi-sig
  - bare multi-sig
  - multi-sig in Pay To Script Hash
  - multi-sig in Pay to Witness Script Hash
  - multi-sig in Pay to Witness Script Hash, wrapped in P2SH
- Pay to Witness Pub Key Hash
  - Pay to Witness Pub Key Hash, wrapped in P2SH
- Pay to Witness Script Hash
  - Pay to Witness Script Hash, wrapped in P2SH
2016-12-29 15:40:40 +00:00
Stanislas Marion 1814b089fb add p2sh and segwit options to bitcoin-tx outscript command 2016-12-29 15:40:40 +00:00
Luke Dashjr 8562792095 GUI/RPCConsole: Include importmulti in history sensitive-command filter 2016-12-29 11:47:58 +00:00
Luke Dashjr ff77faf480 Qt/RPCConsole: Use RPCParseCommandLine to perform command filtering 2016-12-29 11:47:58 +00:00
Luke Dashjr a79598ddf4 Qt/Test: Make sure filtering sensitive data works correctly in nested commands 2016-12-29 11:46:26 +00:00
Luke Dashjr 629cd42364 Qt/RPCConsole: Teach RPCParseCommandLine how to filter out arguments to sensitive commands 2016-12-29 11:46:26 +00:00
Luke Dashjr e2d9213c32 Qt/RPCConsole: Make it possible to parse a command without executing it 2016-12-29 11:43:29 +00:00
Luke Dashjr 1755c04576 Qt/RPCConsole: Truncate filtered commands to just the command name, rather than skip it entirely in history 2016-12-29 11:43:29 +00:00
Luke Dashjr d80a00660f Qt/RPCConsole: Add signmessagewithprivkey to list of commands filtered from history 2016-12-29 11:43:29 +00:00
Luke Dashjr afde12f265 Qt/RPCConsole: Refactor command_may_contain_sensitive_data function out of RPCConsole::on_lineEdit_returnPressed 2016-12-29 11:43:29 +00:00
Luke Dashjr de8980df9d Bugfix: Do not add sensitive information to history for real
Original code was missing braces, and short-circuited before checking everything after importprivkey
2016-12-29 11:43:29 +00:00
Jonas Schnelli 9044908636 Qt/RPCConsole: Don't store commands with potentially sensitive information in the history
Filters importprivkey, signrawtransaction, walletpassphrase, walletpassphrasechange, and encryptwallet
2016-12-29 11:43:28 +00:00
Jonas Schnelli fc95daa97f Qt/RPCConsole: Save current command entry when browsing history
Shell-like, but doesn't store changed history commands until executing it.
2016-12-29 11:43:28 +00:00
MarcoFalke dce853ef76
Merge #9436: test: Include tx data in EXTRA_DIST
fa558be test: Include tx data in EXTRA_DIST (MarcoFalke)
2016-12-28 12:58:20 +01:00
Pieter Wuille 2db4cbcc43
Merge #9349: Make CScript (and prevector) c++11 movable.
2ddfcfd Make CScript (and prevector) c++11 movable. (Pieter Wuille)
2016-12-27 11:04:14 -08:00
Pieter Wuille 7aa700424c
Merge #9243: Clean up mapArgs and mapMultiArgs Usage
c2f61be Add a ForceSetArg method for testing (Matt Corallo)
4e04814 Lock mapArgs/mapMultiArgs access in util (Matt Corallo)
4cd373a Un-expose mapArgs from utils.h (Matt Corallo)
71fde55 Get rid of mapArgs direct access in ZMQ construction (Matt Corallo)
0cf86a6 Introduce (and use) an IsArgSet accessor method (Matt Corallo)
2b5f085 Fix non-const mapMultiArgs[] access after init. (Matt Corallo)
c8042a4 Remove arguments to ParseConfigFile (Matt Corallo)
2016-12-27 10:17:11 -08:00
MarcoFalke fa558be2c1 test: Include tx data in EXTRA_DIST 2016-12-27 19:16:17 +01:00
MarcoFalke dbc8a8c86a
Merge #9435: Removed unused variable in test, fixing warning.
35356b4 Remove unused variable in test, fixing warning. (Russell Yanofsky)
2016-12-27 18:51:36 +01:00
Matt Corallo c2f61bebb1 Add a ForceSetArg method for testing 2016-12-27 13:52:07 +01:00
Russell Yanofsky 35356b40ef Remove unused variable in test, fixing warning.
Pointed out by Pavel Janík <Pavel@Janik.cz> in
https://github.com/bitcoin/bitcoin/pull/9308.
2016-12-27 07:35:39 -05:00
Suhas Daftuar bd02bddb93 Release cs_main before processing cmpctblock as header 2016-12-26 05:34:54 -05:00
Suhas Daftuar 680b0c0138 Release cs_main before calling ProcessNewBlock (cmpctblock handling) 2016-12-26 05:30:26 -05:00
Matt Corallo 4e048142a5 Lock mapArgs/mapMultiArgs access in util 2016-12-24 11:29:33 -05:00
Matt Corallo 4cd373aea8 Un-expose mapArgs from utils.h 2016-12-24 11:29:33 -05:00
Matt Corallo 71fde5563b Get rid of mapArgs direct access in ZMQ construction 2016-12-24 11:10:39 -05:00
Matt Corallo 0cf86a6678 Introduce (and use) an IsArgSet accessor method 2016-12-23 21:30:16 -05:00
Matt Corallo 2b5f085ad1 Fix non-const mapMultiArgs[] access after init.
Swap mapMultiArgs for a const-reference to a _mapMultiArgs which is
only accessed in util.cpp
2016-12-23 21:30:15 -05:00
Matt Corallo c8042a48f0 Remove arguments to ParseConfigFile 2016-12-23 21:30:15 -05:00
Pieter Wuille 407cdd6cb8 Do not evaluate hidden LogPrint arguments 2016-12-23 14:22:46 -08:00
Jonas Schnelli 54f80263fc
[CoinControl] Allow non-wallet owned change addresses 2016-12-23 16:07:37 +01:00
Jonas Schnelli 9479f8dfcf
Allow shutdown during LoadMempool, dump only when necessary 2016-12-23 14:19:38 +01:00
MarcoFalke 0f921e6a04
Merge #9406: Re-enable a blank v1 Tx JSON test
b371732 Re-enable a blank v1 Tx JSON test (Douglas Roark)
2016-12-23 12:07:16 +01:00
Pieter Wuille ba3cecf5c4 Share unused mempool memory with coincache
If the mempool is not completely full, treat the difference between
the maximum size and the actual usage as available for the coin cache.

This also changes the early flush trigger from (usage > 0.9 * space)
to (usage > 0.9 * space && usage > space - 100MB). This means we're not
permanently leaving 10% of the space unused when the space is large.
2016-12-22 15:04:05 -08:00