Commit Graph

6270 Commits

Author SHA1 Message Date
Huang Le caf6150e97 Use async name resolving to improve net thread responsiveness
In the LookupIntern(), things changed are:

  1. Call getaddrinfo_a() instead of getaddrinfo() if available, the former is a sync version of the latter;
  2. Try using inet_pton()/inet_addr() to convert the input text to a network addr structure at first, if success the extra name resolving thread inside getaddrinfo_a() could be avoided;
  3.  An interruption point added in the waiting loop for return from getaddrinfo_a(), which completes the improve for thread responsiveness.

A easy way to see the effect is to kick off a 'bitcoind stop' immediately after 'bitcoind -daemon', before the change it would take several, or even tens of, minutes on a bad network situation to wait for the running bitcoind to exit, now it costs only seconds.

Signed-off-by: Huang Le <4tarhl@gmail.com>
2014-06-27 02:55:39 +08:00
Wladimir J. van der Laan 236ae8665e
Merge pull request #3715
e44fea5 Add an option to allow users to disable relaying/mining data carrier transactions (Luke Dashjr)
2014-06-26 17:31:12 +02:00
Wladimir J. van der Laan eacff4a9c6
Merge pull request #4392
8ae973c Allocate more space if necessary in RandSeedAddPerfMon (Wladimir J. van der Laan)
be873f6 Issue warning if collecting RandSeed data failed (Wladimir J. van der Laan)
fcb0a1b change "char pch[200000]" to "new char[200000]" (daniel)
2014-06-26 17:11:53 +02:00
Drak e5f0247bb6 Simplify build instructions 2014-06-26 15:51:07 +01:00
Luke Dashjr e44fea55ea Add an option to allow users to disable relaying/mining data carrier transactions 2014-06-26 14:31:06 +00:00
Wladimir J. van der Laan ffb32acfab
Merge pull request #1583
2a72d45 JSON-RPC method: prioritisetransaction <txid> <priority delta> <priority tx fee> (Luke Dashjr)
2014-06-26 16:20:01 +02:00
Wladimir J. van der Laan f40d193c18
Merge pull request #4414
a90689f Remove timing-based signature cache unit test (Gavin Andresen)
2014-06-26 15:18:23 +02:00
Wladimir J. van der Laan 8ae973c00c Allocate more space if necessary in RandSeedAddPerfMon
Currently we use a fixed buffer of 250000 bytes to request
HKEY_PERFORMANCE_DATA. In many cases this is not enough, causing the
entropy collection to be skipped.

Use a loop that grows the buffer as specified in the RegQueryValueEx
documentation:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724911%28v=vs.85%29.aspx

(as the size of the performance data can differ for every call, the
normal solution of requesting the size then allocating that can't work)
2014-06-26 15:15:17 +02:00
Luke Dashjr 2a72d4591f JSON-RPC method: prioritisetransaction <txid> <priority delta> <priority tx fee>
Accepts the transaction into mined blocks at a higher (or lower) priority
2014-06-26 11:49:46 +00:00
Philip Kaufmann 86fe1b864b update coding.md to reflect changes by pull
- also mention alphabetical include ordering
2014-06-26 11:56:56 +02:00
Philip Kaufmann cf04d83624 add OpenSSL RAND_cleanup() on OpenSSL shutdown
- to securely erase the memory used by the PNRG
- also rework 2 comments in OpenSSL init
2014-06-26 11:04:31 +02:00
Philip Kaufmann 5d59921237 add missing BOOST_FOREACH indentation in ThreadSocketHandler() 2014-06-26 11:01:24 +02:00
Philip Kaufmann 9e9ca2b671 small cleanup of #ifdefs in BindListenPort()
- SO_NOSIGPIPE isn't available on WIN32 so merge the 2 non-WIN32 blocks
- use predefined names from header for IPV6_PROTECTION_LEVEL and
  PROTECTION_LEVEL_UNRESTRICTED
2014-06-26 11:01:23 +02:00
Philip Kaufmann e10dcf27b4 ensure clean and consistent "namespace" usage
- remove some missplaced ;
- ensure end of a namespace is clearly visible
- use same formatting when using namespace
2014-06-26 10:36:57 +02:00
Gavin Andresen a90689ff98
Remove timing-based signature cache unit test
Two changes:

First removes a unit test that fails in my development environment
(OSX, compiled -g3 with clang).

sipa says that's not terribly surprising; the CMutableTransaction change
makes signing a little more expensive but verification quicker. The unit
test timed sign+verify-uncached versus verify-cached-five-times.

He also says the test will be invalid when libsec256kp1 is integrated
(because validation is super-optimized over signing).

core.h change fixes a compiler warning (clang -Wall : CMutableTransaction defined
as struct, declared as class in script.h).
2014-06-25 14:57:21 -04:00
gubatron 8969828d06 [Qt] New status bar Unit Display Control and related changes.
- New status bar control shows the current Unit of Display.
  When clicked (left,or right button) it shows a context menu
  that allows the user to switch the current Unit of Display (BTC, mBTC, uBTC)
- Recent Requests and Transaction Table headers are now updated when
  unit of display is changed, because their "Amount" column now displays the
  current unit of display.
- Takes care of issue #3970 Units in transaction export csv file.
- Small refactors for reusability.
- Demo Video https://www.youtube.com/watch?v=wwcr0Yh68go&list=UUG3jF2hgofmLWP0tRPisQAQ
- changes after Diapolo's feedback. Have not been able to build after last pool, issues with boost on MacOSX, will test on Ubuntu these changes.
- removed return statement on switch
- renamed onDisplayUnitsChanged(int) to updateDisplayUnit(int)
- now getAmountColumnTitle(int unit) takes a simple unit parameter. moved to BitcoinUnits.
2014-06-25 14:53:05 -04:00
Wladimir J. van der Laan 343feecf56
Merge pull request #4368
75c82d4 Move coins.cpp and keystore.cpp to libbitcoin_common (Wladimir J. van der Laan)
84ce18c Remove unnecessary dependencies for bitcoin-cli (Wladimir J. van der Laan)
14f888c Move network-time related functions to timedata.cpp/h (Wladimir J. van der Laan)
2014-06-25 17:00:09 +02:00
Wladimir J. van der Laan 75c82d4923 Move coins.cpp and keystore.cpp to libbitcoin_common
Prepare for introduction of `bitcoin-tx` tool.
2014-06-25 10:31:35 +02:00
Wladimir J. van der Laan 84ce18ca93 Remove unnecessary dependencies for bitcoin-cli
This commit removes all the unnecessary dependencies (key, core,
netbase, sync, ...) from bitcoin-cli.

To do this it shards the chain parameters into BaseParams, which
contains just the RPC port and data directory (as used by utils and
bitcoin-cli) and Params, with the rest.
2014-06-25 10:31:35 +02:00
Wladimir J. van der Laan 14f888ca80 Move network-time related functions to timedata.cpp/h
The network time-offset-mangement functions from util.cpp are moved to
timedata.(cpp|h). This breaks the dependency of util on netbase.
2014-06-25 09:24:50 +02:00
Wladimir J. van der Laan 208bf5b9e0
Merge pull request #3839
fd704c7 move pow constants to chainparams (jtimon)
df852d2 Refactor proof of work related functions out of main (jtimon)
2014-06-25 09:14:36 +02:00
Wladimir J. van der Laan 27383b9015
Merge pull request #4390
6dc90ed replace 3 separate calls to WSAGetLastError() with 1 (Philip Kaufmann)
2014-06-25 07:20:42 +02:00
Wladimir J. van der Laan e6cb20e19a
Merge pull request #4404
e9f2460 Add dependencies for Mac OSX gitian builds (Drak)
2014-06-25 07:13:28 +02:00
Wladimir J. van der Laan ea37a208de
Merge pull request #4406
b79f59b Update .gitignore (Drak)
2014-06-25 07:07:27 +02:00
Wladimir J. van der Laan fcbb1a74db
Merge pull request #4408
e3aedba Consistent lettering (Whit J)
2014-06-25 07:07:04 +02:00
Drak b79f59b995 Update .gitignore
Removing old file ignores so they show up in `git status`
2014-06-25 06:00:22 +01:00
Whit J e3aedbae9b Consistent lettering 2014-06-24 17:23:05 -07:00
Drak e9f2460c58 Add dependencies for Mac OSX gitian builds 2014-06-24 18:06:52 +01:00
Wladimir J. van der Laan 6e8472ec7c
Merge pull request #4403
5fbb4c9 [Qt] fix links in about window not opening (Philip Kaufmann)
2014-06-24 18:07:45 +02:00
Wladimir J. van der Laan 0410d11b3a
Merge pull request #4130
1c750db remove -tor compatibility code (only allow -onion) (Philip Kaufmann)
2014-06-24 17:51:32 +02:00
Wladimir J. van der Laan 5dd0bfefcb
Merge pull request #4169
0655fac miner: indentation fixes, remove for (;;) (Philip Kaufmann)
2014-06-24 17:17:13 +02:00
Wladimir J. van der Laan d4392c8989
Merge pull request #3674
77cbd46 Let -zapwallettxes recover transaction meta data (Cozz Lovan)
2014-06-24 17:04:52 +02:00
Philip Kaufmann 5fbb4c9b58 [Qt] fix links in about window not opening
- closes #4402
2014-06-24 16:36:14 +02:00
Philip Kaufmann 1c750dbd40 remove -tor compatibility code (only allow -onion)
- exit, if -tor option is found and give error to user
2014-06-24 16:07:20 +02:00
Philip Kaufmann 6dc90ed8fa replace 3 separate calls to WSAGetLastError() with 1 2014-06-24 08:46:12 +02:00
jtimon fd704c7b2c move pow constants to chainparams 2014-06-23 23:10:24 +02:00
jtimon df852d2bcc Refactor proof of work related functions out of main 2014-06-23 23:10:24 +02:00
Gavin Andresen 7f3b4e9569
Relax IsStandard rules for pay-to-script-hash transactions
Relax the AreInputsStandard() tests for P2SH transactions --
allow any Script in a P2SH transaction to be relayed/mined,
as long as it has 15 or fewer signature operations.

Rationale: https://gist.github.com/gavinandresen/88be40c141bc67acb247

I don't have an easy way to test this, but the code changes are
straightforward and I've updated the AreInputsStandard unit tests.
2014-06-23 15:09:52 -04:00
Wladimir J. van der Laan 36db6633c3
Merge pull request #4395
f3967bc build: fix build weirdness after 54372482. (Cory Fields)
2014-06-23 20:26:12 +02:00
Cory Fields f3967bcc50 build: fix build weirdness after 54372482.
bitcoin-config.h moved, but the old file is likely to still exist when
reconfiguring or switching branches. This would've caused files to not rebuild
correctly, and other strange problems.

Make the path explicit so that the old one cannot be found.

Core libs use config/bitcoin-config.h.

Libs (like crypto) which don't want access to bitcoin's headers continue
to use -Iconfig and #include bitcoin-config.h.
2014-06-23 14:04:38 -04:00
Gavin Andresen 6d875669aa Merge pull request #4394 from laanwj/2014_06_rpc_tests_connectnode
qa/rpc_tests: Wait for handshake to complete in connect_nodes
2014-06-23 11:54:27 -04:00
Wladimir J. van der Laan 3b1295e988
qa/rpc_tests: Wait for handshake to complete in connect_nodes
This avoids a race condition in which the connection was
made but the version handshake is not completed yet. In that
case transactions won't be broadcasted to a peer yet, and
the nodes will wait forever for their mempools to sync.
2014-06-23 17:43:55 +02:00
Wladimir J. van der Laan 0869df195c
Merge pull request #3960
3f9a019 added list/get received by address/ account tests (Alon Muroch)
2014-06-23 17:37:40 +02:00
Wladimir J. van der Laan be873f6454
Issue warning if collecting RandSeed data failed 2014-06-23 16:29:51 +02:00
Philip Kaufmann 6a5c124b84 [Qt] don't allow translation of our example btc address 2014-06-23 15:11:28 +02:00
Wladimir J. van der Laan a652787737
Merge pull request #4314
b3c912d [Qt] Change Coin control labels and tooltips because of non-rounding fees (Cozz Lovan)
2014-06-23 12:07:50 +02:00
Wladimir J. van der Laan 17db9767c4
doc: Remove unused section from release-process.md
It is outdated information. If we ever resurrect gitian-downloader it
can be brought back from history and updated.
2014-06-23 12:04:33 +02:00
daniel fcb0a1bb9c change "char pch[200000]" to "new char[200000]" 2014-06-23 11:59:58 +02:00
Wladimir J. van der Laan 5459116d61
Merge pull request #4293
fa126ef Avoid undefined behavior using CFlatData in CScript serialization (Wladimir J. van der Laan)
2014-06-23 10:44:57 +02:00
Wladimir J. van der Laan fa126effc2
Avoid undefined behavior using CFlatData in CScript serialization
`&vch[vch.size()]` and even `&vch[0]` on vectors can cause assertion
errors with VC in debug mode. This is the problem mentioned in #4239.
The deeper problem with this is that we rely on undefined behavior.

- Add `begin_ptr` and `end_ptr` functions that get the beginning and end
  pointer of vector in a reliable way that copes with empty vectors and
  doesn't reference outside the vector
(see https://stackoverflow.com/questions/1339470/how-to-get-the-address-of-the-stdvector-buffer-start-most-elegantly/1339767#1339767).
- Add a convenience constructor to CFlatData that wraps a vector.

I added `begin_ptr` and `end_ptr` as separate functions as I imagine
they will be useful in more places.
2014-06-23 10:38:15 +02:00