wallet: Replace confusing getAdjustedTime() with GetTime()#23644
Merged
maflcko merged 1 commit intobitcoin:masterfrom Dec 7, 2021
Merged
wallet: Replace confusing getAdjustedTime() with GetTime()#23644maflcko merged 1 commit intobitcoin:masterfrom
maflcko merged 1 commit intobitcoin:masterfrom
Conversation
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
Contributor
|
Concept ACK |
Merged
Contributor
|
Concept ACK |
instagibbs
approved these changes
Dec 7, 2021
Member
instagibbs
left a comment
There was a problem hiding this comment.
Just noting that IIUC unconfirmed transactions' time field will also be changed by this, as it returns the wtx.nTimeReceived value in ComputeTimeSmart. Seems better to trust local clock for local data.
ACK
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Dec 7, 2021
… GetTime() fa37e79 wallet: Replace confusing getAdjustedTime() with GetTime() (MarcoFalke) Pull request description: Setting `nTimeReceived` to the adjusted time has several issues: * `m_best_block_time` is set to the "unadjusted" time, thus a comparison of the two times is like comparing apples to oranges. In the worst case this opens up an attack vector where remote peers can force a premature re-broadcast of wallet txs. * The RPC documentation for `"timereceived"` doesn't mention that the network adjusted time is used, possibly confusing users when the time reported by RPC is off by a few seconds compared to their local timestamp. Fix all issues by replacing the call with `GetTime()`. Also a style fix: Use non-narrowing integer conversion in the RPC method. ACKs for top commit: theStack: Code-review ACK fa37e79 shaavan: crACK fa37e79 Tree-SHA512: 8d020ba400521246b7aed4b6c41319fc70552e8c69e929a5994500375466a9edac02a0ae64b803dbc6695df22276489561a23bd6e030c44c97d288f7b9b2b3fa
Member
|
Should [part of] this be backported? |
Member
Author
|
Yes, it can be backported, but doesn't have to. |
luke-jr
pushed a commit
to bitcoinknots/bitcoin
that referenced
this pull request
Dec 14, 2021
Github-Pull: bitcoin#23644 Partially-Rebased-From: fa37e79
RandyMcMillan
pushed a commit
to RandyMcMillan/mempool-tab
that referenced
this pull request
Dec 23, 2021
…e() with GetTime() 7950a7c wallet: Replace confusing getAdjustedTime() with GetTime() (MarcoFalke) Pull request description: Setting `nTimeReceived` to the adjusted time has several issues: * `m_best_block_time` is set to the "unadjusted" time, thus a comparison of the two times is like comparing apples to oranges. In the worst case this opens up an attack vector where remote peers can force a premature re-broadcast of wallet txs. * The RPC documentation for `"timereceived"` doesn't mention that the network adjusted time is used, possibly confusing users when the time reported by RPC is off by a few seconds compared to their local timestamp. Fix all issues by replacing the call with `GetTime()`. Also a style fix: Use non-narrowing integer conversion in the RPC method. ACKs for top commit: theStack: Code-review ACK 7950a7c shaavan: crACK 7950a7c Tree-SHA512: 8d020ba400521246b7aed4b6c41319fc70552e8c69e929a5994500375466a9edac02a0ae64b803dbc6695df22276489561a23bd6e030c44c97d288f7b9b2b3fa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setting
nTimeReceivedto the adjusted time has several issues:m_best_block_timeis set to the "unadjusted" time, thus a comparison of the two times is like comparing apples to oranges. In the worst case this opens up an attack vector where remote peers can force a premature re-broadcast of wallet txs."timereceived"doesn't mention that the network adjusted time is used, possibly confusing users when the time reported by RPC is off by a few seconds compared to their local timestamp.Fix all issues by replacing the call with
GetTime(). Also a style fix: Use non-narrowing integer conversion in the RPC method.