Skip to content

wallet/rpc: follow-up clean-up/fixes to avoid_reuse#16239

Merged
meshcollider merged 3 commits intobitcoin:masterfrom
kallewoof:2019-06-followup-avoidreuse
Jun 22, 2019
Merged

wallet/rpc: follow-up clean-up/fixes to avoid_reuse#16239
meshcollider merged 3 commits intobitcoin:masterfrom
kallewoof:2019-06-followup-avoidreuse

Conversation

@kallewoof
Copy link
Contributor

@kallewoof kallewoof commented Jun 19, 2019

This addresses a few remaining issues pointed out in #13756:

Ping jnewbery and achow101 as they pointed out these issues.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jun 19, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #16240 (JSONRPCRequest-aware RPCHelpMan by kallewoof)
  • #11413 ([wallet] [rpc] sendtoaddress/sendmany: Add explicit feerate option by kallewoof)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

@kallewoof kallewoof force-pushed the 2019-06-followup-avoidreuse branch from 5e704ab to c8568bb Compare June 19, 2019 14:26
@kallewoof
Copy link
Contributor Author

@promag Thanks a lot for review! I addressed everything you noted.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the 2nd round, just 2 nits.

@kallewoof kallewoof force-pushed the 2019-06-followup-avoidreuse branch from c8568bb to e6564cb Compare June 19, 2019 15:45
@kallewoof
Copy link
Contributor Author

@promag Thanks for thoroughness, it is very appreciated. Addressed all.

@maflcko
Copy link
Member

maflcko commented Jun 19, 2019

I left some review in the other pull, which could be addressed here?

@kallewoof
Copy link
Contributor Author

Addressed @MarcoFalke comments in #13756. Thanks for feedback!

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, but what about #13756 (comment)

@kallewoof kallewoof force-pushed the 2019-06-followup-avoidreuse branch from 5ff6aaa to b59d4c7 Compare June 19, 2019 16:54
@kallewoof
Copy link
Contributor Author

@MarcoFalke Thanks, I missed that one. I believe I got all of them this time. Also updated release notes based on your suggestions.

@maflcko
Copy link
Member

maflcko commented Jun 19, 2019

ACK b59d4c7da1b886a0834211e70850127faf3e121e (scrolled through the diff on GitHub)

@kallewoof kallewoof force-pushed the 2019-06-followup-avoidreuse branch from b59d4c7 to 7f39c40 Compare June 21, 2019 02:17
@kallewoof
Copy link
Contributor Author

@jnewbery thanks! Trimmed tests as suggested.

@meshcollider
Copy link
Contributor

Code looks good, code review ACK 7f39c40

I'm just slightly unsure about the word "used" in the getbalance RPC, could seem like the balance which has been used (spent) rather than the balance which is "dirty" or "reused" or something

@kallewoof
Copy link
Contributor Author

I initially used the word "dirty", but then realized that is internally used for something else in the wallet, and there was a comment about "dirty" being confusing in #13756 (comment)

I think "dirty" is a confusing concept. Maybe add an exclamation mark (or a detective icon) next to the transaction and when the user clicks on that, say something like "This address has been used before, for privacy reasons it's better to create a new address each time you wish to receive coins, even from the same person".

(in reference to a GUI comment).

I'm open for changing it, but I'm not sure what would be a good name for it.

@jnewbery
Copy link
Contributor

I'm open for changing it, but I'm not sure what would be a good name for it.

How about "used address balance" or "reused address balance"? Bit of a mouthful, but at least it's explicit.

Copy link
Member

@achow101 achow101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 7f39c40a332824043e3bef282580daf748131bb4 Read through the diff, looks good.

@kallewoof
Copy link
Contributor Author

kallewoof commented Jun 21, 2019

@jnewbery A bit long, maybe.. I mean, if we change it I would ideally like to change it everywhere, including the "avoid_reuse" flags in RPC commands and such.

Even "used"/"reused" does not accurately describe what this is referring to, as evident by the fact I as the author screwed it up (thankfully @jnewbery caught that one).

"UTXO/balance that was sent to an address after it was spent from"

Copy link
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 7f39c40a332824043e3bef282580daf748131bb4 (reviewed code and ran tests locally)

I've left a couple of style nits inline. Feel free to take or leave.

Always show the same help topic regardless of wallet flags, and explain that something is not always available, rather than runtime-modifying the help output.
@kallewoof kallewoof force-pushed the 2019-06-followup-avoidreuse branch from 7f39c40 to 71d0344 Compare June 21, 2019 17:46
@jnewbery
Copy link
Contributor

ACK 71d0344

Thanks for quick turnaround!

@meshcollider
Copy link
Contributor

re-utACK 71d0344

@meshcollider meshcollider merged commit 71d0344 into bitcoin:master Jun 22, 2019
meshcollider added a commit that referenced this pull request Jun 22, 2019
71d0344 docs: release note wording (Karl-Johan Alm)
3d2ff37 wallet/rpc: use static help text (Karl-Johan Alm)
53c3c1e wallet/rpc/getbalances: add entry for 'mine.used' balance in results (Karl-Johan Alm)

Pull request description:

  This addresses a few remaining issues pointed out in #13756:

  * First commit addresses #13756 (comment)
  * Second commit addresses #13756 (comment)

  Ping jnewbery and achow101 as they pointed out these issues.

ACKs for commit 71d034:
  jnewbery:
    ACK 71d0344
  meshcollider:
    re-utACK 71d0344

Tree-SHA512: 5e28822af0574ad07dbbed21aa2fe7866bf5770b4c0a1c150ad0da8af3152bcfb7170330a7497fa500326c594740ecf63733cf58325821e2811d7b911d5783a0
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 22, 2019
71d0344 docs: release note wording (Karl-Johan Alm)
3d2ff37 wallet/rpc: use static help text (Karl-Johan Alm)
53c3c1e wallet/rpc/getbalances: add entry for 'mine.used' balance in results (Karl-Johan Alm)

Pull request description:

  This addresses a few remaining issues pointed out in bitcoin#13756:

  * First commit addresses bitcoin#13756 (comment)
  * Second commit addresses bitcoin#13756 (comment)

  Ping jnewbery and achow101 as they pointed out these issues.

ACKs for commit 71d034:
  jnewbery:
    ACK 71d0344
  meshcollider:
    re-utACK bitcoin@71d0344

Tree-SHA512: 5e28822af0574ad07dbbed21aa2fe7866bf5770b4c0a1c150ad0da8af3152bcfb7170330a7497fa500326c594740ecf63733cf58325821e2811d7b911d5783a0
@kallewoof kallewoof deleted the 2019-06-followup-avoidreuse branch June 24, 2019 04:38
fanquake added a commit that referenced this pull request Jun 26, 2019
d8bd97d Fix GCC 7.4.0 warning (Hennadii Stepanov)

Pull request description:

  Having #13756 and #16239 merged cause GCC warning:
  ```
  $ gcc --version
  gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
  ...
  $ make -j 4 > /dev/null
  wallet/wallet.cpp: In member function ‘CWallet::Balance CWallet::GetBalance(int, bool) const’:
  wallet/wallet.cpp:2269:45: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
       isminefilter reuse_filter = avoid_reuse ? 0 : ISMINE_USED;
                                   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
  ```

  Fixed with this PR.

ACKs for top commit:
  practicalswift:
    utACK d8bd97d
  promag:
    ACK d8bd97d.
  kallewoof:
    utACK d8bd97d
  meshcollider:
    Trivial utACK d8bd97d

Tree-SHA512: 2fb315ac82f290c8b9f4e48d1b4526b9babe0717c68593c7bc55cd6c289e64b6322aba72984f39291a9254b57d3f6ba8dbfe03799f510c0c1dc108b21b286732
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 10, 2020
…lance in results

Summary:
bitcoin/bitcoin@53c3c1e

---

Partial backport of Core [[bitcoin/bitcoin#16239 | PR16239]]

Test Plan:
  ninja
  ./src/bitcoind -regtest -daemon
  ./src/bitcoin-cli -regtest getbalances help

check that it looks right

  test_runner.py wallet_avoidreuse

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D6482
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 10, 2020
Summary:
Always show the same help topic regardless of wallet flags, and explain that something is not always available, rather than runtime-modifying the help output.

bitcoin/bitcoin@3d2ff37

---

Partial backport of Core [[bitcoin/bitcoin#16239 | PR16239]]

Test Plan:
  ninja
  ./src/bitcoind -regtest -daemon
  ./src/bitcoin-cli -regtest help sendtoaddress
  ./src/bitcoin-cli -regtest help getbalance
  ./src/bitcoin-cli -regtest help listunspent

check help output looks spiffy

  test_runner.py wallet_avoidreuse

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D6486
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 10, 2020
Summary:
bitcoin/bitcoin@3d2ff37

---

Concludes backport of Core [[bitcoin/bitcoin#16239 | PR16239]]

Test Plan: none

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Subscribers: jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D6487
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants