Should this code run even if tx is not new and not update? #15781

issue mxaddict opened this issue on April 10, 2019
  1. mxaddict commented at 9:19 AM on April 10, 2019: contributor

    https://github.com/bitcoin/bitcoin/blob/a7b486d6f8df868ff5b93b7152e4f7ce810fca78/src/wallet/wallet.cpp#L977-L995

    Shouldn't this be more like this:

        // Need to write to disk?
        if (!fInsertedNew && !fUpdated)
            return false;
        // Write to disk
        if (!walletdb.WriteTx(wtx))
            return false;
    
  2. promag commented at 7:34 PM on June 2, 2019: member

    No, currently NotifyTransactionChanged and -walletnotify are called if !fInsertedNew && !fUpdated.

  3. mxaddict commented at 6:19 PM on June 6, 2019: contributor

    No, currently NotifyTransactionChanged and -walletnotify are called if !fInsertedNew && !fUpdated.

    May I know what the rationale for running notify would be if it's not a new and not an updated tx?

  4. promag commented at 6:26 PM on June 6, 2019: member

    I can think of one or two, but more importantly is that it would be a breaking change. It would be better to have an option to do what you want, for instance #16050.

  5. mxaddict commented at 6:59 PM on June 6, 2019: contributor

    I see, which particular feature would be broken? I'm guessing there is/are parts of the wallet that expect a call from notify?

    On Fri, Jun 7, 2019, 02:29 João Barbosa notifications@github.com wrote:

    I can think of one or two, but more importantly is that it would be a breaking change. It would be better to have an option to do what you want, for instance #16050 https://github.com/bitcoin/bitcoin/pull/16050.

    — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/issues/15781?email_source=notifications&email_token=AAIDAKN7WFBVS3V25C6RF2TPZFJR7A5CNFSM4HE2BVH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXDXSMY#issuecomment-499611955, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIDAKLAYNS43KC2KIOWRKTPZFJR7ANCNFSM4HE2BVHQ .

  6. promag commented at 7:29 PM on June 6, 2019: member

    I mean it could break existing systems, not the wallet itself.

  7. MarcoFalke added the label Feature on Apr 28, 2020
  8. MarcoFalke commented at 12:44 PM on April 28, 2020: member

    The feature request didn't seem to attract much attention in the past. Also, the issue seems not important enough right now to keep it sitting around idle in the list of open issues.

    Closing due to lack of interest. Pull requests with improvements are always welcome.

  9. MarcoFalke closed this on Apr 28, 2020

  10. DrahtBot locked this on Feb 15, 2022
Labels

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: 2026-04-21 21:14 UTC

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