Commit graph

5971 commits

Author SHA1 Message Date
Wladimir J. van der Laan c7d61f3d4b rpc: Ignore and log errors during cancel
Cancelling the RPC acceptors can sometimes result in an error about
a bad file descriptor.

As this is the shutdown sequence we need to continue nevertheless,
ignore these errors, log a warning and proceed.

Fixes #4352.
2014-07-09 17:34:20 +02:00
Wladimir J. van der Laan 91b241f633 gitian: make linux qt intermediate deterministic
Make the instdate for lrelease etc deterministic. This should have been
part of 0.9.2. Luckily this doesn't affect the end product, it is just
a bit annoying.

Rebased-From: 386e732
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
2014-07-09 17:31:37 +02:00
Wladimir J. van der Laan aca6b9dade fix download link and release in release notes 2014-07-09 17:31:03 +02:00
Wladimir J. van der Laan 8a28cc0dce add 0.9.2rc2 changes to release notes 2014-07-09 17:30:40 +02:00
Jeff Garzik 84196ee050 CWallet: fix nTimeFirstKey init, by making constructor init common code
Don't repeat yourself etc.

Rebased-From: d04fd3e
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
2014-07-09 17:30:21 +02:00
Wladimir J. van der Laan 8465a714f8 gitian: upgrade OpenSSL to 1.0.1h 2014-07-09 17:29:59 +02:00
tm314159 ef247ba774 Properly initialize CWallet::nTimeFirstKey
Rebased-From: 91855f2
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
2014-07-09 17:20:24 +02:00
Huang Le 351b463462 Use pnode->nLastRecv as sync score directly
NodeSyncScore() should find the node which we recv data most recently, so put a negative sign to pnode->nLastRecv is indeed wrong.

Also change the return value type to int64_t.

Signed-off-by: Huang Le <4tarhl@gmail.com>
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 09a54a6
2014-07-09 17:20:12 +02:00
Pieter Wuille a74d770e02 Limit number of known addresses per peer
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 5823449
2014-07-09 17:19:32 +02:00
Cory Fields 327f6e612b osx: Fix missing dock menu with qt5
Qt5 Removed the qt_mac_set_dock_menu function and left no replacement. It was
later re-added and deprecated for backwards-compatibility.

Qt5.2 adds the non-deprecated QMenu::setAsDockMenu(). Use that when possible.

Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: c21c74b
2014-07-09 17:19:16 +02:00
Pieter Wuille f5f3212aad No references to centralized databases in help text.
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: b5ef85c
2014-07-09 17:18:40 +02:00
Cozz Lovan b953b13b62 [Qt] Fix Start bitcoin on system login
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 066d9a5
2014-07-09 17:17:40 +02:00
Wladimir J. van der Laan 525871bd66 Add preliminary release notes for 0.9.2 2014-07-09 17:17:18 +02:00
Gavin Andresen b983fff4a1 Add Tips and Tricks section to README 2014-07-09 17:15:04 +02:00
Wladimir J. van der Laan ab25bec2ea Replace non-threadsafe gmtime and setlocale
Make DateTimeStrFormat use boost::posix_time.

Also re-enable the util_DateTimeStrFormat tests, as they are no
longer platform specific.

Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 3e8ac6a
2014-07-09 17:12:18 +02:00
Wladimir J. van der Laan bc678a3ec8 Replace non-threadsafe strerror
Log the name of the error as well as the error code if a network problem
happens. This makes network troubleshooting more convenient.

Use thread-safe strerror_r and the WIN32 equivalent FormatMessage.

Conflicts:
 src/netbase.cpp
2014-07-09 17:11:55 +02:00
Pieter Wuille e52d5c58a0 Add missing LOCK(cs_main)
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 305ccaa
2014-07-09 17:09:02 +02:00
Kamil Domanski 74b9211caf remove ParseString(...) which is never used
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: be54b87
2014-07-09 17:02:23 +02:00
Kamil Domanski 2f69f6c80d switch from boost int types to <stdint.h>
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 4b61a6a, 3e74ac2, d56e30c
Github-Pull: #4129
2014-07-09 17:02:13 +02:00
Stuart Cardall 7c8d9db4e4 SetupEnvironment() - clean commit 2014-07-09 17:01:36 +02:00
Pieter Wuille 20111387a7 Move base58.h implementation code to base58.cpp
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: f6b7c64
2014-07-09 16:36:24 +02:00
Ross Nicoll 937f65e9d1 Merge pull request #564 from langerhans/btc-0.9.2-batch-5
BTC 0.9.2 batch 5
2014-06-30 18:58:00 +01:00
Peter Todd d3fd2ce6b0 Fix script test handling of empty scripts
Previously an empty script would evaluate to OP_0
2014-06-29 16:15:37 +02:00
Wladimir J. van der Laan d3a1449294 rpc: keep track of acceptors, and cancel them in StopRPCThreads
Fixes #4156.

The problem is that the boost::asio::io_service destructor
waits for the acceptors to finish (on windows, and boost 1.55).

Fix this by keeping track of the acceptors and cancelling them before
stopping the event loops.
2014-06-29 16:05:47 +02:00
Philip Kaufmann ea4d67f3dc replace custom GetFilesize() with boost::filesystem::file_size() 2014-06-29 16:00:10 +02:00
Wladimir J. van der Laan 7e3dbfd248 rpc: keep track of acceptors 2014-06-29 15:38:48 +02:00
Wladimir J. van der Laan be18e2304e doc change, rpctimeout removed 2014-06-29 15:38:47 +02:00
Wladimir J. van der Laan 5d60b1829b rpc: Make sure conn object is always cleaned up
Make sure conn object always gets cleaned up by using a
`boost::shared_ptr`.

This makes valgrind happy - before this commit, one connection object
always leaked at shutdown, as well as can avoid other leaks, when
for example an exception happens.

Also add an explicit Close() to the !ClientAllowed path to make it similar
to the normal path (I'm not sure whether it is needed, but it
can't hurt).
2014-06-29 15:38:47 +02:00
Wladimir J. van der Laan 623ed78353 rpc: pass errors from async_accept
According to the [boost::asio documentation](http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/reference/basic_socket_acceptor/async_accept/overload2.html),
the function signature of the handler must be:

    void handler(
      const boost::system::error_code& error // Result of operation.
    );

We were binding *all* the arguments, instead of all but the error,
resulting in nullary function that never got the error. Fix this
by adding an input argument substitution.
2014-06-29 15:38:46 +02:00
shshshsh 876a2fb5b1 Switch stdout to line buffering
Use line buffering (instead of block buffering) so that messages arrive
immediately in systemd-journald, tail -f debug.log, and the like.

Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 283e405
2014-06-29 15:38:46 +02:00
Matthew Bogosian 79b0f61dd7 typo 2014-06-29 15:38:46 +02:00
Pieter Wuille 28c3a2080a Squashed 'src/leveldb/' changes from 9094c7f..7924331
42dcc7e Merge upstream LevelDB 1.17.
e353fbc Release LevelDB 1.17
269fc6c Release LevelDB 1.16
REVERT: 9094c7f Temporarily revert to writing .sst files instead of .ldb

git-subtree-dir: src/leveldb
git-subtree-split: 79243314e40ac31d79c68e5658a1d6a64800d50b
2014-06-29 15:38:45 +02:00
Wladimir J. van der Laan 82820e56be Add tests for BoostAsioToCNetAddr 2014-06-29 15:38:45 +02:00
Wladimir J. van der Laan 2d76e1f9df Remove unused function WildcardMatch
No longer necessary after implementing netmask-based matching.
Also remove a longer-unused function `skipspaces`.
2014-06-29 15:38:44 +02:00
Wladimir J. van der Laan dc43355203 rpc: Use netmasks instead of wildcards for IP address matching
`-rpcallowip` currently has a wacky wildcard-based format. After this
commit it will accept the more standard format, for example:

- Ranges with netmask 127.0.0.0/255.255.255.0, ::/0
- Ranges with cidr 12.3.4.5/24, 12:34:56:78:9a:bc:de:00/112
- Loose IPs ::1, 127.0.0.1

Trying to use the old *?-based format will result in an error message at
launch.
2014-06-29 15:38:44 +02:00
Wladimir J. van der Laan 407a7605dc net: Add CSubNet class for subnet matching 2014-06-29 15:38:44 +02:00
Wladimir J. van der Laan c1280fd3c2 Use new function parseint32 in SplitHostPort
Use the new function parseint32 in SplitHostPort instead of calling
strtol directly.
2014-06-29 15:38:43 +02:00
Wladimir J. van der Laan 6f4a1156dd util: add parseint32 function with strict error reporting
None of the current integer parsing functions in util
check whether the result is valid and fits in the range
of the type. This is required for less sloppy error reporting.
2014-06-29 15:38:43 +02:00
Pieter Wuille b108e2aae2 Add multiplication and division to uint160/uint256 2014-06-29 15:38:42 +02:00
Pieter Wuille eee99edaca Exception instead of assigning 0 in case of wrong vector length 2014-06-29 15:38:42 +02:00
Pieter Wuille 37d542abf5 Deduplicate shared code between uint160 and uint256 2014-06-29 15:38:42 +02:00
Wladimir J. van der Laan f5bfbdb649 Fix transaction tests
Conflict between low-s (6fd7ef2) and test updates in d3a33fc.
2014-06-29 15:38:41 +02:00
Pieter Wuille 4644e65561 Also switch the (unused) verification code to low-s instead of even-s.
a81cd968 introduced a malleability breaker for signatures
(using an even value for S). In e0e14e43 this was changed to
the lower of two potential values, rather than the even one.
Only the signing code was changed though, the (for now unused)
verification code wasn't adapted.
2014-06-29 15:38:41 +02:00
Peter Todd 50e3d3f3e1 Test CHECKMULTISIG with m == 0 and n == 0 2014-06-29 15:38:40 +02:00
harry 50a0dccaf0 build: fix: remove error output
while git not found in path, error is output to console.
2014-06-29 15:38:40 +02:00
Wladimir J. van der Laan 40ae77d46d qt: fix compile issue in Qt GUI
This was introduced in 3e1cf9b. Needs a cast to qint64.
2014-06-29 15:38:40 +02:00
David A. Harding 6944ca0e9a typos 2014-06-29 15:38:39 +02:00
Peter Todd edb4388c45 Check redeemScript size does not exceed 520 byte limit
redeemScripts >520bytes can't be spent due to the
MAX_SCRIPT_ELEMENT_SIZE limit; previously the addmultisigaddress and
createmultisig RPC calls would let you violate that limit unknowingly.

Also made the wallet code itself check the redeemScript prior to adding
it to the wallet, which in the (rare) instance that a user has added an
invalid oversized redeemScript to their wallet causes an error on
startup. The affected key isn't added to the wallet; other keys are
unaffected.
2014-06-29 15:38:39 +02:00
Peter Todd 688b776c45 Increase IsStandard() scriptSig length
Removes the limits on number of pubkeys for P2SH CHECKMULTISIG outputs.
Previously with the 500 byte scriptSig limit there were odd restrictions
where even a 1-of-12 P2SH could be spent in a standard transaction(1),
yet multisig scriptPubKey's requiring more signatures quickly ran out of
scriptSig space.

From a "stuff-data-in-the-blockchain" point of view not much has changed
as with the prior commit now only allowing the dummy value to be null
the newly allowed scriptSig space can only be used for signatures. In
any case, just using more outputs is trivial and doesn't cost much.

1) See 779b519480d8c5346de6e635119c7ee772e97ec872240c45e558f582a37b4b73
   Mined by BTC Guild.
2014-06-29 15:38:38 +02:00
Peter Todd b6faba6035 Do not trigger a DoS ban if SCRIPT_VERIFY_NULLDUMMY fails 2014-06-29 15:38:38 +02:00