Commit Graph

28056 Commits

Author SHA1 Message Date
Russell O'Connor
6a0a6e7d05 Correction for VerifyTaprootCommitment comments
According to BIP-341, 'p' is called the taproot *internal* key, not inner key.
2021-03-01 09:01:48 -05:00
Vasil Dimov
ea1845315a
net: extend Sock::Wait() to report a timeout
Previously `Sock::Wait()` would not have signaled to the caller whether
a timeout or one of the requested events occurred since that was not
needed by any of the callers.

Such functionality will be needed in the I2P implementation, thus extend
the `Sock::Wait()` method.
2021-03-01 13:22:18 +01:00
Vasil Dimov
78fdfbea66
net: dedup MSG_NOSIGNAL and MSG_DONTWAIT definitions
Deduplicate `MSG_NOSIGNAL` and `MSG_DONTWAIT` definitions from `net.cpp`
and `netbase.cpp` to `compat.h` where they can also be reused by other
code.
2021-03-01 13:22:17 +01:00
Vasil Dimov
34bcfab562
net: move the constant maxWait out of InterruptibleRecv()
Move `maxWait` out of `InterruptibleRecv()` and rename it to
`MAX_WAIT_FOR_IO` so that it can be reused by other code.
2021-03-01 13:22:17 +01:00
Vasil Dimov
cff65c4a27
net: extend CNetAddr::SetSpecial() to support I2P
Recognize also I2P addresses in the form `base32hashofpublickey.b32.i2p`
from `CNetAddr::SetSpecial()`.

This makes `Lookup()` support them, which in turn makes it possible to
manually connect to an I2P node by using
`-proxy=i2p_socks5_proxy:port -addnode=i2p_address.b32.i2p:port`

Co-authored-by: Lucas Ontivero <lucasontivero@gmail.com>
2021-03-01 13:22:11 +01:00
Vasil Dimov
f6c267db3b
net: avoid unnecessary GetBindAddress() call
Our local (bind) address is already saved in `CNode::addrBind` and there
is no need to re-retrieve it again with `GetBindAddress()`.

Also, for I2P connections `CNode::addrBind` would contain our I2P
address, but `GetBindAddress()` would return something like
`127.0.0.1:RANDOM_PORT`.
2021-03-01 12:57:01 +01:00
Vasil Dimov
7c224fdac4
net: isolate the protocol-agnostic part of CConnman::AcceptConnection()
Isolate the second half of `CConnman::AcceptConnection()` into a new
separate method, which could be reused if we accept incoming connections
by other means than `accept()` (first half of
`CConnman::AcceptConnection()`).
2021-03-01 12:57:01 +01:00
Vasil Dimov
1f75a653dd
net: get the bind address earlier in CConnman::AcceptConnection()
Call `GetBindAddress()` earlier in `CConnman::AcceptConnection()`. That
is specific to the TCP protocol and makes the code below it reusable for
other protocols, if the caller provides `addr_bind`, retrieved by other
means.
2021-03-01 12:57:01 +01:00
Vasil Dimov
25605895af
net: check for invalid socket earlier in CConnman::AcceptConnection()
This check is related to an `accept()` failure. So do the check earlier,
closer to the `accept()` call.

This will allow to isolate the `accept()`-specific code at the beginning
of `CConnman::AcceptConnection()` and reuse the code that follows it.
2021-03-01 12:57:00 +01:00
Vasil Dimov
545bc5f81d
util: fix WriteBinaryFile() claiming success even if error occurred
`fclose()` is flushing any buffered data to disk, so if it fails then
that could mean that the data was not completely written to disk.

Thus, check if `fclose()` succeeds and only then claim success from
`WriteBinaryFile()`.
2021-03-01 12:57:00 +01:00
Vasil Dimov
8b6e4b3b23
util: fix ReadBinaryFile() returning partial contents
If an error occurs and `fread()` returns `0` (nothing was read) then the
code before this patch would have returned "success" with a partially
read contents of the file.
2021-03-01 12:57:00 +01:00
Vasil Dimov
4cba2fdafa
util: extract {Read,Write}BinaryFile() to its own files
Extract `ReadBinaryFile()` and `WriteBinaryFile()` from `torcontrol.cpp`
to its own `readwritefile.{h,cpp}` files, so that it can be reused from
other modules.
2021-03-01 12:56:56 +01:00
Wladimir J. van der Laan
ad89812c70
Merge #21321: guix: Add curl to required tool list
97f10621f4 guix: Add curl to required tool list (Hennadii Stepanov)

Pull request description:

  On Ubuntu Hirsute (minimum installation) with the system `guix` package:
  ```
  $ HOSTS=x86_64-linux-gnu ./contrib/guix/guix-build.sh
  make: Entering directory '/home/hebasto/bitcoin/depends'
  make[1]: Entering directory '/home/hebasto/bitcoin/depends'
  Checksum missing or mismatched for boost source. Forcing re-download.
  Fetching boost_1_71_0.tar.bz2 from https://dl.bintray.com/boostorg/release/1.71.0/source/
  /bin/sh: 1: curl: not found
  Fetching boost_1_71_0.tar.bz2 from https://bitcoincore.org/depends-sources
  /bin/sh: 1: curl: not found
  make[1]: *** [funcs.mk:276: /home/hebasto/bitcoin/depends/sources/download-stamps/.stamp_fetched-boost-boost_1_71_0.tar.bz2.hash] Error 127
  make[1]: Leaving directory '/home/hebasto/bitcoin/depends'
  make: *** [Makefile:281: download-linux] Error 2
  make: Leaving directory '/home/hebasto/bitcoin/depends'
  ```

  This PR fixes that issue.

ACKs for top commit:
  laanwj:
    ACK 97f10621f4
  jonasschnelli:
    utACK 97f10621f4

Tree-SHA512: b9e1ba966782b13e25c85d4a9cfd381bcda190244cb9821ae1a72fd51f82f23ed5e98d9a02384619e3299feb7a34e1da8b9190081a6005221f47f93ae18f3c0b
2021-03-01 12:08:04 +01:00
Wladimir J. van der Laan
362e901a17
Merge #18466: rpc: fix invalid parameter error codes for {sign,verify}message RPCs
a5cfb40e27 doc: release note for changed {sign,verify}message error codes (Sebastian Falbesoner)
9e399b9b2d test: check parameter validity in rpc_signmessage.py (Sebastian Falbesoner)
e62f0c71f1 rpc: fix {sign,message}verify RPC errors for invalid address/signature (Sebastian Falbesoner)

Pull request description:

  RPCs that accept address parameters usually return the intended error code `RPC_INVALID_ADDRESS_OR_KEY` (-5) if a passed address is invalid. The two exceptions to the rule are `signmessage` and `verifymessage`, which return `RPC_TYPE_ERROR` (-3) in this case instead. Oddly enough `verifymessage` returns `RPC_INVALID_ADDRESS_OR_KEY` when the _signature_ was malformed, where `RPC_TYPE_ERROR` would be more approriate.

  This PR fixes these inaccuracies and as well adds tests to `rpc_signmessage.py` that check the parameter validity and error codes for the related RPCs `signmessagewithprivkey`, `signmessage` and `verifymessage`.

  master branch:
  ```
  $ ./bitcoin-cli signmessage invalid_addr message
  error code: -3
  error message:
  Invalid address
  $ ./bitcoin-cli verifymessage invalid_addr dummy_sig message
  error code: -3
  error message:
  Invalid address
  $ ./bitcoin-cli verifymessage 12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX invalid_sig message
  error code: -5
  error message:
  Malformed base64 encoding
  ```
  PR branch:
  ```
  $ ./bitcoin-cli signmessage invalid_addr message
  error code: -5
  error message:
  Invalid address
  $ ./bitcoin-cli verifymessage invalid_addr dummy_sig message
  error code: -5
  error message:
  Invalid address
  $ ./bitcoin-cli verifymessage 12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX invalid_sig message
  error code: -3
  error message:
  Malformed base64 encoding
  ```

ACKs for top commit:
  laanwj:
    Code review ACK a5cfb40e27
  meshcollider:
    utACK a5cfb40e27

Tree-SHA512: bae0c4595a2603cea66090f6033785601837b45fd853052312b3a39d8520566c581994b68f693dd247c22586c638c3b7689c849085cce548cc36b9bf0e119d2d
2021-03-01 11:45:42 +01:00
Hennadii Stepanov
a0a7a4337d
guix, doc: Update default HOSTS value 2021-03-01 10:34:30 +02:00
Hennadii Stepanov
97f10621f4
guix: Add curl to required tool list 2021-03-01 09:53:01 +02:00
fanquake
bd49ac4168
build: fix libnatpmp macos cross compile
Currently, our cross-compile of libnatpmp for macOS doesn't work at all.
The wrong archiver is used, which produces an archive the linker doesn't like.
This becomes clear when configuring:
```bash
configure:25722: checking for initnatpmp in -lnatpmp
configure:25747: env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH -u LIBRARY_PATH /home/ubuntu/bitcoin/depends/x86_64-apple-darwin18/native/bin/clang++ --target=x86_64-apple-darwin18 <trim>  -Wl,-headerpad_max_install_names -Wl,-dead_strip -Wl,-dead_strip_dylibs conftest.cpp -lnatpmp   >&5
ld: archive has no table of contents for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

Fix this by using the right `ar` (we do the same for upnp).

While we're at it, we fixe the build so that we are using our c/ppflags.
This  means building with `-O2` rather than `-Os`.

Note that this fixes an issue that is also fixed by #21209.
However, given there are reservations about updating to use a newer libnatpmp source, we should just fix this for now.
2021-03-01 14:00:36 +08:00
Sebastian Falbesoner
8a8c6383f6 zmq test: fix sync-up by matching notification to generated block
It turned out that the "sync up" procedure of repeatedly generating a
block and waiting for a notification once with timeout is too naive in
its current form, as the following scenario could happen:
    - generate block A
    - receive notification, timeout happens -> repeat procedure
    - generate block B
    - node publishes block A notification
    - receive notification, we receive the one caused by block A
      -> sync-up procedure is completed
    - node publishes block B
    - the actual test starts
    - on the first notification reception, one caused by block B is received,
      rather than the one actually caused by test code, leading to failure

This change ensures that after each test block generation, we wait for
the notification that is actually caused by that block and ignore others
from possibly earlier blocks.

Co-authored-by: Jon Atack <jon@atack.com>
2021-03-01 01:31:41 +01:00
Jon Atack
6242beeb06
Hoist repeated translated strings to RPCConsole struct members
and add missing braces to the touched conditionals.

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2021-02-28 19:14:35 +01:00
Jon Atack
0f035c12fb
RPCConsole::updateDetailWidget: convert strings to translated strings
and in the touched lines:

- replace 2 occurrences of `== ""` with `isEmpty()`

- replace an unneeded `+=` with `=`
2021-02-28 19:13:53 +01:00
fanquake
e52ce9f2b3
Merge #21286: build: Bump minimum Qt version to 5.9.5
faa06ecc9c build: Bump minimum Qt version to 5.9.5 (Hennadii Stepanov)

Pull request description:

  Close #20104.

ACKs for top commit:
  laanwj:
    Code review ACK faa06ecc9c
  jarolrod:
    ACK faa06ecc9c
  fanquake:
    ACK faa06ecc9c - this should be ok to do now.

Tree-SHA512: 7295472b5fd37ffb30f044e88c39d375a5a5187d3f2d44d4e73d0eb0c7fd923cf9949c2ddab6cddd8c5da7e375fff38112b6ea9779da4fecce6f024d05ba9c08
2021-02-28 13:14:04 +08:00
Hennadii Stepanov
c524dc54bb
qt: Fix regression with initial sorting after pr205
QTableView widget must be explicitly sorted after the setModel call.
2021-02-27 17:47:33 +02:00
MarcoFalke
fb67caebe2
Merge #21297: test: feature_blockfilterindex_prune.py improvements
88c4b9b761 test: remove unneeded node from feature_blockfilterindex_prune.py (Jon Atack)
ace3f4cbdf test: improve assertions in feature_blockfilterindex_prune.py (Jon Atack)

Pull request description:

  - improves the assertions
  - removes an unneeded node, reducing from two to one, and some unneeded `extra_arg` code

ACKs for top commit:
  MarcoFalke:
    ACK 88c4b9b761
  brunoerg:
    Tested ACK 88c4b9b761

Tree-SHA512: 295700da3a5f583ee02ae2d184db93cce0e13aba69115d5db07f83e96a66b4b850adaff2c3725b6585799565b9ee654b1fee8a6245eaba8c21e1cb5ce524eb2b
2021-02-27 13:11:58 +01:00
Wladimir J. van der Laan
5ba5becbb5
Merge #21272: guix: Passthrough SDK_PATH into container
13a9fd11a5 guix: Passthrough SDK_PATH into container (Carl Dong)

Pull request description:

  This is a usability improvement for Guix builders so that they don't have to extract the Xcode tarball into `depends/SDKs` every time.

  Inspiration: https://github.com/bitcoin/bitcoin/pull/21089#issuecomment-778639698

ACKs for top commit:
  laanwj:
    Tested ACK 13a9fd11a5

Tree-SHA512: 63392d537e48a0da9f0ee04a929613b139bef1ac5643187871c9ea5376afd2a3d95df0f5e0950ae0eccd2813b166667be98401e5a248ae9c187fe4e84e54d427
2021-02-26 20:26:21 +01:00
Anthony Towns
eeeafb324e net_processing: move AddToCompactExtraTransactions into PeerManagerImpl
Allows making vExtraTxnForCompact and vExtraTxnForCompactIt member vars
instead of globals.
2021-02-27 01:08:09 +10:00
Anthony Towns
f8c0688b94 scripted-diff: Update txorphanage naming convention
-BEGIN VERIFY SCRIPT-
sed -i 's/mapOrphanTransactionsByPrev/m_outpoint_to_orphan_it/g' src/txorphanage.h src/txorphanage.cpp
sed -i 's/mapOrphanTransactions/m_orphans/g' src/txorphanage.h src/txorphanage.cpp src/net_processing.cpp src/test/denialofservice_tests.cpp
sed -i 's/g_orphan_list/m_orphan_list/g' src/txorphanage.h src/txorphanage.cpp
sed -i 's/g_orphans_by_wtxid/m_wtxid_to_orphan_it/g' src/txorphanage.h src/txorphanage.cpp
sed -i 's/nMaxOrphans/max_orphans/g' src/txorphanage.h src/txorphanage.cpp
sed -i 's/COrphanTx/OrphanTx/g' src/txorphanage.h src/txorphanage.cpp src/test/denialofservice_tests.cpp
-END VERIFY SCRIPT-
2021-02-27 01:08:09 +10:00
Anthony Towns
6bd4963c06 txorphanage: Move functions and data into class
Collects all the orphan handling globals into a single member var in
net_processing, and ensures access is encapuslated into the interface
functions. Also adds doxygen comments for methods.
2021-02-27 01:07:55 +10:00
Anthony Towns
03257b832d txorphanage: Extract EraseOrphansForBlock
Extract code that erases orphans when a new block is found into
EraseOrphansForBlock.
2021-02-27 00:31:09 +10:00
Anthony Towns
3c4c3c2fdd net_processing: drop AddOrphanTx
All the interesting functionality of AddOrphanTx is already in other
functions, so call those functions directly in the one place that
AddOrphanTx was used.
2021-02-27 00:30:11 +10:00
Anthony Towns
26d1a6ccd5 denialofservices_tests: check txorphanage's AddTx
Rather than checking net_processing's internal implementation of
AddOrphanTx, test txorphanage's exported AddTx interface. Note that
this means AddToCompactExtraTransactions is no longer tested here.
2021-02-26 23:55:10 +10:00
Anthony Towns
1041616d7e txorphanage: Extract OrphanageAddTx
Extract code from AddOrphanTx into OrphanageAddTx.
2021-02-26 23:55:10 +10:00
Anthony Towns
f294da7274 txorphanage: Extract GetOrphanTx
Extract orphan lookup code into GetOrphanTx function.
2021-02-26 23:55:10 +10:00
Anthony Towns
83679ffc60 txorphanage: Extract HaveOrphanTx
Extract some common code into HaveOrphanTx function.
2021-02-26 23:55:10 +10:00
Anthony Towns
ee135c8d5b txorphanage: Extract AddChildrenToWorkSet
Extract some common code into AddChildrenToWorkSet function.

(It's a hard knock life)
2021-02-26 23:55:10 +10:00
Anthony Towns
38a11c355a txorphanage: Add lock annotations
EraseOrphansFor was called both with and without g_cs_orphans held,
correct that so that it's always called with it already held.

LimitOrphanTxSize was always called with g_cs_orphans held, so
add annotations and don't lock it a second time.
2021-02-26 23:55:10 +10:00
Anthony Towns
81dd57e5b1 txorphanage: Pass uint256 by reference instead of value 2021-02-26 23:55:07 +10:00
Anthony Towns
9d5313df7e move-only: Add txorphanage module
This module captures orphan tracking code for tx relay.

Can be reviewed with --color-moved=dimmed-zebra
2021-02-26 23:55:03 +10:00
Wladimir J. van der Laan
8d37841cdf
Merge #21277: wallet: listdescriptors uses normalized descriptor form
a69c3b35f8 wallet: listdescriptors uses normalized descriptor form (Ivan Metlushko)

Pull request description:

  Rationale: show importable descriptors with `listdescriptors` RPC

  It uses #19136 to derive xpub at the last hardened step.

  **Before**:
  ```
  [
      {
        "desc": "wpkh(tpubD6NzVbkrYhZ4YUQRJL49TWw1VR5v3QKUNYaGGMUfJUm19x5ZqQ2hEiPiYbAQvD2nHoPGQGPg3snLPM8sjmYpvx7XQhkmyfk8xhsUwKbXzyh/84'/1'/0'/0/*)#p4cn3erf",
        "timestamp": 1613982591,
        "active": true,
        "internal": false,
        "range": [
          0,
          999
        ],
        "next": 0
      },
      ...
  ]
  ```

  **After**:
  ```
  [
    {
      "desc": "wpkh([d4ade89c/84'/1'/0']tpubDDUEYcVXy6Vh5meHvcXN3sAr4k3fWwLZGpAHbkAHL8EnkDxp4d99CjNhJHfM2fUJicANvAKnCZS6XaVAgwAeKYc1KesGCN5qbQ25qQHrRxM/0/*)#8wq8rcft",
      "timestamp": 1613982591,
      "active": true,
      "internal": false,
      "range": [
        0,
        999
      ],
      "next": 0
    },
    ...
  ]
  ```

ACKs for top commit:
  achow101:
    ACK a69c3b35f8

Tree-SHA512: 4f92e726cb8245aa0b520729cfd272945f0c66830f0555544e0618883aca516318543fa6ab1862058c64b4e4ed54ad1da953e032f4846eef7454122031c1b005
2021-02-26 10:08:02 +01:00
Jon Atack
88c4b9b761
test: remove unneeded node from feature_blockfilterindex_prune.py 2021-02-25 18:05:59 +01:00
Jon Atack
ace3f4cbdf
test: improve assertions in feature_blockfilterindex_prune.py 2021-02-25 15:10:19 +01:00
MarcoFalke
e49117470b
Merge bitcoin-core/gui#226: Add "Last Block" and "Last Tx" rows to peer details area
70d3c5d0b9 gui: add "Last Block" (CNodeStats::nLastBlockTime) to peer details (Jon Atack)
a21be7c401 gui: add "Last Tx" (CNodeStats::nLastTXTime) to peer details (Jon Atack)
4dc2fd6c37 qt: add RPCConsole::TimeDurationField helper, call systime only once (Jon Atack)

Pull request description:

  - add `RPCConsole::TimeDurationField` helper to replace repeated code and call system time only once in `RPCConsole::updateDetailWidget`
  - add "Last Tx" (`CNodeStats::nLastTXTime`) field to peer details
  - add "Last Block" (`CNodeStats::nLastBlockTime`) field to peer details

ACKs for top commit:
  hebasto:
    re-ACK 70d3c5d0b9

Tree-SHA512: 2611b71fd358ba9ffb6a6206275c08ecb5e683b6f87d022faaaba9802a15030430113afdb434814a9ae2681d04429aa733164bc110b64337ceaae12a0420f4f1
2021-02-25 14:49:47 +01:00
MarcoFalke
c0e44ee8e4
Merge #21254: test: Avoid connecting to real network when running tests
fa730e9157 test: Avoid connecting to real network when running tests (MarcoFalke)
fa1b713941 test: Assume node is running in subtests (MarcoFalke)

Pull request description:

  Introduced in #19884

ACKs for top commit:
  Sjors:
    ACK fa730e9157

Tree-SHA512: fe132a9ffe2fae1ab16857a3dec9839526fdf74d27a1ae794fbffca8356f639c4b916dc888b260281e9cc793916706c18d1687ebb5a076d4e1c481d218d308d3
2021-02-25 14:44:22 +01:00
MarcoFalke
cac10e66d2
Merge #21264: fuzz: Two scripted diff renames
fae216a73d scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext (MarcoFalke)
fa4fbec03e scripted-diff: Rename PROVIDE_MAIN_FUNCTION -> PROVIDE_FUZZ_MAIN_FUNCTION (MarcoFalke)

Pull request description:

  Split out two renames from #21003:

  * `PROVIDE_FUZZ_MAIN_FUNCTION`. *Reason*: This in only used by fuzzing, so the name should indicate that.
  * `MakeNoLogFileContext`. *Reason*: Better reflects what the helper does. Also, prepares it to be used in non-fuzz tests in the future.

ACKs for top commit:
  practicalswift:
    cr ACK fae216a73d: scripted-diff looks correct

Tree-SHA512: e5d347746f5da72b0c86fd4f07ac2e4b3016e88e8c97a830c73bd79d0af6d0245fe7712487fc20344d6cc25958941716c1678124a123930407e3a437265b71df
2021-02-25 14:42:48 +01:00
MarcoFalke
1b1d8bde1c
Merge #21252: test: Add missing wait for sync to feature_blockfilterindex_prune
fa560cc6c4 test: Intermittent issue in feature_blockfilterindex_prune (MarcoFalke)

Pull request description:

  https://cirrus-ci.com/task/4962244553342976?command=ci#L5131

  The index is built in a background thread, so we have to wait for it.

ACKs for top commit:
  jonatack:
    ACK fa560cc6c4

Tree-SHA512: e7a246fe43a28511581fe34b1f5a85303b1874b2535330afc0405269cce7306984ecc6af389791321e3aa4b224819e89d9b89dd5bc080d60baa20bd007412787
2021-02-25 14:32:46 +01:00
Jon Atack
70d3c5d0b9
gui: add "Last Block" (CNodeStats::nLastBlockTime) to peer details 2021-02-25 12:25:07 +01:00
Jon Atack
a21be7c401
gui: add "Last Tx" (CNodeStats::nLastTXTime) to peer details 2021-02-25 11:33:19 +01:00
Jon Atack
4dc2fd6c37
qt: add RPCConsole::TimeDurationField helper, call systime only once 2021-02-25 11:32:51 +01:00
Wladimir J. van der Laan
2059d32edb
Merge #21200: test: Speed up rpc_blockchain.py by removing miniwallet.generate()
faa137eb9e test: Speed up rpc_blockchain.py by removing miniwallet.generate() (MarcoFalke)
fa1fe80c75 test: Change address type from P2PKH to P2WSH in rpc_blockchain (MarcoFalke)
fa4d8f3169 test: Cache 25 mature coins for ADDRESS_BCRT1_P2WSH_OP_TRUE (MarcoFalke)
fad25153f5 test: Remove unused bug workaround (MarcoFalke)
faabce7d07 test: Start only the number of nodes that are needed (MarcoFalke)

Pull request description:

  Speed up various tests:

  * Remove unused nodes, which only consume time on start/stop
  * Remove unused "bug workarounds"
  * Remove the need for `miniwallet.generate()` by adding `miniwallet.scan_blocks()`. (On my system, with valgrind, generating 105 blocks takes 3.31 seconds. Rescanning 5 blocks takes 0.11 seconds.)

ACKs for top commit:
  laanwj:
    Code review ACK faa137eb9e

Tree-SHA512: ead1988d5aaa748ef9f8520af1e0bf812cf1d72e281ad22fbd172b7306d850053040526f8adbcec0b9a971c697a0ee7ee8962684644d65b791663eedd505a025
2021-02-25 10:13:39 +01:00
MarcoFalke
8ca6bd0dac
Merge bitcoin-core/gui#223: qt: Re-add and rename transaction "Edit Label" action
5440c07457 qt: Rename "Edit label" to "Edit address label" (Wladimir J. van der Laan)
22664d6287 Revert "qt: Remove Transactionview Edit Label Action" (Wladimir J. van der Laan)

Pull request description:

  This reverts PR #211.

  I disagree with this change, I use the functionality a lot, it was the primary way I used to organize and edit transactions labels and am sad to see this go.

  > you can edit a sending address in the send tab Address Book

  Using the address book should not be encouraged at all! A while ago it was even proposed to remove it. There's rarely need to scroll through all historical addresses used and unused. The transaction list does just fine for this.

  > While all other actions apply directly to the selected transaction, the Edit Label action applies to the selected transaction's address.

  **In practice** when bitcoin is used in the commonly advised way, generate a new address for each transaction, those are equivalent though.

  I doubt I (and **luke-jr**) will be the only users that will stumblle on this. Further discussion here: https://github.com/bitcoin-core/gui/pull/211#issuecomment-784755998

ACKs for top commit:
  hebasto:
    ACK 5440c07457, verified that 22664d6287 is a clean revert of 8f9644890a.

Tree-SHA512: 3a86a730279bc454d0bd25d874dbfb6b1c0492480e66c3164e7c60d8658d622d4522de11bf8564876dc3ee056b53db71ecbe8a37281bf25d41a27e6e0d72ad8f
2021-02-25 09:09:34 +01:00
MarcoFalke
09bc7bfed1
Merge bitcoin-core/gui#214: qt: Disable requests context menu actions when appropriate
bb3da8fe41 qt: Disable requests context menu actions when appropriate (Jarol Rodriguez)

Pull request description:

  The recent requests table will allow you to copy data points even if they do not exist. This PR implements checks to disable the `copy label`, `copy message`, and `copy amount` context menu actions if the respective fields are empty. This brings the recent requests table context menu behavior closer to the behavior seen in the transaction view.

  On a payment request entry which does not have a value for label, message, or amount:
  | Master        | PR               |
  | ----------- | ----------- |
  |<img width="169" alt="Screen Shot 2021-02-19 at 1 22 28 AM" src="https://user-images.githubusercontent.com/23396902/108466086-167adc00-7251-11eb-8bd6-13984042bdb3.png">| <img width="169" alt="Screen Shot 2021-02-19 at 1 21 49 AM" src="https://user-images.githubusercontent.com/23396902/108466185-3e6a3f80-7251-11eb-9dd8-492ed07fd638.png">|

  `copy URI` never needs to be disabled as an entry in the recent requests table must have a URI even if it doesn't have a label, message, or amount. #213 will add a `copy address` context menu action. This also does not need a check as an entry must be associated with an address.

  Below are some more examples of how this PR will behave:
  **Has Label, Message, and Amount**
  <img width="780" alt="Screen Shot 2021-02-19 at 12 05 38 AM" src="https://user-images.githubusercontent.com/23396902/108466507-c18b9580-7251-11eb-8875-f3aeb9c4c8e9.png">

  **Has Label and Amount, but no Message**
  <img width="780" alt="Screen Shot 2021-02-19 at 12 05 58 AM" src="https://user-images.githubusercontent.com/23396902/108466421-9b65f580-7251-11eb-97eb-a3bfaa21fa7d.png">

ACKs for top commit:
  hebasto:
    re-ACK bb3da8fe41

Tree-SHA512: d98f1a6e05ebf6d9d056bc5754aca78ca7ecda93f497dba88187b947ca4a261eb7dc5e8c872956315acaa0008cc39320fb5806e17117e0c873090ad917ca4a3d
2021-02-25 09:02:44 +01:00