Commit graph

18179 commits

Author SHA1 Message Date
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
Wladimir J. van der Laan
392d1382c1
Merge #15315: [0.17] [Doc] Backport release note about PSBT doc
807add9f5d [0.17] [Doc] Backport release note about PSBT doc (David A. Harding)

Pull request description:

  #15314 removes a release note from master for a doc that is backported to 0.17.  This adds the note to the 0.17 branch.  The only difference in the text is that the `master` in the URL has been changed to `0.17`.

Tree-SHA512: b81af561ad6cf608e3b957d7c50fe6d9b0818cfbd16313599d6dadb4b60e9e3345fef949c4e2ed16cdecfd62201e3e099907f1510e4d16a9f33625163c84c5a2
2019-02-02 12:30:09 +01:00
David A. Harding
807add9f5d
[0.17] [Doc] Backport release note about PSBT doc 2019-02-01 09:16:40 -05:00
Wladimir J. van der Laan
30db5cc641
Merge #15002: 0.17: Backport #14941
0cd9ad208c rpc: Make unloadwallet wait for complete wallet unload (João Barbosa)

Pull request description:

  #14941 makes `unloadwallet` a synchronous call meaning that it waits for the wallet to fully unload/delete.

Tree-SHA512: df7a490306ee2cca399129a4ebfba4b19b65fe67d1657ec3518352fe453327cb347010f94cf7fe4a60aeb51c928cb9ad6b24c40123fd0b9dc0aab5920a59f48d
2019-01-31 15:35:30 +01:00
Wladimir J. van der Laan
09a9238c04
Merge #15252: [0.17] Backport: Update zmq to 4.3.1
8418707286 Update zmq to 4.3.1 (Dimitris Apostolou)

Pull request description:

  Backports #15188 to the 0.17 branch.

  Addresses https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-6250.

Tree-SHA512: f8047a22430dcc92ef713e72281286c4cad2fbe3cd6880cb16b9f8c83bdc481a72539ff5fd373133ac006409ca083db68368e56df47a50798963e77fb3e579f2
2019-01-30 16:29:56 +01:00
MarcoFalke
1220b91fa7
Merge #15251: [0.17] doc: Remove errant paste from walletcreatefundedpsbt for nLocktime replaceable
c42f4177ce Remove errant past from walletcreatefundedpsbt for nLocktime replaceability (Gregory Sanders)

Pull request description:

  Backports #15213 to the 0.17 branch.

Tree-SHA512: f676e0b510b3ae76bf2ae46c7be289837a6d0152972c551ad6a837aab57ec74ee529c309163c8b7e3df446c2f30f148e920702dc31504cc239f99ad4a4607114
2019-01-25 11:56:54 -05:00
Dimitris Apostolou
8418707286
Update zmq to 4.3.1
Addresses https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-6250

Github-Pull: #15188
Rebased-From: 3046e5fc01
2019-01-25 11:52:39 +08:00
Gregory Sanders
c42f4177ce
Remove errant past from walletcreatefundedpsbt for nLocktime replaceability
Github-Pull: #15213
Rebased-From: 85f0ca95f3
2019-01-25 11:41:22 +08:00
João Barbosa
0cd9ad208c rpc: Make unloadwallet wait for complete wallet unload
Github-Pull: #14941
Rebased-From: c37851d
2019-01-16 00:33:32 +00:00
Wladimir J. van der Laan
0a0b2ea11f
Merge #15094: 0.17: Backport for #15085
59dd855d2d gui: Fix for Incorrect application name when passing -regtest (Ben Carman)

Pull request description:

  Changes the application name to `Bitcoin-Qt-regtest` when instead of `Bitcoin-Qt-testnet`

  Fixes #15079

Tree-SHA512: 96a8ee5b1906e81f087b3523a59b0d66a9ac0d0cfeb3b48c0762bcac6048c4c17998fc2bf83cff866aacd24f1860c578a2d93baa61e8c2638d265b30f8c2470a
2019-01-07 14:43:03 +01:00
Ben Carman
59dd855d2d
gui: Fix for Incorrect application name when passing -regtest
Github-Pull: #15085
Rebased-From: cc341adbbb
2019-01-05 10:13:53 -06:00
Wladimir J. van der Laan
5ff7b372cd
Merge #15065: 0.17: GUI Backports #14123 #14133 #14383 #14597
27beb83222 qt: All tray menu actions call showNormalIfMinimized (João Barbosa)
c470bbd19d qt: Use GUIUtil::bringToFront where possible (João Barbosa)
ac73c7d433 qt: Add GUIUtil::bringToFront (João Barbosa)
0c2fb87dc1 Remove obj_c for macOS Dock icon menu (Hennadii Stepanov)
90347141bd Use Qt signal for macOS Dock icon click event (Hennadii Stepanov)
4d4bc37df9 Remove obj_c for macOS Dock icon setting (Hennadii Stepanov)
d2ed162ce0 Clean systray icon menu for -disablewallet mode (Hennadii Stepanov)
298dc15686 gui: Favor macOS show / hide action in dock menu (João Barbosa)

Pull request description:

  Backport #14123 #14133 #14383 and #14597 to 0.17 branch to fix https://github.com/bitcoin/bitcoin/issues/13606#issuecomment-449846983.

Tree-SHA512: 543c80e7e2130870e801e0c9a69b06b9eea27c288478fc5dddeb662f7f3ec5b56b30916e5a9a629fced3fffcb8be77e2cd155e75cfd0a4392299add9730840f4
2019-01-03 09:54:44 +01:00
MarcoFalke
16521ce086
Merge #14945: [0.17] Backport: PSBT documentation
fa0c76adee Fix minor grammar error in doc (bitcoinhodler)
88c566a13f doc: Fix PSBT howto and example parameters (priscoan)
ddd008dbef Add PSBT documentation (Pieter Wuille)

Pull request description:

  Backports #13941, #14319 and #15012 to 0.17.

Tree-SHA512: 9fbc900aa98f948260273970c4e51e69088460e153fd7dae8f3ddebf37c68ecdf1cd02f1f32759c638e5aecbb89529631e8cc7cad0e6370dbc21e70baa6e9145
2018-12-30 18:38:48 +01:00
Wladimir J. van der Laan
623a19bc2b
Merge #15053: [0.17] Backport #14966
b4602e3240 fix testmempoolaccept CLI syntax (1Il1)

Pull request description:

  Backports #14966 to the 0.17 branch.

Tree-SHA512: 91ab186d612a11454d1a7cbe6d4251813e42eb438b5e2e0e1dfdb76c352d866fd4d5f04cc0cb696ffb7585f24babbfeb79e73481cc669e4b944712a743e822d3
2018-12-30 17:34:14 +01:00
João Barbosa
27beb83222 qt: All tray menu actions call showNormalIfMinimized
Github-Pull: #14123
Rebased-From: 0a656f85a9
2018-12-30 11:23:39 +00:00
João Barbosa
c470bbd19d qt: Use GUIUtil::bringToFront where possible
Github-Pull: #14123
Rebased-From: 6fc21aca6d
2018-12-30 11:23:16 +00:00
João Barbosa
ac73c7d433 qt: Add GUIUtil::bringToFront
Github-Pull: #14123
Rebased-From: 5796671e1d
2018-12-30 11:22:20 +00:00
Hennadii Stepanov
0c2fb87dc1 Remove obj_c for macOS Dock icon menu
Qt `setAsDockMenu()` does this work.

Github-Pull: #14597
Rebased-From: 6b1d2972bf
2018-12-30 11:21:54 +00:00
Hennadii Stepanov
90347141bd Use Qt signal for macOS Dock icon click event
This moves the Dock icon click reaction code to the common place and
allows some cleanup in obj_c code.

According to the Apple's docs `class_replaceMethod` behaves as
`class_addMethod`, if the method identified by name does not yet exist;
or as `method_setImplementation`, if it does exist.

Github-Pull: #14597
Rebased-From: 2464925e7b
2018-12-30 11:21:15 +00:00
Hennadii Stepanov
4d4bc37df9 Remove obj_c for macOS Dock icon setting
Qt `setWindowIcon()` does this work.

Github-Pull: #14597
Rebased-From: 53bb6be3f8
2018-12-30 00:23:47 +00:00
Hennadii Stepanov
d2ed162ce0 Clean systray icon menu for -disablewallet mode
Ref #3392

Github-Pull: #14383
Rebased-From: 36323e2ac6
2018-12-30 00:20:18 +00:00
João Barbosa
298dc15686 gui: Favor macOS show / hide action in dock menu
Github-Pull: #14133
Rebased-From: ee3a494f37
2018-12-30 00:19:18 +00:00
MarcoFalke
fa941016e8
Merge #15055: [0.17] Backport #14944
b138b4abff doc: update NetBSD build instructions for 8.0 (fanquake)

Pull request description:

  Backports #14944 to the 0.17 branch.

Tree-SHA512: b169ff9c42cca3573b972b43adaf0556d5a198a755cd4c1a69c4c557b7cab6cf977c24d575c8802869d157d2bb0dff76c5d7f1e7647a58a4670f252614dab421
2018-12-29 13:45:23 +01:00
fanquake
b138b4abff
doc: update NetBSD build instructions for 8.0
Github-Pull: #14944
Rebased-From: be5ca825a3
2018-12-29 17:31:34 +08:00
1Il1
b4602e3240
fix testmempoolaccept CLI syntax
`testmempoolaccept "hexstring"` will give a "JSON parse error". The correct syntax is `testmempoolaccept \[\"hexstring\"\]` (but seems escaping is not displayed in other areas so leaving backspaces out).

Github-Pull: #14966
Rebased-From: b74a52192b
2018-12-29 17:15:55 +08:00
bitcoinhodler
fa0c76adee
Fix minor grammar error in doc
Github-Pull: #15012
Rebased-From: 72b63bc905
2018-12-28 18:58:38 +08:00
priscoan
88c566a13f
doc: Fix PSBT howto and example parameters
* Remove outdated reference to replaceable parameter
* Fix address reference
* Unify quotation and italicization of parameters
* Fix PSBT reference

Github-Pull: #14319
Rebased-From: 78542a3f36
2018-12-28 18:58:38 +08:00
Pieter Wuille
ddd008dbef
Add PSBT documentation
Github-Pull: #13941
Rebased-From: 19efc01aec
2018-12-28 18:58:38 +08:00
Wladimir J. van der Laan
fd616d8d08
doc: Clean out release notes post-0.17.1
Tree-SHA512: 0cd6e97156da2dea9a9b557083d8140c17f85f6e718d5fcb73aa67460480b6437b665fad147bf4eacd13570aeb25a29f28c35b7fb0365ae630b2edf05901a431
2018-12-25 10:21:54 +01:00
MarcoFalke
e11856515e
Merge #14893: 0.17 [Backport 14890] rpc: Avoid creating non-standard raw transactions
46c162df47 rpc: Avoid creating non-standard raw transactions (MarcoFalke)

Pull request description:

Tree-SHA512: f34678637c8b6559e5c0c2790b682af562479239b92be96e0d41806bade136866f9748487a021eb8c62b6a5027b0a1a2cbdee930243eac93edabef60cbd54eac
2018-12-24 13:06:32 +01:00
MeshCollider
a057cc08fd
Merge #14900: [backport] #14679 importmulti: Don't add internal addresses to address book
ae1b6756c importmulti: Don't add internal addresses to address book (Gregory Sanders)

Pull request description:

Tree-SHA512: 749e4864862bc3402a0fad200578804ce6577b4d954fd3e741191b4c941df28d54f98422f90e7fdf9bdf9c01e53ec36cf970e61d22ccc0478771285dd8cef6a0
2018-12-25 00:12:44 +13:00
Gregory Sanders
ae1b6756c9
importmulti: Don't add internal addresses to address book
Github-Pull: #14679
Rebased-From: 7afddfa8ce
2018-12-09 22:32:45 +08:00
MarcoFalke
46c162df47 rpc: Avoid creating non-standard raw transactions
Github-Pull: #14890
Rebased-From: fa4c8679ed
2018-12-07 11:36:29 -05:00
Wladimir J. van der Laan
ef70f9b52b
doc: Fill in authors and changelog for 0.17.1 release notes
Tree-SHA512: dc23ae43e81ad379b48bb8dc6da21cde647a7edc778563b8b8266dfe84d9baa70bf4565915e276ea0e14aa96ce677547494da0aadeebfcc961f53430c7bb84ea
2018-12-07 00:29:45 +01:00
Wladimir J. van der Laan
c6e4a1fca5
Merge #14889: [0.17] Backport #14424 (Stop requiring imported pubkey to sign non-PKH schemes)
89a9a9d938 Stop requiring imported pubkey to sign non-PKH schemes (Pieter Wuille)

Pull request description:

  Github-Pull: #14424
  Rebased-From: 2f6b466aeb

Tree-SHA512: 1ea10dee66626f04918f197cd7c4949a836fa49c8f676f276b2328f8d79389059db7b30fc04d4c4bf8209f6a8d21f3ea49a017ddc7623eca6b7e6efc2fe0d749
2018-12-07 00:10:06 +01:00