Commit graph

7348 commits

Author SHA1 Message Date
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
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
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
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
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
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
Patrick Strateman 9dfaa1cb70 Improve CWallet API with new AccountMove function. 2016-06-02 06:00:59 -07:00