Commit graph

7131 commits

Author SHA1 Message Date
Wladimir J. van der Laan 9eaa0afa6e tinyformat: force USE_VARIADIC_TEMPLATES
Now that we started using c++11, force use of variadic templates.

The autodetection may be wonky on some compilers, see discussion
[here](https://github.com/bitcoin/bitcoin/pull/7982#issuecomment-216222357)
and is unnecessary for us anyhow.
2016-05-04 11:37:10 +02:00
Wladimir J. van der Laan 559fbae8c6
Merge #7982: build: No need to check for leveldb atomics
de98290 build: No need to check for leveldb atomics (Cory Fields)
2016-05-04 11:34:42 +02:00
Puru 9a8a7d0115 bitcoin-cli.cpp: Use symbolic constant for exit code 2016-05-02 22:33:04 +05:45
Wladimir J. van der Laan 03cf6e8675
Merge #7959: fix race that could fail to persist a ban
f4ac02e fix race that could fail to persist a ban (Kaz Wesley)
2016-05-02 14:48:50 +02:00
Wladimir J. van der Laan 86b800c6a2
Merge #7964: Minor changes for c++11 consistency
07e4edb auto_ptr → unique_ptr (Wladimir J. van der Laan)
073225c chain: define enum used as bit field as uint32_t (Wladimir J. van der Laan)
2016-05-02 13:08:02 +02:00
Cory Fields de98290155 build: No need to check for leveldb atomics
They're guaranteed with c++11
2016-04-30 17:46:35 -04:00
MarcoFalke 0ad1041904
Merge #7807: Fixed miner test values, gave constants for less error-prone values.
f8536a6 Corrected values (instagibbs)
617deeb Gave miner test values constants for less error-prone values. (instagibbs)
2016-04-29 22:02:59 +02:00
Wladimir J. van der Laan 20f9ecd343
Merge #7962: CalculateNextWorkRequired Cleanup
c7aac2d Deprecating the remaining LogPrintf dependencies that were made obsolete in PR #7459. (21E14)
2016-04-28 15:33:28 +02:00
Wladimir J. van der Laan 5725807402
Merge #7926: [RPC] push back getaddednodeinfo dead value
9c0bcb6 push back getaddednodeinfo dead value (instagibbs)
2016-04-28 14:35:40 +02:00
Wladimir J. van der Laan a9c8b744e8
Merge #7952: Log invalid block hash to make debugging easier.
61c0170 Log invalid block hash to make debugging easier. (Pavel Janík)
2016-04-28 13:53:01 +02:00
Wladimir J. van der Laan 07e4edb056 auto_ptr → unique_ptr
Change the few occurrences of the deprecated `auto_ptr` to c++11 `unique_ptr`.
Silences the deprecation warnings.

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

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

Reorder operations so that the data to be persisted cannot be older than the
time at which the banmap was marked non-dirty.
2016-04-27 09:41:13 -07:00
Pavel Janík 61c01706cd Log invalid block hash to make debugging easier. 2016-04-26 22:22:59 +02:00
Wladimir J. van der Laan f135e3c943 qt: Add transaction hash to details window title 2016-04-26 16:05:10 +02:00
Wladimir J. van der Laan e26b62093a
Merge #7933: Fix OOM when deserializing UTXO entries with invalid length
1e44169 Add tests for CCoins deserialization (Pieter Wuille)
5d0434d Fix OOM bug: UTXO entries with invalid script length (Pieter Wuille)
4bf631e CDataStream::ignore Throw exception instead of assert on negative nSize. (Patrick Strateman)
4f87af6 Treat overly long scriptPubKeys as unspendable (Pieter Wuille)
f8e6fb1 Introduce constant for maximum CScript length (Pieter Wuille)
2016-04-26 13:23:05 +02:00
Chris Stewart 62a9abd12b Fixing comment in script_test.json test case 2016-04-25 11:08:10 -05:00
Wladimir J. van der Laan 17a6a21786 qt: Make it possible to show details for multiple transactions
A small GUI annoyance for me has always been that it's impossible to
have multiple transaction detail windows open, for example to compare
transactions.

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

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

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

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

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

This turned out to be caused by a mismatch in the arguments to moc,
preventing it from finding `bitcoin-config.h`. Fix this by passing
`$(DEFAULT_INCLUDES)` to it, which gets set to the appropriate
path by autoconf itself.
2016-04-22 09:21:09 +02:00
Wladimir J. van der Laan 351abf9e03
Merge #7911: leveldb: integrate leveldb into our buildsystem
a4625ac leveldb: integrate leveldb into our buildsystem (Cory Fields)
2016-04-22 09:16:17 +02:00
Wladimir J. van der Laan 90653bc91d
Merge #7922: CBase58Data::SetString: cleanse the full vector
5770449 CBase58Data::SetString: cleanse the full vector (Kaz Wesley)
2016-04-22 09:04:16 +02:00
Wladimir J. van der Laan 76176823ba
Merge #7919: Fix headers announcements edge case
3a99fb2 Fix headers announcements edge case (Suhas Daftuar)
2016-04-22 08:40:22 +02:00
Wladimir J. van der Laan 0c95ebce7e
Merge #7816: [Wallet] slighly refactor GetOldestKeyPoolTime()
9f7336b [Wallet] slightly refactor GetOldestKeyPoolTime() (Jonas Schnelli)
2016-04-22 08:36:56 +02:00
Kaz Wesley 57704499be CBase58Data::SetString: cleanse the full vector
SetString seems to be passing the length of the wrong variable to
memory_cleanse, resulting in the last byte of the temporary buffer not being
securely erased.
2016-04-21 18:28:57 -07:00
Wladimir J. van der Laan 3689ac4634
Merge #7916: Explicitly pass CChainParams& to DisconnectTip()
176869f Explicitly pass CChainParams to ConnectBlock (face)
d0a6353 Pass CChainParams to DisconnectTip() (face)
764d237 Globals: Explicitly pass const CChainParams& to UpdateTip() (Jorge Timón)
2016-04-21 14:54:31 +02:00
Pieter Wuille bafd075c5e
Merge #7913: Fix for incorrect locking in GetPubKey() (keystore.cpp)
220f950 Fix for incorrect locking in GetPubKey() (keystore.cpp) (Yuri Zhykin)
2016-04-21 13:57:07 +02:00
Pieter Wuille 7daa3adb24
Merge #7868: net: Split DNS resolving functionality out of net structures
d39f5b4 net: disable resolving from storage structures (Cory Fields)
3675699 net: resolve outside of storage structures (Cory Fields)
a98cd1f net: manually resolve dns seed sources (Cory Fields)
e9fc71e net: require lookup functions to specify all arguments (Cory Fields)
2016-04-21 13:48:13 +02:00
Suhas Daftuar 3a99fb2cb1 Fix headers announcements edge case
Previously we would assert that if every block in vBlockHashesToAnnounce is in
chainActive, then the blocks to be announced must connect.  However, there are
edge cases where this assumption could be violated (eg using invalidateblock /
reconsiderblock), so just check for this case and revert to inv-announcement
instead.
2016-04-20 14:19:03 -04:00
Cory Fields d39f5b425d net: disable resolving from storage structures
CNetAddr/CService/CSubnet can no longer resolve DNS.
2016-04-20 13:08:19 -04:00
Cory Fields 367569926a net: resolve outside of storage structures
Rather than allowing CNetAddr/CService/CSubNet to launch DNS queries, require
that addresses are already resolved.

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

This commit shouldn't change that behavior, for better or worse.
2016-04-20 13:07:19 -04:00
face 176869f9b3 Explicitly pass CChainParams to ConnectBlock 2016-04-20 17:05:15 +03:00
Yuri Zhykin 220f950ab1 Fix for incorrect locking in GetPubKey() (keystore.cpp) 2016-04-20 16:04:28 +03:00
Cory Fields a4625acbf8 leveldb: integrate leveldb into our buildsystem
leveldb's buildsystem causes us a few problems:
- breaks out-of-tree builds
- forces flags used for some tools
- limits cross builds

Rather than continuing to add wrappers around it, simply integrate it into our
build.
2016-04-19 14:37:15 -04:00
face d0a6353dec Pass CChainParams to DisconnectTip() 2016-04-19 20:33:04 +03:00