Skip to content

Conversation

brakmic
Copy link
Contributor

@brakmic brakmic commented Apr 11, 2020

This PR replaces raw pointers in rpcwallet.cpp and rpcdump.cpp with shared_ptr. The motivation for this PR is described here #18590

The currently available unit and functional tests complete without errors.

It seems that this PR is indirectly related to this issue: #13063 (comment)

Notice: I have deliberately not changed the class WalletRescanReserver whose constructor expects a raw pointer, because it's external and affects other areas, which I didn't touch to avoid making this PR "viral".

Fixes #18590

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.

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 11, 2020

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

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
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.

Looks like you forgot some. Maybe this could be split up into two commits? No strong opinion though.

@brakmic
Copy link
Contributor Author

brakmic commented Apr 11, 2020

Looks like you forgot some. Maybe this could be split up into two commits? No strong opinion though.

Oops, you're right. Thanks. Still some unneeded shared pointers. Will replace them, no problem.

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.

I am still seeing two pointers, otherwise ACK

@brakmic
Copy link
Contributor Author

brakmic commented Apr 11, 2020

I am still seeing two pointers, otherwise ACK

Two pointers?

But I already changed: ListTransactions , DescribeWalletAddress and FundTransaction.
Or did you mean the latest change with EnsureWalletIsUnlocked ?

--EDIT: Nevermind, yes, it was about EnsureWalletIsUnlocked.

@promag
Copy link
Contributor

promag commented Apr 11, 2020

Code review ACK e681778.

@maflcko
Copy link
Member

maflcko commented Apr 12, 2020

ACK e681778

@practicalswift
Copy link
Contributor

Concept ACK

@Sjors
Copy link
Member

Sjors commented Apr 15, 2020

@achow101 does this significantly get in the way of #15764?

@achow101
Copy link
Member

@achow101 does this significantly get in the way of #15764?

No

    Co-authored-by: MarcoFalke <falke.marco@gmail.com>
    Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

Code review ACK c13d3c3. Looks perfect!

@ryanofsky
Copy link
Contributor

Travis error sync_mempools timeout in feature_fee_estimation.py in https://travis-ci.org/github/bitcoin/bitcoin/jobs/683889542#L3121 is presumably unrelated

@brakmic brakmic closed this May 10, 2020
@ryanofsky
Copy link
Contributor

closed this 3 days ago

Believe this was just a rageclose (exciting!) and someone else could pick this up

maflcko pushed a commit that referenced this pull request Mar 10, 2021
…rebased)

7c90c67 rpc: refactor rpc wallet functions to take references instead of pointers (fanquake)
4866934 rpc: remove calls to CWallet.get() (fanquake)

Pull request description:

  This is a rebased #18592.

  > This PR replaces raw pointers in `rpcwallet.cpp` and `rpcdump.cpp` with **shared_ptr**. The motivation for this PR is described here #18590

  > It seems that this PR is indirectly related to this issue: #13063 (comment)

  > Notice: I have deliberately **not** changed the class `WalletRescanReserver ` whose constructor expects a raw pointer, because it's external and affects other areas, which I didn't touch to avoid making this PR "viral".

  > Fixes #18590

ACKs for top commit:
  MarcoFalke:
    ACK 7c90c67 🐧
  ryanofsky:
    Code review ACK 7c90c67. Changes easy to review with `--word-diff-regex=. -U0`

Tree-SHA512: 32d69c813026b02260e8a89de9d6a5ab9e87826ba230687246583ac7a80c8c3fd00318da4658f1450e04c23d2c77ae765862de0d2a110b1312b3b69a1161e7ba
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Mar 10, 2021
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
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.

rpc: raw pointers should be replaced with shared_ptr
10 participants