mjdietzx
commented at 8:50 PM on November 13, 2021:
contributor
Now functions return a UniValue instead of mutating a parameter that's passed by reference.
After this PR, any time a UniValue is passed by reference, it should be const. This is the case everywhere in the codebase now (please double check me on this) except for SoftForkDescPushBack (which I didn't want to touch), and the RPC request handling logic.
Motivation for this PR was based on a suggestion in #22924 review:
I wonder why we don't return the UniValue (or optional<UniValue> in case it can fail) instead of having it as second parameter. It would seem better API design to me.
I figured it's simple enough, why not do this across the entire codebase. Hopefully I didn't get carried away
#17783 (util: Fix -norpcwhitelist, -norpcallowip, and similar corner case behavior by ryanofsky)
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.
mjdietzx renamed this: Refactor: Improve API design of `ScriptToUniv`, `TxToUniv` Refactor: Improve API design of `ScriptToUniv`, `TxToUniv` etc to return the `UniValue` instead of mutating the parameter/reference on Nov 14, 2021
mjdietzx renamed this: Refactor: Improve API design of `ScriptToUniv`, `TxToUniv` etc to return the `UniValue` instead of mutating the parameter/reference Refactor: Improve API design of `ScriptToUniv`, `TxToUniv` etc to return the `UniValue` instead of mutating a parameter/reference on Nov 14, 2021
Agree that this makes code much simpler. Never was a fan of argument modification. 😅
Tested that all tests are passing. No unexpected behavior change.
fanquake
commented at 11:37 AM on March 22, 2022:
member
I'm going to close this for now. Let's re-open / followup once we figure out the status of, and potentially merge #22924. (I'm doing a rebase at the moment).
fanquake closed this on Mar 22, 2022
mjdietzx
commented at 3:09 PM on March 25, 2022:
contributor
Sounds good, I'll start my review of #24673 today, and will rebase this on top of that PR if it makes sense - then we can see where this PR goes from there
fanquake
commented at 7:07 AM on March 31, 2022:
member
mjdietzx
commented at 8:12 PM on April 2, 2022:
contributor
I've rebased this PR, but I have not force pushed yet. IIRC I need to make sure I re-open the PR before force pushing. But, I can't figure out how to re-open (I think it may be due to "This pull request is closed, but the mjdietzx:ret_UniValue_instead_of_pass_by_ref branch has unmerged commits.")
Can anyone advise on how I should move forward? Should I create a new branch and just reference this PR (leave it closed)?
fanquake reopened this on Apr 3, 2022
fanquake
commented at 7:46 AM on April 3, 2022:
member
@mjdietzx you should be able to force push to the branch now.
mjdietzx force-pushed on Apr 3, 2022
DrahtBot removed the label Needs rebase on Apr 3, 2022
mjdietzx force-pushed on Apr 3, 2022
mjdietzx force-pushed on Apr 3, 2022
DrahtBot added the label Needs rebase on Apr 4, 2022
mjdietzx force-pushed on Apr 4, 2022
DrahtBot removed the label Needs rebase on Apr 4, 2022
I am also going to do a thorough re-review since I did this a while ago. Also I dropped fcffbdefd2d5f5ec9bba59f55f5b1db6e9a9965c for now, I need to take some time to go through @MarcoFalke's #25464 before I rebase this commit.
DrahtBot removed the label Needs rebase on Oct 3, 2022
DrahtBot added the label Needs rebase on Dec 8, 2022
DrahtBot
commented at 9:55 AM on December 8, 2022:
contributor
<!--cf906140f33d8803c4a75a2196329ecb-->
🐙 This pull request conflicts with the target branch and needs rebase.
DrahtBot
commented at 12:24 AM on March 8, 2023:
contributor
<!--13523179cfe9479db18ec6c5d236f789-->
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
Is it no longer relevant? ➡️ Please close.
Did the author lose interest or time to work on this? ➡️ Please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future.
achow101 closed this on Apr 25, 2023
in
src/test/fuzz/transaction.cpp:104
in
df41d46249
Oh man I'm curious how you ended up back in this PR!? Is that just from your memory?
Anyways lmk if you want me to do anything. I'd be happy to rebase this, open a PR with just this commit, etc.. whatever you suggest. Also feel free to just cherry-pick that commit or whatever is most efficient for you as well incase you are just commenting this for documentation purposes
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:53 UTC