Skip to content

Commit d56e30c

Browse files
committed
removed a few unnecessary casts
1 parent 3e74ac2 commit d56e30c

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/rpcblockchain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex)
6464
BOOST_FOREACH(const CTransaction&tx, block.vtx)
6565
txs.push_back(tx.GetHash().GetHex());
6666
result.push_back(Pair("tx", txs));
67-
result.push_back(Pair("time", (int64_t)block.GetBlockTime()));
67+
result.push_back(Pair("time", block.GetBlockTime()));
6868
result.push_back(Pair("nonce", (uint64_t)block.nNonce));
6969
result.push_back(Pair("bits", HexBits(block.nBits)));
7070
result.push_back(Pair("difficulty", GetDifficulty(blockindex)));
@@ -175,7 +175,7 @@ Value getrawmempool(const Array& params, bool fHelp)
175175
Object info;
176176
info.push_back(Pair("size", (int)e.GetTxSize()));
177177
info.push_back(Pair("fee", ValueFromAmount(e.GetFee())));
178-
info.push_back(Pair("time", (int64_t)e.GetTime()));
178+
info.push_back(Pair("time", e.GetTime()));
179179
info.push_back(Pair("height", (int)e.GetHeight()));
180180
info.push_back(Pair("startingpriority", e.GetPriority(e.GetHeight())));
181181
info.push_back(Pair("currentpriority", e.GetPriority(chainActive.Height())));

src/rpcmisc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,18 @@ Value getinfo(const Array& params, bool fHelp)
6969
}
7070
#endif
7171
obj.push_back(Pair("blocks", (int)chainActive.Height()));
72-
obj.push_back(Pair("timeoffset", (int64_t)GetTimeOffset()));
72+
obj.push_back(Pair("timeoffset", GetTimeOffset()));
7373
obj.push_back(Pair("connections", (int)vNodes.size()));
7474
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
7575
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
7676
obj.push_back(Pair("testnet", TestNet()));
7777
#ifdef ENABLE_WALLET
7878
if (pwalletMain) {
79-
obj.push_back(Pair("keypoololdest", (int64_t)pwalletMain->GetOldestKeyPoolTime()));
79+
obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime()));
8080
obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize()));
8181
}
8282
if (pwalletMain && pwalletMain->IsCrypted())
83-
obj.push_back(Pair("unlocked_until", (int64_t)nWalletUnlockTime));
83+
obj.push_back(Pair("unlocked_until", nWalletUnlockTime));
8484
obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee)));
8585
#endif
8686
obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::nMinRelayTxFee)));

src/rpcnet.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ Value getpeerinfo(const Array& params, bool fHelp)
116116
if (!(stats.addrLocal.empty()))
117117
obj.push_back(Pair("addrlocal", stats.addrLocal));
118118
obj.push_back(Pair("services", strprintf("%08x", stats.nServices)));
119-
obj.push_back(Pair("lastsend", (int64_t)stats.nLastSend));
120-
obj.push_back(Pair("lastrecv", (int64_t)stats.nLastRecv));
121-
obj.push_back(Pair("bytessent", (int64_t)stats.nSendBytes));
122-
obj.push_back(Pair("bytesrecv", (int64_t)stats.nRecvBytes));
123-
obj.push_back(Pair("conntime", (int64_t)stats.nTimeConnected));
119+
obj.push_back(Pair("lastsend", stats.nLastSend));
120+
obj.push_back(Pair("lastrecv", stats.nLastRecv));
121+
obj.push_back(Pair("bytessent", stats.nSendBytes));
122+
obj.push_back(Pair("bytesrecv", stats.nRecvBytes));
123+
obj.push_back(Pair("conntime", stats.nTimeConnected));
124124
obj.push_back(Pair("pingtime", stats.dPingTime));
125125
if (stats.dPingWait > 0.0)
126126
obj.push_back(Pair("pingwait", stats.dPingWait));
@@ -328,9 +328,9 @@ Value getnettotals(const Array& params, bool fHelp)
328328
);
329329

330330
Object obj;
331-
obj.push_back(Pair("totalbytesrecv", static_cast< uint64_t>(CNode::GetTotalBytesRecv())));
332-
obj.push_back(Pair("totalbytessent", static_cast<uint64_t>(CNode::GetTotalBytesSent())));
333-
obj.push_back(Pair("timemillis", static_cast<int64_t>(GetTimeMillis())));
331+
obj.push_back(Pair("totalbytesrecv", CNode::GetTotalBytesRecv()));
332+
obj.push_back(Pair("totalbytessent", CNode::GetTotalBytesSent()));
333+
obj.push_back(Pair("timemillis", GetTimeMillis()));
334334
return obj;
335335
}
336336

@@ -365,7 +365,7 @@ Value getnetworkinfo(const Array& params, bool fHelp)
365365
Object obj;
366366
obj.push_back(Pair("version", (int)CLIENT_VERSION));
367367
obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION));
368-
obj.push_back(Pair("timeoffset", (boost::int64_t)GetTimeOffset()));
368+
obj.push_back(Pair("timeoffset", GetTimeOffset()));
369369
obj.push_back(Pair("connections", (int)vNodes.size()));
370370
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
371371
obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::nMinRelayTxFee)));

src/rpcwallet.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void WalletTxToJSON(const CWalletTx& wtx, Object& entry)
5757
BOOST_FOREACH(const uint256& conflict, wtx.GetConflicts())
5858
conflicts.push_back(conflict.GetHex());
5959
entry.push_back(Pair("walletconflicts", conflicts));
60-
entry.push_back(Pair("time", (int64_t)wtx.GetTxTime()));
60+
entry.push_back(Pair("time", wtx.GetTxTime()));
6161
entry.push_back(Pair("timereceived", (int64_t)wtx.nTimeReceived));
6262
BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue)
6363
entry.push_back(Pair(item.first, item.second));
@@ -1167,7 +1167,7 @@ void AcentryToJSON(const CAccountingEntry& acentry, const string& strAccount, Ar
11671167
Object entry;
11681168
entry.push_back(Pair("account", acentry.strAccount));
11691169
entry.push_back(Pair("category", "move"));
1170-
entry.push_back(Pair("time", (int64_t)acentry.nTime));
1170+
entry.push_back(Pair("time", acentry.nTime));
11711171
entry.push_back(Pair("amount", ValueFromAmount(acentry.nCreditDebit)));
11721172
entry.push_back(Pair("otheraccount", acentry.strOtherAccount));
11731173
entry.push_back(Pair("comment", acentry.strComment));
@@ -1912,9 +1912,9 @@ Value getwalletinfo(const Array& params, bool fHelp)
19121912
obj.push_back(Pair("walletversion", pwalletMain->GetVersion()));
19131913
obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance())));
19141914
obj.push_back(Pair("txcount", (int)pwalletMain->mapWallet.size()));
1915-
obj.push_back(Pair("keypoololdest", (int64_t)pwalletMain->GetOldestKeyPoolTime()));
1915+
obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime()));
19161916
obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize()));
19171917
if (pwalletMain->IsCrypted())
1918-
obj.push_back(Pair("unlocked_until", (int64_t)nWalletUnlockTime));
1918+
obj.push_back(Pair("unlocked_until", nWalletUnlockTime));
19191919
return obj;
19201920
}

0 commit comments

Comments
 (0)