From 330c5f9451fde5a6335fb32f38f3b29d05fb19e3 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 21 Nov 2023 16:53:55 +0300 Subject: [PATCH] fix: should avoid implicit conversions in `pushKV` params (#5719) ## Issue being fixed or feature implemented Should fix compilation errors like ``` masternode/meta.cpp:43:9: error: call to member function 'pushKV' is ambiguous ret.pushKV("lastOutboundAttemptElapsed", now - lastOutboundAttempt); ^~ masternode/meta.cpp:45:9: error: call to member function 'pushKV' is ambiguous ret.pushKV("lastOutboundSuccessElapsed", now - lastOutboundSuccess); ^~ ``` on FreeBSD + clang-15 kudos to @MrDefacto for finding the issue and testing the fix ## What was done? Specify `now` variable type explicitly instead of relying on `auto` ## How Has This Been Tested? MrDefacto confirmed it compiles with no issues on FreeBSD now ## Breaking Changes n/a ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ --- src/masternode/meta.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/masternode/meta.cpp b/src/masternode/meta.cpp index 987fc3ded8..44b94a80f9 100644 --- a/src/masternode/meta.cpp +++ b/src/masternode/meta.cpp @@ -34,7 +34,7 @@ UniValue CMasternodeMetaInfo::ToJson() const { UniValue ret(UniValue::VOBJ); - auto now = GetTime().count(); + int64_t now = GetTime().count(); ret.pushKV("lastDSQ", nLastDsq); ret.pushKV("mixingTxCount", nMixingTxCount);