Skip to content

cleanup: 4492 followup - #4521

Merged
UdjinM6 merged 1 commit into
dashpay:developfrom
UdjinM6:4492_followup
Oct 13, 2021
Merged

UdjinM6 merged 1 commit into
dashpay:developfrom
UdjinM6:4492_followup

Conversation

@UdjinM6

@UdjinM6 UdjinM6 commented Oct 13, 2021

Copy link
Copy Markdown

tl;dr:

  • block hashes and request ids are hex strings,
  • some optional params were not marked as such and vice versa,
  • missed few commands which should be args,
  • duplicated help text.

@UdjinM6 UdjinM6 added this to the 18 milestone Oct 13, 2021

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

utACK for squash merge

@UdjinM6
UdjinM6 merged commit 87818b2 into dashpay:develop Oct 13, 2021
pravblockc pushed a commit to pravblockc/dash that referenced this pull request Nov 18, 2021
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Dec 18, 2021
… Adjusted Time

0c85dc3 p2p: Don't use timestamps from inbound peers (Martin Zumsande)

Pull request description:

  `GetAdjustedTime()` (used e.g. in validation and addrman) returns a time with an offset that is influenced by timestamps that our peers have sent us in their version message.

  Currently, timestamps from all peers are used for this.
  However, I think that it would make sense to ignore the timedata samples from inbound peers, making it much harder for others to influence the Adjusted Time in a targeted way.
  With the extra feeler connections (every 2 minutes on average) and extra block-relay-only connections (every 5 minutes on average) there are also now plenty of opportunities to gather a meaningful number of timedata samples from outbound peers.

  There are some measures in place to prevent abuse: the `-maxtimeadjustment` parameter with a default of 70 minutes, warnings in cases of large deviations, only using the first 200 samples ([explanation](https://github.com/bitcoin/bitcoin/blob/383d350bd5107bfe00e3b90a00cab9a3c1397c72/src/timedata.cpp#L57-L72)), but I think that only using samples from outbound connections in the first place would be an additional safety measure that would make sense.

  See also issue dashpay#4521 for further context and links: There have been several discussions in the past about replacing or abolishing the existing timedata system.

ACKs for top commit:
  jnewbery:
    Concept and code review ACK 0c85dc3
  naumenkogs:
    ACK 0c85dc3
  vasild:
    ACK 0c85dc3

Tree-SHA512: 2d6375305bcae034d68b58b7a07777b40ac430dfed554c88e681a048c527536691e1b7d08c0ef995247d356f8e81aa0a4b983bf2674faf6a416264e5f1af0a96
gades pushed a commit to cosanta/cosanta-core that referenced this pull request Jun 17, 2023
gades pushed a commit to piratecash/pirate that referenced this pull request Dec 9, 2023
knst pushed a commit to knst/dash that referenced this pull request Jul 13, 2024
c6be144 Remove timedata (stickies-v)
92e72b5 [net processing] Move IgnoresIncomingTxs to PeerManagerInfo (dergoegge)
7d9c3ec [net processing] Introduce PeerManagerInfo (dergoegge)
ee178df Add TimeOffsets helper class (stickies-v)
55361a1 [net processing] Use std::chrono for type-safe time offsets (stickies-v)
038fd97 [net processing] Move nTimeOffset to net_processing (dergoegge)

Pull request description:

  [An earlier approach](https://github.com/bitcoin/bitcoin/commits/1d226ae1f984c5c808f5c24c431b959cdefa692e/) in bitcoin#28956 involved simplifying and refactoring the network-adjusted time calculation logic, but this was eventually [left out](bitcoin#28956 (comment)) of the PR to make it easier for reviewers to focus on consensus logic changes.

  Since network-adjusted time is now only used for warning/informational purposes, cleaning up the logic (building on @dergoegge's approach in bitcoin#28956) should be quite straightforward and uncontroversial. The main changes are:

  - Previously, we would only calculate the time offset from the first 199 outbound peers that we connected to. This limitation is now removed, and we have a proper rolling calculation. I've reduced the set to 50 outbound peers, which seems plenty.
  - Previously, we would automatically use the network-adjusted time if the difference was < 70 mins, and warn the user if the difference was larger than that. Since there is no longer any automated time adjustment, I've changed the warning threshold to ~~20~~ 10 minutes (which is an arbitrary number).
  - Previously, a warning would only be raised once, and then never again until node restart. This behaviour is now updated to  1) warn to log for every new outbound peer for as long as we appear out of sync, 2) have the RPC warning toggled on/off whenever we go in/out of sync, and 3) have the GUI warn whenever we are out of sync (again), but limited to 1 messagebox per 60 minutes
  - no more globals
  - remove the `-maxtimeadjustment` startup arg

  Closes dashpay#4521

ACKs for top commit:
  sr-gi:
    Re-ACK [c6be144](bitcoin@c6be144)
  achow101:
    reACK c6be144
  dergoegge:
    utACK c6be144

Tree-SHA512: 1063d639542e882186cdcea67d225ad1f97847f44253621a8c4b36c4d777e8f5cb0efe86bc279f01e819d33056ae4364c3300cc7400c087fb16c3f39b3e16b96
vijaydasmp added a commit to vijaydasmp/dash that referenced this pull request Nov 27, 2024
… Adjusted Time

0c85dc3 p2p: Don't use timestamps from inbound peers (Martin Zumsande)

Pull request description:

  `GetAdjustedTime()` (used e.g. in validation and addrman) returns a time with an offset that is influenced by timestamps that our peers have sent us in their version message.

  Currently, timestamps from all peers are used for this.
  However, I think that it would make sense to ignore the timedata samples from inbound peers, making it much harder for others to influence the Adjusted Time in a targeted way.
  With the extra feeler connections (every 2 minutes on average) and extra block-relay-only connections (every 5 minutes on average) there are also now plenty of opportunities to gather a meaningful number of timedata samples from outbound peers.

  There are some measures in place to prevent abuse: the `-maxtimeadjustment` parameter with a default of 70 minutes, warnings in cases of large deviations, only using the first 200 samples ([explanation](https://github.com/bitcoin/bitcoin/blob/383d350bd5107bfe00e3b90a00cab9a3c1397c72/src/timedata.cpp#L57-L72)), but I think that only using samples from outbound connections in the first place would be an additional safety measure that would make sense.

  See also issue dashpay#4521 for further context and links: There have been several discussions in the past about replacing or abolishing the existing timedata system.

ACKs for top commit:
  jnewbery:
    Concept and code review ACK 0c85dc3
  naumenkogs:
    ACK 0c85dc3
  vasild:
    ACK 0c85dc3

Tree-SHA512: 2d6375305bcae034d68b58b7a07777b40ac430dfed554c88e681a048c527536691e1b7d08c0ef995247d356f8e81aa0a4b983bf2674faf6a416264e5f1af0a96
DCG-Claude added a commit to thepastaclaw/dash that referenced this pull request Nov 16, 2026
c6be144 Remove timedata (stickies-v)
92e72b5 [net processing] Move IgnoresIncomingTxs to PeerManagerInfo (dergoegge)
7d9c3ec [net processing] Introduce PeerManagerInfo (dergoegge)
ee178df Add TimeOffsets helper class (stickies-v)
55361a1 [net processing] Use std::chrono for type-safe time offsets (stickies-v)
038fd97 [net processing] Move nTimeOffset to net_processing (dergoegge)

Pull request description:

  [An earlier approach](https://github.com/bitcoin/bitcoin/commits/1d226ae1f984c5c808f5c24c431b959cdefa692e/) in bitcoin#28956 involved simplifying and refactoring the network-adjusted time calculation logic, but this was eventually [left out](bitcoin#28956 (comment)) of the PR to make it easier for reviewers to focus on consensus logic changes.

  Since network-adjusted time is now only used for warning/informational purposes, cleaning up the logic (building on @dergoegge's approach in bitcoin#28956) should be quite straightforward and uncontroversial. The main changes are:

  - Previously, we would only calculate the time offset from the first 199 outbound peers that we connected to. This limitation is now removed, and we have a proper rolling calculation. I've reduced the set to 50 outbound peers, which seems plenty.
  - Previously, we would automatically use the network-adjusted time if the difference was < 70 mins, and warn the user if the difference was larger than that. Since there is no longer any automated time adjustment, I've changed the warning threshold to ~~20~~ 10 minutes (which is an arbitrary number).
  - Previously, a warning would only be raised once, and then never again until node restart. This behaviour is now updated to  1) warn to log for every new outbound peer for as long as we appear out of sync, 2) have the RPC warning toggled on/off whenever we go in/out of sync, and 3) have the GUI warn whenever we are out of sync (again), but limited to 1 messagebox per 60 minutes
  - no more globals
  - remove the `-maxtimeadjustment` startup arg

  Closes dashpay#4521

ACKs for top commit:
  sr-gi:
    Re-ACK [c6be144](bitcoin@c6be144)
  achow101:
    reACK c6be144
  dergoegge:
    utACK c6be144

Tree-SHA512: 1063d639542e882186cdcea67d225ad1f97847f44253621a8c4b36c4d777e8f5cb0efe86bc279f01e819d33056ae4364c3300cc7400c087fb16c3f39b3e16b96

Dash adaptations:
- src/timedata.{h,cpp}: kept, because Dash's governance, sporks, CoinJoin and LLMQ code still uses GetAdjustedTime(), fed by AddTimeData() with -maxtimeadjustment
- src/timedata.cpp: removes only AddTimeData()'s clock-out-of-sync warning, which TimeOffsets::WarnIfOutOfSync() replaces
- src/test/timedata_tests.cpp: kept; addtimedata no longer checks the removed warning, only that the offset stays 0 above the limit
- src/net_processing.cpp: VERSION handling feeds peer->m_time_offset to AddTimeData() and to m_outbound_time_offsets; keeps the timedata.h include
- src/net_processing.h: keeps the timedata.h include for DEFAULT_MAX_TIME_ADJUSTMENT in Options; CNodeStateStats has no presync_height (no headerssync in Dash)
- src/net.h: removes CNode::nTimeOffset only, keeping Dash's nLastWarningTime, nTimeFirstMessageReceived and fFirstMessageIsMNAUTH
- src/Makefile.am, src/Makefile.test.include: add the timeoffsets sources and tests next to the timedata ones instead of replacing them

Not applicable to Dash (intentionally omitted):
- src/timedata.cpp: file deletion skipped: Dash keeps network-adjusted time for governance, sporks, CoinJoin and LLMQ (kept on purpose in the bitcoin#28956 backport, dash#7430)
- src/timedata.h: file deletion skipped: still needed for GetAdjustedTime(), AddTimeData() and DEFAULT_MAX_TIME_ADJUSTMENT in Dash
- src/test/timedata_tests.cpp: deletion skipped: CMedianFilter and AddTimeData() remain in Dash, so their tests stay
- src/test/fuzz/timedata.cpp: deletion skipped: CMedianFilter remains in Dash, so its fuzz target stays
- src/Makefile.am: timedata.h and timedata.cpp stay in the build because the files are kept
- src/Makefile.test.include: timedata_tests.cpp and fuzz/timedata.cpp stay listed because the files are kept
- src/init.cpp: -maxtimeadjustment and the timedata.h include stay; the option still limits Dash's adjusted time
- src/test/net_tests.cpp: TestOnlyResetTimeData() stays: ProcessMessage() still calls AddTimeData(), which would break timedata_tests
- src/test/denialofservice_tests.cpp: TestOnlyResetTimeData() stays for the same reason as in net_tests
- src/net_processing.cpp: the timedata.h include stays because AddTimeData() is still called there
DCG-Claude added a commit to thepastaclaw/dash that referenced this pull request Nov 16, 2026
c6be144 Remove timedata (stickies-v)
92e72b5 [net processing] Move IgnoresIncomingTxs to PeerManagerInfo (dergoegge)
7d9c3ec [net processing] Introduce PeerManagerInfo (dergoegge)
ee178df Add TimeOffsets helper class (stickies-v)
55361a1 [net processing] Use std::chrono for type-safe time offsets (stickies-v)
038fd97 [net processing] Move nTimeOffset to net_processing (dergoegge)

Pull request description:

  [An earlier approach](https://github.com/bitcoin/bitcoin/commits/1d226ae1f984c5c808f5c24c431b959cdefa692e/) in bitcoin#28956 involved simplifying and refactoring the network-adjusted time calculation logic, but this was eventually [left out](bitcoin#28956 (comment)) of the PR to make it easier for reviewers to focus on consensus logic changes.

  Since network-adjusted time is now only used for warning/informational purposes, cleaning up the logic (building on @dergoegge's approach in bitcoin#28956) should be quite straightforward and uncontroversial. The main changes are:

  - Previously, we would only calculate the time offset from the first 199 outbound peers that we connected to. This limitation is now removed, and we have a proper rolling calculation. I've reduced the set to 50 outbound peers, which seems plenty.
  - Previously, we would automatically use the network-adjusted time if the difference was < 70 mins, and warn the user if the difference was larger than that. Since there is no longer any automated time adjustment, I've changed the warning threshold to ~~20~~ 10 minutes (which is an arbitrary number).
  - Previously, a warning would only be raised once, and then never again until node restart. This behaviour is now updated to  1) warn to log for every new outbound peer for as long as we appear out of sync, 2) have the RPC warning toggled on/off whenever we go in/out of sync, and 3) have the GUI warn whenever we are out of sync (again), but limited to 1 messagebox per 60 minutes
  - no more globals
  - remove the `-maxtimeadjustment` startup arg

  Closes dashpay#4521

ACKs for top commit:
  sr-gi:
    Re-ACK [c6be144](bitcoin@c6be144)
  achow101:
    reACK c6be144
  dergoegge:
    utACK c6be144

Tree-SHA512: 1063d639542e882186cdcea67d225ad1f97847f44253621a8c4b36c4d777e8f5cb0efe86bc279f01e819d33056ae4364c3300cc7400c087fb16c3f39b3e16b96

Dash adaptations:
- src/timedata.{h,cpp}: kept, because Dash's governance, sporks, CoinJoin and LLMQ code still uses GetAdjustedTime(), fed by AddTimeData() with -maxtimeadjustment
- src/timedata.cpp: removes only AddTimeData()'s clock-out-of-sync warning, which TimeOffsets::WarnIfOutOfSync() replaces
- src/test/timedata_tests.cpp: kept; addtimedata no longer checks the removed warning, only that the offset stays 0 above the limit
- src/net_processing.cpp: VERSION handling feeds peer->m_time_offset to AddTimeData() and to m_outbound_time_offsets; keeps the timedata.h include
- src/net_processing.h: keeps the timedata.h include for DEFAULT_MAX_TIME_ADJUSTMENT in Options; CNodeStateStats has no presync_height (no headerssync in Dash)
- src/net.h: removes CNode::nTimeOffset only, keeping Dash's nLastWarningTime, nTimeFirstMessageReceived and fFirstMessageIsMNAUTH
- src/Makefile.am, src/Makefile.test.include: add the timeoffsets sources and tests next to the timedata ones instead of replacing them

Not applicable to Dash (intentionally omitted):
- src/timedata.cpp: file deletion skipped: Dash keeps network-adjusted time for governance, sporks, CoinJoin and LLMQ (kept on purpose in the bitcoin#28956 backport, dash#7430)
- src/timedata.h: file deletion skipped: still needed for GetAdjustedTime(), AddTimeData() and DEFAULT_MAX_TIME_ADJUSTMENT in Dash
- src/test/timedata_tests.cpp: deletion skipped: CMedianFilter and AddTimeData() remain in Dash, so their tests stay
- src/test/fuzz/timedata.cpp: deletion skipped: CMedianFilter remains in Dash, so its fuzz target stays
- src/Makefile.am: timedata.h and timedata.cpp stay in the build because the files are kept
- src/Makefile.test.include: timedata_tests.cpp and fuzz/timedata.cpp stay listed because the files are kept
- src/init.cpp: -maxtimeadjustment and the timedata.h include stay; the option still limits Dash's adjusted time
- src/test/net_tests.cpp: TestOnlyResetTimeData() stays: ProcessMessage() still calls AddTimeData(), which would break timedata_tests
- src/test/denialofservice_tests.cpp: TestOnlyResetTimeData() stays for the same reason as in net_tests
- src/net_processing.cpp: the timedata.h include stays because AddTimeData() is still called there
DCG-Claude added a commit to thepastaclaw/dash that referenced this pull request Nov 16, 2026
c6be144 Remove timedata (stickies-v)
92e72b5 [net processing] Move IgnoresIncomingTxs to PeerManagerInfo (dergoegge)
7d9c3ec [net processing] Introduce PeerManagerInfo (dergoegge)
ee178df Add TimeOffsets helper class (stickies-v)
55361a1 [net processing] Use std::chrono for type-safe time offsets (stickies-v)
038fd97 [net processing] Move nTimeOffset to net_processing (dergoegge)

Pull request description:

  [An earlier approach](https://github.com/bitcoin/bitcoin/commits/1d226ae1f984c5c808f5c24c431b959cdefa692e/) in bitcoin#28956 involved simplifying and refactoring the network-adjusted time calculation logic, but this was eventually [left out](bitcoin#28956 (comment)) of the PR to make it easier for reviewers to focus on consensus logic changes.

  Since network-adjusted time is now only used for warning/informational purposes, cleaning up the logic (building on @dergoegge's approach in bitcoin#28956) should be quite straightforward and uncontroversial. The main changes are:

  - Previously, we would only calculate the time offset from the first 199 outbound peers that we connected to. This limitation is now removed, and we have a proper rolling calculation. I've reduced the set to 50 outbound peers, which seems plenty.
  - Previously, we would automatically use the network-adjusted time if the difference was < 70 mins, and warn the user if the difference was larger than that. Since there is no longer any automated time adjustment, I've changed the warning threshold to ~~20~~ 10 minutes (which is an arbitrary number).
  - Previously, a warning would only be raised once, and then never again until node restart. This behaviour is now updated to  1) warn to log for every new outbound peer for as long as we appear out of sync, 2) have the RPC warning toggled on/off whenever we go in/out of sync, and 3) have the GUI warn whenever we are out of sync (again), but limited to 1 messagebox per 60 minutes
  - no more globals
  - remove the `-maxtimeadjustment` startup arg

  Closes dashpay#4521

ACKs for top commit:
  sr-gi:
    Re-ACK [c6be144](bitcoin@c6be144)
  achow101:
    reACK c6be144
  dergoegge:
    utACK c6be144

Tree-SHA512: 1063d639542e882186cdcea67d225ad1f97847f44253621a8c4b36c4d777e8f5cb0efe86bc279f01e819d33056ae4364c3300cc7400c087fb16c3f39b3e16b96

Dash adaptations:
- src/timedata.{h,cpp}: kept, because Dash's governance, sporks, CoinJoin and LLMQ code still uses GetAdjustedTime(), fed by AddTimeData() with -maxtimeadjustment
- src/timedata.cpp: removes only AddTimeData()'s clock-out-of-sync warning, which TimeOffsets::WarnIfOutOfSync() replaces
- src/test/timedata_tests.cpp: kept; addtimedata no longer checks the removed warning, only that the offset stays 0 above the limit
- src/net_processing.cpp: VERSION handling feeds peer->m_time_offset to AddTimeData() and to m_outbound_time_offsets; keeps the timedata.h include
- src/net_processing.h: keeps the timedata.h include for DEFAULT_MAX_TIME_ADJUSTMENT in Options; CNodeStateStats has no presync_height (no headerssync in Dash)
- src/net.h: removes CNode::nTimeOffset only, keeping Dash's nLastWarningTime, nTimeFirstMessageReceived and fFirstMessageIsMNAUTH
- src/Makefile.am, src/Makefile.test.include: add the timeoffsets sources and tests next to the timedata ones instead of replacing them

Not applicable to Dash (intentionally omitted):
- src/timedata.cpp: file deletion skipped: Dash keeps network-adjusted time for governance, sporks, CoinJoin and LLMQ (kept on purpose in the bitcoin#28956 backport, dash#7430)
- src/timedata.h: file deletion skipped: still needed for GetAdjustedTime(), AddTimeData() and DEFAULT_MAX_TIME_ADJUSTMENT in Dash
- src/test/timedata_tests.cpp: deletion skipped: CMedianFilter and AddTimeData() remain in Dash, so their tests stay
- src/test/fuzz/timedata.cpp: deletion skipped: CMedianFilter remains in Dash, so its fuzz target stays
- src/Makefile.am: timedata.h and timedata.cpp stay in the build because the files are kept
- src/Makefile.test.include: timedata_tests.cpp and fuzz/timedata.cpp stay listed because the files are kept
- src/init.cpp: -maxtimeadjustment and the timedata.h include stay; the option still limits Dash's adjusted time
- src/test/net_tests.cpp: TestOnlyResetTimeData() stays: ProcessMessage() still calls AddTimeData(), which would break timedata_tests
- src/test/denialofservice_tests.cpp: TestOnlyResetTimeData() stays for the same reason as in net_tests
- src/net_processing.cpp: the timedata.h include stays because AddTimeData() is still called there
DCG-Claude added a commit to thepastaclaw/dash that referenced this pull request Nov 17, 2026
c6be144 Remove timedata (stickies-v)
92e72b5 [net processing] Move IgnoresIncomingTxs to PeerManagerInfo (dergoegge)
7d9c3ec [net processing] Introduce PeerManagerInfo (dergoegge)
ee178df Add TimeOffsets helper class (stickies-v)
55361a1 [net processing] Use std::chrono for type-safe time offsets (stickies-v)
038fd97 [net processing] Move nTimeOffset to net_processing (dergoegge)

Pull request description:

  [An earlier approach](https://github.com/bitcoin/bitcoin/commits/1d226ae1f984c5c808f5c24c431b959cdefa692e/) in bitcoin#28956 involved simplifying and refactoring the network-adjusted time calculation logic, but this was eventually [left out](bitcoin#28956 (comment)) of the PR to make it easier for reviewers to focus on consensus logic changes.

  Since network-adjusted time is now only used for warning/informational purposes, cleaning up the logic (building on @dergoegge's approach in bitcoin#28956) should be quite straightforward and uncontroversial. The main changes are:

  - Previously, we would only calculate the time offset from the first 199 outbound peers that we connected to. This limitation is now removed, and we have a proper rolling calculation. I've reduced the set to 50 outbound peers, which seems plenty.
  - Previously, we would automatically use the network-adjusted time if the difference was < 70 mins, and warn the user if the difference was larger than that. Since there is no longer any automated time adjustment, I've changed the warning threshold to ~~20~~ 10 minutes (which is an arbitrary number).
  - Previously, a warning would only be raised once, and then never again until node restart. This behaviour is now updated to  1) warn to log for every new outbound peer for as long as we appear out of sync, 2) have the RPC warning toggled on/off whenever we go in/out of sync, and 3) have the GUI warn whenever we are out of sync (again), but limited to 1 messagebox per 60 minutes
  - no more globals
  - remove the `-maxtimeadjustment` startup arg

  Closes dashpay#4521

ACKs for top commit:
  sr-gi:
    Re-ACK [c6be144](bitcoin@c6be144)
  achow101:
    reACK c6be144
  dergoegge:
    utACK c6be144

Tree-SHA512: 1063d639542e882186cdcea67d225ad1f97847f44253621a8c4b36c4d777e8f5cb0efe86bc279f01e819d33056ae4364c3300cc7400c087fb16c3f39b3e16b96

Dash adaptations:
- src/timedata.{h,cpp}: kept, because Dash's governance, sporks, CoinJoin and LLMQ code still uses GetAdjustedTime(), fed by AddTimeData() with -maxtimeadjustment
- src/timedata.cpp: removes only AddTimeData()'s clock-out-of-sync warning, which TimeOffsets::WarnIfOutOfSync() replaces
- src/test/timedata_tests.cpp: kept; addtimedata no longer checks the removed warning, only that the offset stays 0 above the limit
- src/net_processing.cpp: VERSION handling feeds peer->m_time_offset to AddTimeData() and to m_outbound_time_offsets; keeps the timedata.h include
- src/net_processing.h: keeps the timedata.h include for DEFAULT_MAX_TIME_ADJUSTMENT in Options; CNodeStateStats has no presync_height (no headerssync in Dash)
- src/net.h: removes CNode::nTimeOffset only, keeping Dash's nLastWarningTime, nTimeFirstMessageReceived and fFirstMessageIsMNAUTH
- src/Makefile.am, src/Makefile.test.include: add the timeoffsets sources and tests next to the timedata ones instead of replacing them

Not applicable to Dash (intentionally omitted):
- src/timedata.cpp: file deletion skipped: Dash keeps network-adjusted time for governance, sporks, CoinJoin and LLMQ (kept on purpose in the bitcoin#28956 backport, dash#7430)
- src/timedata.h: file deletion skipped: still needed for GetAdjustedTime(), AddTimeData() and DEFAULT_MAX_TIME_ADJUSTMENT in Dash
- src/test/timedata_tests.cpp: deletion skipped: CMedianFilter and AddTimeData() remain in Dash, so their tests stay
- src/test/fuzz/timedata.cpp: deletion skipped: CMedianFilter remains in Dash, so its fuzz target stays
- src/Makefile.am: timedata.h and timedata.cpp stay in the build because the files are kept
- src/Makefile.test.include: timedata_tests.cpp and fuzz/timedata.cpp stay listed because the files are kept
- src/init.cpp: -maxtimeadjustment and the timedata.h include stay; the option still limits Dash's adjusted time
- src/test/net_tests.cpp: TestOnlyResetTimeData() stays: ProcessMessage() still calls AddTimeData(), which would break timedata_tests
- src/test/denialofservice_tests.cpp: TestOnlyResetTimeData() stays for the same reason as in net_tests
- src/net_processing.cpp: the timedata.h include stays because AddTimeData() is still called there
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants