Remove CWalletTx::fFromMe member. #9351

pull ryanofsky wants to merge 2 commits into bitcoin:master from ryanofsky:pr/atw-fromme changing 2 files +2 −11
  1. ryanofsky commented at 9:33 pm on December 14, 2016: member

    Prior to this commit, the fFromMe member was written to and serialized but not actually used in any meaningful way.

    The one place where the fFromMe was used in a nontrivial way was CWallet::AddToWallet, but the only actual effect it had there was to trigger additional CWalletDB::WriteTx calls that would change serialized fFromMe fields in previously existing database rows from false to true (without changing other fields).

  2. ryanofsky force-pushed on Dec 14, 2016
  3. fanquake added the label Wallet on Dec 15, 2016
  4. jonasschnelli commented at 8:13 am on December 15, 2016: contributor
    I agree that this is dead code and should probably be removed. The only reason I could think of why to keep this is to have a flag to later determine which transactions in the wallet where created by the own wallet over CreateTransaction(). Although not sure how useful this would be.
  5. laanwj commented at 4:49 pm on December 15, 2016: member
    Yes, is there any value in keeping/generating this information? I guess we do a more thorough job by just looking at the inputs/outputs of a transaction. Thisl also catches transactions generated and broadcasted through the raw transactions API.
  6. Add documentation for CWalletTx::fFromMe member. 39c77b00e3
  7. Remove CWalletTx::fFromMe member.
    Prior to this commit, the fFromMe member was written to and serialized but not
    actually used in any meaningful way.
    
    The one place where the fFromMe was used in a nontrivial way was
    CWallet::AddToWallet, but the only actual effect it had there was to trigger
    additional CWalletDB::WriteTx calls that would change serialized fFromMe fields
    in previously existing database rows from false to true (without changing other
    fields).
    37041784cf
  8. ryanofsky force-pushed on Dec 15, 2016
  9. ryanofsky renamed this:
    Remove CWalletTx::fFromMe member.
    Add documentation for CWalletTx::fFromMe member.
    on Dec 15, 2016
  10. ryanofsky commented at 8:37 pm on December 15, 2016: member

    @jonasschnelli’s comment helped me understand the purpose of the fFromMe field, and now I kind of think it’s worth keeping, especially since getting rid of it doesn’t simplify things much.

    I changed my commit for now to just document the fFromMe field instead of getting rid of it.

  11. MarcoFalke added the label Docs and Output on Dec 15, 2016
  12. pstratem commented at 1:28 pm on December 16, 2016: contributor

    @ryanofsky This was made dead by changes to the trickle logic

    originally the use was for this one line

                           if (wtx.fFromMe)
                               fTrickleWait = true;
    

    I dont see any reason not to remove it.

  13. ryanofsky renamed this:
    Add documentation for CWalletTx::fFromMe member.
    Remove CWalletTx::fFromMe member.
    on Dec 16, 2016
  14. ryanofsky commented at 3:46 pm on December 16, 2016: member

    Ok @pstratem, removed fFromMe again. I don’t have any opinion on whether it should be kept or removed. I just think it should be documented as in commit https://github.com/bitcoin/bitcoin/pull/9351/commits/39c77b00e3d61dfea1f45be5d3b77e5adea7b91a if it is not removed.

    Reasons I could imagine why someone might not want to remove it is that it provides a nice little clue about the origin of a transaction that could be useful for debugging, or to show as information in the UI. Also, removing the variable doesn’t simplify the code very much. Another reason to keep it might be that having it could make it easier to remove the fTimeReceivedIsTxTime variable which I think is actually a stranger thing to serialize. It has similar meaning to fFromMe, but unlike fFromMe is not merged properly in AddToWallet.

  15. laanwj added the label Brainstorming on Dec 19, 2016
  16. laanwj commented at 8:11 am on December 19, 2016: member
    I tend to agree there’s no reason to make a quick decision on this one. No need to remove this for 0.14. Adding the brainstorming label.
  17. ryanofsky commented at 4:21 pm on December 19, 2016: member
    I think I will close this PR, but feel free to reopen if it you want to keep it around. I created a separate PR #9378 with just the documentation commit.
  18. ryanofsky closed this on Dec 19, 2016

  19. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

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: 2025-07-04 12:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me