aboutsummaryrefslogtreecommitdiff
path: root/src/util/time.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-04-18 16:10:56 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-04-18 16:11:05 -0400
commit607b1b74986b7390836545889cc60cac5fedc175 (patch)
treed1da6cbe7960c1e45de8edf6ee3571b082f81fef /src/util/time.cpp
parenta58d80d1b261e8fb2a4199d6be8a68dc29df81f0 (diff)
parent8602d8b2138a06d5db7e5b86b839f400b0a905a4 (diff)
downloadbitcoin-607b1b74986b7390836545889cc60cac5fedc175.tar.xz
Merge #15839: [0.18] Revert GetData randomization change (#14897)
8602d8b213 Revert "Change in transaction pull scheduling to prevent InvBlock-related attacks" (Suhas Daftuar) Pull request description: This is for 0.18, not master -- I propose we revert the getdata change for the 0.18 release, rather than try to continue patching it up. It seems like we've turned up several additional bugs that slipped through initial review (see #15776, #15834), and given the potential severe consequences of these bugs I think it'd make more sense for us to delay releasing this code until 0.19. Since the bugfix PRs are getting review, I think we can leave #14897 in master, but we can separately discuss if it should be reverted in master as well if anyone thinks that would be more appropriate. ACKs for commit 8602d8: Tree-SHA512: 0389cefc1bc74ac47f87866cf3a4dcfe202740a1baa3db074137e0aa5859672d74a50a34ccdb7cf43b3a3c99ce91e4ba1fb512d04d1d383d4cc184a8ada5543f
Diffstat (limited to 'src/util/time.cpp')
-rw-r--r--src/util/time.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util/time.cpp b/src/util/time.cpp
index c0ede98701..83a7937d8f 100644
--- a/src/util/time.cpp
+++ b/src/util/time.cpp
@@ -97,3 +97,14 @@ std::string FormatISO8601Date(int64_t nTime) {
#endif
return strprintf("%04i-%02i-%02i", ts.tm_year + 1900, ts.tm_mon + 1, ts.tm_mday);
}
+
+std::string FormatISO8601Time(int64_t nTime) {
+ struct tm ts;
+ time_t time_val = nTime;
+#ifdef _MSC_VER
+ gmtime_s(&ts, &time_val);
+#else
+ gmtime_r(&time_val, &ts);
+#endif
+ return strprintf("%02i:%02i:%02iZ", ts.tm_hour, ts.tm_min, ts.tm_sec);
+}