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)_
This commit is contained in:
UdjinM6 2023-11-21 16:53:55 +03:00 committed by Odysseas Gabrielides
parent 7c966c9db0
commit 330c5f9451

View File

@ -34,7 +34,7 @@ UniValue CMasternodeMetaInfo::ToJson() const
{ {
UniValue ret(UniValue::VOBJ); UniValue ret(UniValue::VOBJ);
auto now = GetTime<std::chrono::seconds>().count(); int64_t now = GetTime<std::chrono::seconds>().count();
ret.pushKV("lastDSQ", nLastDsq); ret.pushKV("lastDSQ", nLastDsq);
ret.pushKV("mixingTxCount", nMixingTxCount); ret.pushKV("mixingTxCount", nMixingTxCount);