Commit graph

26277 commits

Author SHA1 Message Date
Wladimir J. van der Laan 924a4ff7eb
Merge #20242: fuzz: Properly initialize PrecomputedTransactionData
fa56d56d4e fuzz: Properly initialize PrecomputedTransactionData (MarcoFalke)

Pull request description:

  Fixes:

  ```
  script_flags: script/interpreter.cpp:1512: bool SignatureHashSchnorr(uint256 &, const ScriptExecutionData &, const T &, uint32_t, uint8_t, SigVersion, const PrecomputedTransactionData &) [T = CTransaction]: Assertion `cache.m_bip341_taproot_ready && cache.m_spent_outputs_ready' failed.
  ==34989== ERROR: libFuzzer: deadly signal
      #0 0x55e90077ff11 in __sanitizer_print_stack_trace (/tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/script_flags+0x20cf11)
      #1 0x55e9006cb068 in fuzzer::PrintStackTrace() (/tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/script_flags+0x158068)
      #2 0x55e9006b01b3 in fuzzer::Fuzzer::CrashCallback() (/tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/script_flags+0x13d1b3)
      #3 0x7f6fb89383bf  (/lib/x86_64-linux-gnu/libpthread.so.0+0x153bf)
      #4 0x7f6fb855018a in raise (/lib/x86_64-linux-gnu/libc.so.6+0x4618a)
      #5 0x7f6fb852f858 in abort (/lib/x86_64-linux-gnu/libc.so.6+0x25858)
      #6 0x7f6fb852f728  (/lib/x86_64-linux-gnu/libc.so.6+0x25728)
      #7 0x7f6fb8540f35 in __assert_fail (/lib/x86_64-linux-gnu/libc.so.6+0x36f35)
      #8 0x55e9008275bd in bool SignatureHashSchnorr<CTransaction>(uint256&, ScriptExecutionData const&, CTransaction const&, unsigned int, unsigned char, SigVersion, PrecomputedTransactionData const&) /tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/script/interpreter.cpp:1512:5
      #9 0x55e900825a3f in GenericTransactionSignatureChecker<CTransaction>::CheckSchnorrSignature(Span<unsigned char const>, Span<unsigned char const>, SigVersion, ScriptExecutionData const&, ScriptError_t*) const /tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/script/interpreter.cpp:1699:10
      #10 0x55e900832503 in VerifyWitnessProgram(CScriptWitness const&, int, std::vector<unsigned char, std::allocator<unsigned char> > const&, unsigned int, BaseSignatureChecker const&, ScriptError_t*, bool) /tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/script/interpreter.cpp:1900:26
      #11 0x55e90082ecb5 in VerifyScript(CScript const&, CScript const&, CScriptWitness const*, unsigned int, BaseSignatureChecker const&, ScriptError_t*) /tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/script/interpreter.cpp:1977:18
      #12 0x55e9007a9b61 in test_one_input(std::vector<unsigned char, std::allocator<unsigned char> > const&) /tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/script_flags.cpp:51:30
      #13 0x55e9007d0b49 in LLVMFuzzerTestOneInput /tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/fuzz.cpp:36:5
      #14 0x55e9006b1871 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/script_flags+0x13e871)
      #15 0x55e9006b0fb5 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) (/tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/script_flags+0x13dfb5)
      #16 0x55e9006b38d7 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) (/tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/script_flags+0x1408d7)
      #17 0x55e9006b3c39 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) (/tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/script_flags+0x140c39)
      #18 0x55e9006a290e in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/script_flags+0x12f90e)
      #19 0x55e9006cb752 in main (/tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/script_flags+0x158752)
      #20 0x7f6fb85310b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
      #21 0x55e9006776ad in _start (/tmp/bitcoin-core/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/script_flags+0x1046ad)

ACKs for top commit:
  laanwj:
    Code review ACK fa56d56d4e

Tree-SHA512: 5637b0a0d982360df32d8cd39e913395967af02ec746508fc5f2fd649695c58bfaaf18ef76f4ca9da764d34fdd63dfe188317dd41b2ed57534bd4055a05ae870
2020-10-29 11:50:28 +01:00
Wladimir J. van der Laan 6196cf77e5
Merge #19753: p2p: don't add AlreadyHave transactions to recentRejects
d419fdedbe [net processing] Don't add AlreadyHave txs to recentRejects (Troy Giorshev)

Pull request description:

  If we already have a transaction, don't add it to recentRejects

  Now, we only add a transaction to our recentRejects filter if we didn't already have it, meaning that it is added at most once, as intended.

ACKs for top commit:
  jnewbery:
    Code review ACK d419fdedbe
  laanwj:
    Code review ACK d419fdedbe

Tree-SHA512: cff5c1ba36c4700e2d6ab3eec4a3e51e1bef28fb3cc1bc850c84e06d6e5a9f6c32825207c253cc9cdf596b2eaadb6b5be68b3f8ca752b4ef6c31cf85138e3c99
2020-10-29 11:40:15 +01:00
Jon Atack 0be29000c0
rpc: update conf_target helps for correctness/consistency
for sendtoaddress, sendmany, send, fundrawtransaction, walletcreatefundedpsbt, bumpfee
2020-10-29 00:22:12 +01:00
Jon Atack 778b9be406
wallet, rpc: fix send subtract_fee_from_outputs help 2020-10-29 00:22:10 +01:00
Jon Atack 603c005083
wallet: add rpc send explicit fee rate coverage 2020-10-29 00:22:08 +01:00
Jon Atack dd341e602d
wallet: add sendtoaddress/sendmany explicit fee rate coverage 2020-10-29 00:22:04 +01:00
Jon Atack 44e7bfa603
wallet: add walletcreatefundedpsbt explicit fee rate coverage 2020-10-29 00:22:02 +01:00
Jon Atack 6e1ea4273e
test: refactor for walletcreatefundedpsbt fee rate coverage 2020-10-29 00:22:00 +01:00
Jon Atack 3ac7b0c6f1
wallet: fundrawtx fee rate coverage, fixup ParseConfirmTarget() 2020-10-29 00:21:57 +01:00
MarcoFalke 3f512f3d56
Merge #20258: tests: Remove getnettotals/getpeerinfo consistency test
778cd0d88d [tests] Remove getnettotals/getpeerinfo consistency test (John Newbery)

Pull request description:

  We make no guarantees about consistency between RPC calls.

  Alternative to 18784

ACKs for top commit:
  MarcoFalke:
    review ACK 778cd0d88d
  troygiorshev:
    ACK 778cd0d88d after reading discussion on 18784, code review, ran test

Tree-SHA512: 438333a111cc93a09680cec47f13fbe03557d4803e5d826aec6f72e5afea62a088622645f0756e8fd2c9182c2a69ccca867d4d6fed2250364bee2b6c834adb1a
2020-10-28 16:27:33 +01:00
John Newbery 778cd0d88d [tests] Remove getnettotals/getpeerinfo consistency test
We make no guarantees about consistency between RPC calls.
2020-10-28 10:18:09 +00:00
Wladimir J. van der Laan db26eeba71
Merge #19877: [test] clarify rpc_net & p2p_disconnect_ban functional tests
47ff5098ad [test] Clarify setup of node topology. (Amiti Uttarwar)
0672522aed [move-only, test]: Match test order with run order (Amiti Uttarwar)

Pull request description:

  small improvements to clarify logic in the functional tests
  1. have test logic in `rpc_net.py` match run order of the test
  2. remove `connect_nodes` calls that are redundant with the automatic test setup executed by the test framework

  Noticed when I was trying to debug a test for #19725. Small changes but imo very helpful, because they initially confused me.

ACKs for top commit:
  laanwj:
    ACK 47ff5098ad

Tree-SHA512: 2843da2c0b4f06b2600b3adb97900a62be7bb2228770abd67d86f2a65c58079af22c7c20957474a98c17da85f40a958a6f05cb8198aa0c56a58adc1c31100492
2020-10-28 10:25:34 +01:00
MarcoFalke 488b77f72e
Merge #20256: qt: Pre-splitoff translations update
a193f969ee qt: Pre-splitoff translations update (Wladimir J. van der Laan)

Pull request description:

  Do a pre-splitoff translations update. Pulls the translations from Transifex, and apparently, there are also some new English messages in the source code since the transtlations freeze, but not many.

ACKs for top commit:
  fanquake:
    ACK a193f969ee - I got the same changes (branch: [translation_check_0210](https://github.com/fanquake/bitcoin/tree/translation_check_0210)), except for a diff in `src/qt/locale/bitcoin_es_MX.ts`. Although from a look on Transifex it seems that transalation may have been updated in the last hour or so.

Tree-SHA512: 315c1f4327142caae01179a8398b0a8adb9108e1fc8122585274b7ed74ae878554399a06fd12a8103a4933ecf0ad6e211d6efc63edc6827c0168317f2b83528f
2020-10-28 08:50:12 +01:00
Pieter Wuille 5803f5f5f6 Update secp256k1 subtree to latest master 2020-10-27 23:08:48 -07:00
Pieter Wuille 6c0259fc2f Squashed 'src/secp256k1/' changes from c6b6b8f1bb..3967d96bf1
3967d96bf1 Merge #838: Make autotools check for all the used openssl functions
3734b68200 Configure echo if openssl tests are enabled
6f54e69f03 Merge #841: Avoids a potentially shortening size_t to int cast in strauss_wnaf_
8893f42438 Avoids a potentially shortening size_t to int cast in strauss_wnaf_
e6692778d3 Modify bitcoin_secp.m4's openssl check to call all the functions that we use in the tests/benchmarks. That way linking will fail if those symbols are missing
ac05f61fcf Merge #809: Stop treating ECDH as experimental
e6e3d5da2f travis: add schnorrsig to valgrind and big endian platform test
353dff156f Stop treating ECDH as experimental

git-subtree-dir: src/secp256k1
git-subtree-split: 3967d96bf184519eb98b766af665b4d4b072563e
2020-10-27 23:08:48 -07:00
Amiti Uttarwar 47ff5098ad [test] Clarify setup of node topology.
Since the test framework automatically sets up a connection between the nodes,
the second connect_nodes call was a no-op. Remove the redundant call & add
comments to explain the expected topology.
2020-10-27 19:23:02 -07:00
Amiti Uttarwar 0672522aed [move-only, test]: Match test order with run order 2020-10-27 13:45:25 -07:00
Jon Atack 2d8eba8f84
wallet: combine redundant bumpfee invalid params and args tests
might be best reviewed with:

git show COMMIT_HASH -w --color-moved=dimmed-zebra
2020-10-27 21:33:43 +01:00
Jon Atack 1697a40b6f
wallet: improve bumpfee error/help, add explicit fee rate coverage 2020-10-27 21:33:37 +01:00
Hennadii Stepanov ad5cef5dfd
doc: Update data directory path comments 2020-10-27 21:46:00 +02:00
Hennadii Stepanov b19e88230f
util: Add StripRedundantLastElementsOfPath function
Co-authored-by: saibato <saibato.naga@pm.me>
Co-authored-by: MarcoFalke <falke.marco@gmail.com>
2020-10-27 21:45:32 +02:00
Wladimir J. van der Laan a193f969ee qt: Pre-splitoff translations update 2020-10-27 19:40:44 +01:00
Suhas Daftuar 16d9bfc417 Avoid test-before-evict evictions of current peers
Outbound peer logic prevents connecting to addresses that we're already
connected to, so prevent inadvertent eviction of current peers via
test-before-evict by checking this condition and marking current peer's
addresses as Good().

Co-authored-by: John Newbery <john@johnnewbery.com>
2020-10-27 11:15:21 -04:00
Suhas Daftuar e8b215a086 Refactor test for existing peer connection into own function 2020-10-27 11:15:21 -04:00
Suhas Daftuar 4fe338ab3e Call CAddrMan::Good() on block-relay-only peer addresses
Being able to invoke Good() is important for address management (new vs tried
table, tried table eviction via test-before-evict). We mitigate potential
information leaks by not calling Connected() on these peer addresses.
2020-10-27 11:15:21 -04:00
Suhas Daftuar daf5553126 Avoid calling CAddrMan::Connected() on block-relay-only peer addresses
Connected() updates the time we serve in addr messages, so avoid leaking
block-relay-only peer connections by avoiding these calls.
2020-10-27 11:14:58 -04:00
Jonas Schnelli 55b1ffcd25
Merge bitcoin-core/gui#116: Fix unreasonable default size of the main window without loaded wallets
7b2e42ecc4 qt: Add WalletFrame::sizeHint (Hennadii Stepanov)

Pull request description:

  This PR fixes a bug in master (d67883d01e) and in 0.20.1 that could be easily reproduced with
  ```
  $ src/qt/bitcoin-qt -regtest -resetguisettings -nowallet
  ```

  ![Screenshot from 2020-10-25 21-21-27](https://user-images.githubusercontent.com/32963518/97117179-b1800100-170a-11eb-87c9-3120d39b9455.png)
  ![Screenshot from 2020-10-25 21-23-32](https://user-images.githubusercontent.com/32963518/97117186-b644b500-170a-11eb-8b5d-234ff7205003.png)

  **With this PR:**

  ![Screenshot from 2020-10-25 21-20-35](https://user-images.githubusercontent.com/32963518/97117226-f441d900-170a-11eb-8d66-98b7718a2bb1.png)
  ![Screenshot from 2020-10-25 21-23-03](https://user-images.githubusercontent.com/32963518/97117232-f99f2380-170a-11eb-85ed-c7b5ece926b2.png)

  ---

  Fix #104
  Fix #113

  This PR is an alternative to #107 without [hard-coding a size in pixels](https://github.com/bitcoin-core/gui/pull/107#discussion_r511474021).

ACKs for top commit:
  jonasschnelli:
    Tested ACK 7b2e42ecc4 - I can confirm this fixes #104 (Ubuntu 20.04 - HiDPI 200%).

Tree-SHA512: eb0692dbeb3befdeecca0e41534c9783eab6637c14cc4f170ee42619235884f9354f8d22a10c20c08cc89dc5340a60b7dfa2523c12e64b3386b3fd2c6d5f934e
2020-10-27 14:51:30 +01:00
fanquake d0a829e963
build: fix mutex detection when building bdb on macOS
Starting with the Clang shipped with Xcode 12, Apple has enabled
-Werror=implicit-function-declaration by default. This causes bdbs mutex
detection to fail when building on macOS (not cross-compiling):

checking for mutexes... UNIX/fcntl
configure: WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM.
configure: error: Unable to find a mutex implementation

as previously emitted warnings are being turned into errors. i.e:

error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]

Append -Wno-error=implicit-function-declaration to cflags so that
-Wimplicit-function-declaration returns to being a warning, and the
configure checks will succeed.

Fixes #19411.
2020-10-27 21:30:12 +08:00
Troy Giorshev d419fdedbe [net processing] Don't add AlreadyHave txs to recentRejects
Now, we only add a transaction to our recentRejects filter if we didn't
already have it, meaning that it is added at most once, as intended.
2020-10-27 06:07:41 -04:00
Wladimir J. van der Laan 83363f7b62
Merge #20167: test: Add test for -blockversion
fa9b48549c test: Add test for -blockversion (MarcoFalke)
fa7fb0e442 test: Default blockversion to 4 in feature_block (MarcoFalke)
fa2b778d0c test: Remove unused -blockversion from tests (MarcoFalke)

Pull request description:

  `-blockversion` is currently untested, as in: The setting could be made a no-op without any tests failing. Fix that by adding an explicit test for it. Also, related minor cleanups.

ACKs for top commit:
  guggero:
    ACK fa9b48549c.

Tree-SHA512: 1b2e792f7ed0ec1db163476ee8a938f8f7cb3691f797c721bbe55fdeed92487c2ff83b55467440096917999406c86430cb3a615383cefb4f621828309ff6a1e7
2020-10-27 10:57:57 +01:00
Wladimir J. van der Laan c1564baf3b
Merge #19124: doc: Document ALLOW_HOST_PACKAGES dependency option
47e2a35fac doc: Document ALLOW_HOST_PACKAGES dependency option (skmcontrib)

Pull request description:

  Provided entry in depends, README.md to ensure that ALLOW_HOST_PACKAGES dependency option is documented, #19113

ACKs for top commit:
  hebasto:
    ACK 47e2a35fac.

Tree-SHA512: 10d9285885be25f092881e4886c6a804cd42b5224bdf1dfa8b8369463808ddaf533a8604f14f7fe45478434a22feae98053f4731b51d976c071d69882bdac72b
2020-10-27 10:17:14 +01:00
fanquake 67d4643a1a
Merge #20152: doc: Update wallet files in files.md
defe48a51f doc: Update wallet files in files.md (Hennadii Stepanov)

Pull request description:

  This PR is a #19077 follow up, and it addresses the [comment](https://github.com/bitcoin/bitcoin/pull/19077#discussion_r504805234):

  > If need to update, there are two corrections that could be made:
  >
  >  * Line 69 "Wallets are Berkeley DB (BDB) databases" is no longer true
  >
  >  * Line 76 "Wallet lock file" should say "BDB wallet lock file"

ACKs for top commit:
  RiccardoMasutti:
    ACK defe48a
  meshcollider:
    ACK defe48a51f

Tree-SHA512: 39939f86a9c7842bf06913998305dcbd6209585f1da0fe9c274bac0572eb8464e59176884dd9e2b91312f34efad40cdeb4085ec72c2a2c1b33d16b6ab505140c
2020-10-27 15:43:53 +08:00
MarcoFalke fa463f1163
Merge #20247: fuzz: Check for addrv1 compatibility before using addrv1 serializer. Fuzz addrv2 serialization.
903f3d0627 fuzz: Check for addrv1 compatibility before using addrv1 serializer (practicalswift)

Pull request description:

  Fuzz addrv2 address serialization.

  Check for addrv1 compatibility before using addrv1 serializer.

  Before this

  ```
  $ src/test/fuzz/netaddr_deserialize
  netaddr_deserialize: test/fuzz/deserialize.cpp:84: void
      (anonymous namespace)::AssertEqualAfterSerializeDeserialize(const T &) [T = CNetAddr]:
      Assertion `Deserialize<T>(Serialize(obj)) == obj' failed.
  ```

  After this patch:

  ```
  $ src/test/fuzz/netaddr_deserialize
  …
  ```

ACKs for top commit:
  MarcoFalke:
    review ACK 903f3d0627

Tree-SHA512: a9ddb71cc31c877fa3dd78dbc908d1e30b4790398fefe19e6541f1fca81e8560f7a11fa099ef3943b94401974c472e523484fdf66f1c23ff2e998558ba4b65de
2020-10-27 08:07:23 +01:00
practicalswift 903f3d0627 fuzz: Check for addrv1 compatibility before using addrv1 serializer 2020-10-26 16:37:35 +00:00
MarcoFalke fa9b48549c
test: Add test for -blockversion 2020-10-26 16:31:25 +01:00
MarcoFalke fa56d56d4e
fuzz: Properly initialize PrecomputedTransactionData 2020-10-26 09:17:25 +01:00
Hennadii Stepanov 7b2e42ecc4
qt: Add WalletFrame::sizeHint
This change makes the layout of a WalletFrame widget correct even
without loaded wallets.
2020-10-25 21:17:18 +02:00
Jon Atack 398045ba8b
cli -netinfo: print oversized/extreme ping times as "-" 2020-10-25 16:51:21 +01:00
Jon Atack 773f4c99c0
cli -netinfo: handle longer tor v3 local addresses 2020-10-25 16:51:18 +01:00
Jon Atack 33e987452f
cli -netinfo: make age column variable-width
as it has a wide possible range and the new name ("age" instead of "uptime") is
much shorter.
2020-10-25 16:22:55 +01:00
Jon Atack f8a1c4d946
cli -netinfo: various quick updates and fixes
- add new signet chain

- update change "uptime" column name to "age" per suggestion by 0xB10C (Timo)

- add an additional digit to mping field width

- change m_networks_size from size_t to uint8_t, as size_t was a holdover
  from m_networks_size being defined as size_t m_networks.size() in a draft

- order Peer struct members by decreasing memory size
2020-10-25 16:15:56 +01:00
Wladimir J. van der Laan 6866259fab net: Hardcoded seeds update for 0.21
Stats:

```
  IPv4   IPv6  Onion Pass
426728  59523   7900 Initial
426728  59523   7900 Skip entries with invalid address
426728  59523   7900 After removing duplicates
426727  59523   7900 Skip entries from suspicious hosts
123226  51785   7787 Enforce minimal number of blocks
121710  51322   7586 Require service bit 1
  4706   1427   3749 Require minimum uptime
  4124   1098   3681 Require a known and recent user agent
  4033   1075   3681 Filter out hosts with multiple bitcoin ports
   512    140    512 Look up ASNs and limit results per ASN and per net
```
2020-10-25 14:25:00 +01:00
RandyMcMillan 36e875b4c5 contrib: Add new versions to makeseeds.py and update gitignore 2020-10-25 14:08:33 +01:00
Jon Atack fc5721723d
wallet: fix SetFeeEstimateMode() error message
to clarify for the user the confusing error message that the missing fee rate
needs to be set in the conf_target param/option.
2020-10-25 00:35:38 +02:00
Jon Atack 052427eef1
wallet, bugfix: fix bumpfee with explicit fee rate modes 2020-10-24 22:03:11 +02:00
MarcoFalke d67883d01e
Merge bitcoin-core/gui#43: bugfix: Call setWalletActionsEnabled(true) only for the first wallet
20c9e03554 gui: Call setWalletActionsEnabled(true) only for the first wallet (Hennadii Stepanov)

Pull request description:

  On master (a78742830a) there is a bug:
  - open an encrypted wallet; please note that the "Encrypt Wallet..." menu item is disabled that is expected:
  ![Screenshot from 2020-08-03 12-38-37](https://user-images.githubusercontent.com/32963518/89169084-70060c80-d586-11ea-86b9-05ef38d08f41.png)
  - then open any other wallet; note that the "Encrypt Wallet..." menu item gets enabled that is wrong:
  ![Screenshot from 2020-08-03 12-42-36](https://user-images.githubusercontent.com/32963518/89169385-d68b2a80-d586-11ea-9813-a533a847e098.png)

  This PR fixes this bug.

ACKs for top commit:
  jonasschnelli:
    Tested ACK 20c9e03554 - I could reproduce the issue on master and have verify that this PR fixes it.
  achow101:
    ACK 20c9e03554

Tree-SHA512: 2c9ab94bde8c4f413b0a95c05bf3a1a29f5910e0f99d6639a11dd77758c78af25b060b3fecd78117066ef15b113feb79870bc1347cc04289da915c00623e5787
2020-10-24 09:01:37 +02:00
Hennadii Stepanov bf6855a909
wallet: Fix bug when just created encrypted wallet cannot get address 2020-10-23 19:24:24 +03:00
Jonas Schnelli 49984b44cf
Merge bitcoin-core/gui#71: Fix visual quality of text in QR image
6954156b40 qt: Fix visual quality of text in QR image (Hennadii Stepanov)
8071c75d45 qt, refactor: Limit scope of QPainter object (Hennadii Stepanov)

Pull request description:

  Master (197450f808):
  ![DeepinScreenshot_select-area_20200824001800](https://user-images.githubusercontent.com/32963518/90988962-96283680-e59f-11ea-8e20-42e9b23033f5.png)

  This PR (6954156b40):
  - macOS 10.15.6
  ![Screenshot from 2020-09-07 15-40-30](https://user-images.githubusercontent.com/32963518/92390251-2c716600-f123-11ea-96f0-0e9d35810c76.png)

  - Linux Mint 20
  ![Screenshot from 2020-09-07 15-48-13](https://user-images.githubusercontent.com/32963518/92390272-36936480-f123-11ea-8fee-4de23bb40ed9.png)

  Fix #54
  Fix https://github.com/bitcoin/bitcoin/issues/19103

  ---

  The first commit is easy to review with [`git diff --word-diff`](8071c75d45?w=1).

ACKs for top commit:
  jonasschnelli:
    Tested ACK 6954156b40 - tested on macOS 10.15. Fixes the problem.

Tree-SHA512: 6ecb3397d2a5094c5f00ee05fc09520751568404e000a8691b6de7e57f38c2d5da628694e5e45a2b4cc302a846bbc00014c40820233eb026d3ebd4f68c2c9913
2020-10-23 11:54:47 +02:00
fanquake 9af7c1993b
Merge #20216: wallet: fix buffer over-read in SQLite file magic check
56a461f727 wallet: fix buffer over-read in SQLite file magic check (Sebastian Falbesoner)

Pull request description:

  Looking at our new SQLite database code, I noticed that there is a potential problem in the method `IsSQLiteFile()`:  If there is no terminating zero within the first 16 bytes of the file, the `magic` buffer would be over-read in the `std::string` constructor for `magic_str`. Fixed by using the "from buffer" variant of the string ctor (that also takes a size) rather than the "from c-string" variant (see http://www.cplusplus.com/reference/string/string/string/).

  The behaviour can be reproduced by the following steps:
  * Creating a file of at least 512 bytes in size (to pass the minimum size check) that doesn't contain zero bytes in the magic area, e.g. simply:
  `$ python3 -c "print('A'*512)" > /tmp/corrupt_wallet`
  * Showing content and size of the `magic_str` string in case the magic check fails
  * Create a simple unit test that simply calls `IsSQLiteFile` with the corrupt wallet file
  * Run the unit test and see the random gibberish output of `magic_str` after 16 `A`s :-)

  Or, TLDR variant, just get the branch https://github.com/theStack/bitcoin/tree/reproduce_sqlite_magic_overread, compile unit Tests and run the script `./reproduce_sqlite_magic_overread.sh`.

  Note that this is the minimal diff, probably it would be better to avoid `std::string` at all in this case and just use `memcmp`, strings that include null bytes are pretty confusing.

ACKs for top commit:
  promag:
    Code review ACK 56a461f727.
  practicalswift:
    ACK 56a461f727: patch looks correct
  achow101:
    ACK 56a461f727

Tree-SHA512: a7aadd4d38eb92337e6281df2980f4bde744dbb6cf112b9cd0f2cab8772730e302db9123a8fe7ca4e7e844c47e68957487adb2bed4518c40b4bed6a69d7922b4
2020-10-23 10:10:54 +08:00
Jonas Schnelli 9453fbf5a0
Merge #20: Wrap tooltips in the intro window
6ed4bcabc1 qt: Wrap tooltips in the intro window (Hennadii Stepanov)

Pull request description:

  On master (d6fe5b28df):

  ![DeepinScreenshot_select-area_20200702082514](https://user-images.githubusercontent.com/32963518/86319852-18e6e200-bc3e-11ea-902c-1b868540f4cf.png)

  With this PR:

  ![Screenshot from 2020-07-02 08-22-44](https://user-images.githubusercontent.com/32963518/86319881-28fec180-bc3e-11ea-9d76-522a5e71c32d.png)

  ---

  This is a move-only change.

  This was done while reviewing #15.

ACKs for top commit:
  jonasschnelli:
    utACK 6ed4bcabc1

Tree-SHA512: 67507c8c5628cd95fe8e377ce21e2c23d305faf1affa0b7579885553c20055ba07ed61e2aed3230d7cd22c3c90f76e0c58cb3238be9f153a8ca6e6d4e38753b0
2020-10-22 21:26:00 +02:00