WIP: Updated rebase 0.17 deps #259

Closed
lbrynaut wants to merge 34 commits from updated-rebase-0.17-deps into bitcoin-0.17

34 commits

Author SHA1 Message Date
lbrynaut
ef13e7e52e Update wallet/tx code for LBRY addresses. 2019-03-27 09:18:45 -05:00
lbrynaut
573ae8fd2d Replace usage of BOOST_CHECK with BOOST_CHECK_EQUAL for consistency
and better error reporting.
2019-03-27 09:18:45 -05:00
lbrynaut
49c82c9dd0 Continue rebasing LBRY on to bitcoin upstream.
Upgrade Windows build to 64 bit for proper C++11 support.
Set required mingw profile in Windows build env.
Remove dead OpenSSL usage.
Update reproducible build.
Rename lbrycrd binaries.
Add man pages.
Update all build dependencies in reproducible_build and eliminate
usage of lbrycrd_dependencies repo.
Update ICU dependency version in Windows build.
Additional branding/renaming updates.

Temporarily remove code formatting, since it can't work sanely for
this kind of merge.
Temporarily add clean for linux/osx.
2019-03-27 09:18:45 -05:00
Brannon King
018458edbe fix overflow in amount_tests 2019-03-27 09:18:45 -05:00
Anthony Fieroni
60f98b3300 Fix transaction tests by removing not invalid tx
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2019-03-27 09:18:45 -05:00
Anthony Fieroni
2069a84704 Fix denial of service tests
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2019-03-27 09:18:45 -05:00
Anthony Fieroni
30e18de527 Fix script and validation block tests
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2019-03-27 09:18:45 -05:00
Anthony Fieroni
3e1d2f95a0 Fix wallet tests
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2019-03-27 09:18:45 -05:00
Anthony Fieroni
6a259cd39e Fix locking logic, miner tests pass
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2019-03-27 09:18:45 -05:00
Anthony Fieroni
462892464e Fix tx validation
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2019-03-27 09:18:45 -05:00
Anthony Fieroni
550929c10d Claim trie, miner, coins tests fix
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2019-03-27 09:18:45 -05:00
Anthony Fieroni
9638c936f8 Port tests, still has failing
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2019-03-27 09:18:44 -05:00
Anthony Fieroni
1f2f9c651b Add base58_keys_valid, Checkpoints tests, fix blockchain test
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2019-03-27 09:18:44 -05:00
Brannon King
bf1b4f03ec fixed nameclaim link 2019-03-27 09:18:44 -05:00
Brannon King
11c5398c71 brought in the claimtrie tests, made it all compile
yanked the ICU stuff as it will come with the normalization branch
2019-03-27 09:18:44 -05:00
lbrynaut
68a8864847 Rebase lbry on to upstream (WIP) 2019-03-27 09:18:44 -05:00
Wladimir J. van der Laan
6cf81b01b4
Merge #15575: 0.17: Backport 15297
fe95f84542 qa: Test .walletlock file is closed (João Barbosa)
2e9e904a5d wallet: Close wallet env lock file (João Barbosa)
22cdb6cf59 wallet: Close dbenv error file db.log (João Barbosa)
f20513bd71 Tests: add unit tests for GetWalletEnv (Pierre Rochard)
85c6263ddb Trivial: add doxygen-compatible comments relating to BerkeleyEnvironment (Pierre Rochard)
f22d02f537 Free BerkeleyEnvironment instances when not in use (Russell Yanofsky)
0a9af2d4cb wallet: Create IsDatabaseLoaded function (Chun Kuan Lee)
7751ea37b6 Refactor: Move m_db pointers into BerkeleyDatabase (Russell Yanofsky)
caf1146b13 wallet: Add trailing wallet.dat when detecting duplicate wallet if it's a directory. (Chun Kuan Lee)
34da2b7c76 tests: add test case for loading copied wallet twice (Chun Kuan Lee)
8965b6ab47 wallet: Fix duplicate fileid (Chun Kuan Lee)
16e5759455 wallet: Refactor to use WalletLocation (João Barbosa)
21693ff0b7 wallet: Add WalletLocation utility class (João Barbosa)
1c98a758d0 No longer shutdown after encrypting the wallet (Andrew Chow)
435df68c62 Move BerkeleyEnvironment deletion from internal method to callsite (Andrew Chow)
048fda2a66 After encrypting the wallet, reload the database environment (Andrew Chow)
f455979eb1 Add function to close all Db's and reload the databae environment (Andrew Chow)

Pull request description:

  This PR backports the following pull requests:
   - #12493 [wallet] Reopen CDBEnv after encryption instead of shutting down
   - #14350 Add WalletLocation class
   - #14320 [bugfix] wallet: Fix duplicate fileid detection
   - #14552 wallet: detecting duplicate wallet by comparing the db filename.
   - #11911 Free BerkeleyEnvironment instances when not in use
   - #15297 wallet: Releases dangling files on BerkeleyEnvironment::Close

Tree-SHA512: 52d759bc4f140ca96e39b37746cc20e786741b08ddc658a87ea77fbcfbb481f1c7b75aba4fc57ca9bca8ca7154e535da1fdd650fd114873655cd85c490c79f14
2019-03-20 20:38:55 +01:00
João Barbosa
fe95f84542 qa: Test .walletlock file is closed
Github-Pull: #15297
Rebased-From: d3bf3b9
2019-03-12 23:24:11 +00:00
João Barbosa
2e9e904a5d wallet: Close wallet env lock file
Close .walletlock file when a BerkeleyEnvironment is deleted.

Github-Pull: #15297
Rebased-From: 2f8b8f4
2019-03-12 23:24:11 +00:00
João Barbosa
22cdb6cf59 wallet: Close dbenv error file db.log
The error file db.log is opened by BerkeleyEnvironment instance and
should be closed after dbenv is closed.

Github-Pull: #15297
Rebased-From: 8602a1e
2019-03-12 23:24:11 +00:00
Pierre Rochard
f20513bd71 Tests: add unit tests for GetWalletEnv
Github-Pull: #11911
Rebased-From: 88b1d95
2019-03-12 23:25:49 +00:00
Pierre Rochard
85c6263ddb Trivial: add doxygen-compatible comments relating to BerkeleyEnvironment
Github-Pull: #11911
Rebased-From: 14bc2a1
2019-03-12 23:25:36 +00:00
Russell Yanofsky
f22d02f537 Free BerkeleyEnvironment instances when not in use
Instead of adding BerkeleyEnvironment objects permanently to the g_dbenvs map,
use reference counted shared pointers and remove map entries when the last
BerkeleyEnvironment reference goes out of scope.

This change was requested by Matt Corallo <git@bluematt.me> and makes code that
sets up mock databases cleaner. The mock database environment will now go out
of scope and be reset on destruction so there is no need to call
BerkeleyEnvironment::Reset() during wallet construction to clear out prior
state.

This change does affect bitcoin behavior slightly. On startup, instead of same
wallet environments staying open throughout VerifyWallets() and OpenWallets()
calls, VerifyWallets() will open and close an environment once for each wallet,
and OpenWallets() will create its own environment(s) later.

Github-Pull: #11911
Rebased-From: f1f4bb7
2019-03-12 23:24:11 +00:00
Chun Kuan Lee
0a9af2d4cb wallet: Create IsDatabaseLoaded function
Github-Pull: #14552
Rebased-From: 5912031
2019-03-11 21:54:44 +00:00
Russell Yanofsky
7751ea37b6 Refactor: Move m_db pointers into BerkeleyDatabase
This is a refactoring change that doesn't affect behavior. The motivation
behind the change is give BerkeleyEnvironment objects access to
BerkeleyDatabase objects so it will be possible to simplify the duplicate
wallet check and more reliably avoid opening the same databases twice.

Github-Pull: #14552
Rebased-From: c456fbd
2019-03-11 21:54:44 +00:00
Chun Kuan Lee
caf1146b13 wallet: Add trailing wallet.dat when detecting duplicate wallet if it's a directory.
Github-Pull: #14552
Rebased-From: 15c93f0
2019-03-11 21:54:44 +00:00
Chun Kuan Lee
34da2b7c76 tests: add test case for loading copied wallet twice
Github-Pull: #14320
Rebased-From: 4ea7732
2019-03-11 21:54:44 +00:00
Chun Kuan Lee
8965b6ab47 wallet: Fix duplicate fileid
Github-Pull: #14320
Rebased-From: 2d796fa
2019-03-11 21:54:44 +00:00
João Barbosa
16e5759455 wallet: Refactor to use WalletLocation
Github-Pull: #14350
Rebased-From: 65f3672
2019-03-11 21:54:44 +00:00
João Barbosa
21693ff0b7 wallet: Add WalletLocation utility class
Github-Pull: #14350
Rebased-From: 01a4c09
2019-03-11 21:54:44 +00:00
Andrew Chow
1c98a758d0 No longer shutdown after encrypting the wallet
Since the database environment is flushed, closed, and reopened during
EncryptWallet, there is no need to shut down the software anymore.

Github-Pull: #12493
Rebased-From: c1dde3a
2019-03-11 13:20:41 +00:00
Andrew Chow
435df68c62 Move BerkeleyEnvironment deletion from internal method to callsite
Instead of having the object destroy itself, having the caller
destroy it.

Github-Pull: #12493
Rebased-From: a769461
2019-03-11 13:20:22 +00:00
Andrew Chow
048fda2a66 After encrypting the wallet, reload the database environment
Calls ReloadDbEnv after encrypting the wallet so that the database
environment is flushed, closed, and reopened to prevent unencrypted
keys from being saved on disk.

Github-Pull: #12493
Rebased-From: d7637c5
2019-03-11 13:19:56 +00:00
Andrew Chow
f455979eb1 Add function to close all Db's and reload the databae environment
Adds a ReloadDbEnv function to BerkeleyEnvironment in order to close all Db
instances, closes the environment, resets it, and then reopens
the BerkeleyEnvironment.

Also adds a ReloadDbEnv function to BerkeleyDatabase that calls
BerkeleyEnvironment's ReloadDbEnv.

Github-Pull: #12493
Rebased-From: 5d296ac
2019-03-11 13:19:05 +00:00