removed a few unnecessary casts

This commit is contained in:
Kamil Domanski 2014-05-06 14:58:43 +02:00
parent 3e74ac22d5
commit d56e30ca89
4 changed files with 18 additions and 18 deletions

View File

@ -64,7 +64,7 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex)
BOOST_FOREACH(const CTransaction&tx, block.vtx) BOOST_FOREACH(const CTransaction&tx, block.vtx)
txs.push_back(tx.GetHash().GetHex()); txs.push_back(tx.GetHash().GetHex());
result.push_back(Pair("tx", txs)); result.push_back(Pair("tx", txs));
result.push_back(Pair("time", (int64_t)block.GetBlockTime())); result.push_back(Pair("time", block.GetBlockTime()));
result.push_back(Pair("nonce", (uint64_t)block.nNonce)); result.push_back(Pair("nonce", (uint64_t)block.nNonce));
result.push_back(Pair("bits", HexBits(block.nBits))); result.push_back(Pair("bits", HexBits(block.nBits)));
result.push_back(Pair("difficulty", GetDifficulty(blockindex))); result.push_back(Pair("difficulty", GetDifficulty(blockindex)));
@ -175,7 +175,7 @@ Value getrawmempool(const Array& params, bool fHelp)
Object info; Object info;
info.push_back(Pair("size", (int)e.GetTxSize())); info.push_back(Pair("size", (int)e.GetTxSize()));
info.push_back(Pair("fee", ValueFromAmount(e.GetFee()))); info.push_back(Pair("fee", ValueFromAmount(e.GetFee())));
info.push_back(Pair("time", (int64_t)e.GetTime())); info.push_back(Pair("time", e.GetTime()));
info.push_back(Pair("height", (int)e.GetHeight())); info.push_back(Pair("height", (int)e.GetHeight()));
info.push_back(Pair("startingpriority", e.GetPriority(e.GetHeight()))); info.push_back(Pair("startingpriority", e.GetPriority(e.GetHeight())));
info.push_back(Pair("currentpriority", e.GetPriority(chainActive.Height()))); info.push_back(Pair("currentpriority", e.GetPriority(chainActive.Height())));

View File

@ -69,18 +69,18 @@ Value getinfo(const Array& params, bool fHelp)
} }
#endif #endif
obj.push_back(Pair("blocks", (int)chainActive.Height())); obj.push_back(Pair("blocks", (int)chainActive.Height()));
obj.push_back(Pair("timeoffset", (int64_t)GetTimeOffset())); obj.push_back(Pair("timeoffset", GetTimeOffset()));
obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("connections", (int)vNodes.size()));
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("difficulty", (double)GetDifficulty()));
obj.push_back(Pair("testnet", TestNet())); obj.push_back(Pair("testnet", TestNet()));
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
if (pwalletMain) { if (pwalletMain) {
obj.push_back(Pair("keypoololdest", (int64_t)pwalletMain->GetOldestKeyPoolTime())); obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime()));
obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize())); obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize()));
} }
if (pwalletMain && pwalletMain->IsCrypted()) if (pwalletMain && pwalletMain->IsCrypted())
obj.push_back(Pair("unlocked_until", (int64_t)nWalletUnlockTime)); obj.push_back(Pair("unlocked_until", nWalletUnlockTime));
obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee))); obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee)));
#endif #endif
obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::nMinRelayTxFee))); obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::nMinRelayTxFee)));

View File

@ -116,11 +116,11 @@ Value getpeerinfo(const Array& params, bool fHelp)
if (!(stats.addrLocal.empty())) if (!(stats.addrLocal.empty()))
obj.push_back(Pair("addrlocal", stats.addrLocal)); obj.push_back(Pair("addrlocal", stats.addrLocal));
obj.push_back(Pair("services", strprintf("%08x", stats.nServices))); obj.push_back(Pair("services", strprintf("%08x", stats.nServices)));
obj.push_back(Pair("lastsend", (int64_t)stats.nLastSend)); obj.push_back(Pair("lastsend", stats.nLastSend));
obj.push_back(Pair("lastrecv", (int64_t)stats.nLastRecv)); obj.push_back(Pair("lastrecv", stats.nLastRecv));
obj.push_back(Pair("bytessent", (int64_t)stats.nSendBytes)); obj.push_back(Pair("bytessent", stats.nSendBytes));
obj.push_back(Pair("bytesrecv", (int64_t)stats.nRecvBytes)); obj.push_back(Pair("bytesrecv", stats.nRecvBytes));
obj.push_back(Pair("conntime", (int64_t)stats.nTimeConnected)); obj.push_back(Pair("conntime", stats.nTimeConnected));
obj.push_back(Pair("pingtime", stats.dPingTime)); obj.push_back(Pair("pingtime", stats.dPingTime));
if (stats.dPingWait > 0.0) if (stats.dPingWait > 0.0)
obj.push_back(Pair("pingwait", stats.dPingWait)); obj.push_back(Pair("pingwait", stats.dPingWait));
@ -328,9 +328,9 @@ Value getnettotals(const Array& params, bool fHelp)
); );
Object obj; Object obj;
obj.push_back(Pair("totalbytesrecv", static_cast< uint64_t>(CNode::GetTotalBytesRecv()))); obj.push_back(Pair("totalbytesrecv", CNode::GetTotalBytesRecv()));
obj.push_back(Pair("totalbytessent", static_cast<uint64_t>(CNode::GetTotalBytesSent()))); obj.push_back(Pair("totalbytessent", CNode::GetTotalBytesSent()));
obj.push_back(Pair("timemillis", static_cast<int64_t>(GetTimeMillis()))); obj.push_back(Pair("timemillis", GetTimeMillis()));
return obj; return obj;
} }
@ -365,7 +365,7 @@ Value getnetworkinfo(const Array& params, bool fHelp)
Object obj; Object obj;
obj.push_back(Pair("version", (int)CLIENT_VERSION)); obj.push_back(Pair("version", (int)CLIENT_VERSION));
obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION)); obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION));
obj.push_back(Pair("timeoffset", (boost::int64_t)GetTimeOffset())); obj.push_back(Pair("timeoffset", GetTimeOffset()));
obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("connections", (int)vNodes.size()));
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::nMinRelayTxFee))); obj.push_back(Pair("relayfee", ValueFromAmount(CTransaction::nMinRelayTxFee)));

View File

@ -57,7 +57,7 @@ void WalletTxToJSON(const CWalletTx& wtx, Object& entry)
BOOST_FOREACH(const uint256& conflict, wtx.GetConflicts()) BOOST_FOREACH(const uint256& conflict, wtx.GetConflicts())
conflicts.push_back(conflict.GetHex()); conflicts.push_back(conflict.GetHex());
entry.push_back(Pair("walletconflicts", conflicts)); entry.push_back(Pair("walletconflicts", conflicts));
entry.push_back(Pair("time", (int64_t)wtx.GetTxTime())); entry.push_back(Pair("time", wtx.GetTxTime()));
entry.push_back(Pair("timereceived", (int64_t)wtx.nTimeReceived)); entry.push_back(Pair("timereceived", (int64_t)wtx.nTimeReceived));
BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue) BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue)
entry.push_back(Pair(item.first, item.second)); entry.push_back(Pair(item.first, item.second));
@ -1167,7 +1167,7 @@ void AcentryToJSON(const CAccountingEntry& acentry, const string& strAccount, Ar
Object entry; Object entry;
entry.push_back(Pair("account", acentry.strAccount)); entry.push_back(Pair("account", acentry.strAccount));
entry.push_back(Pair("category", "move")); entry.push_back(Pair("category", "move"));
entry.push_back(Pair("time", (int64_t)acentry.nTime)); entry.push_back(Pair("time", acentry.nTime));
entry.push_back(Pair("amount", ValueFromAmount(acentry.nCreditDebit))); entry.push_back(Pair("amount", ValueFromAmount(acentry.nCreditDebit)));
entry.push_back(Pair("otheraccount", acentry.strOtherAccount)); entry.push_back(Pair("otheraccount", acentry.strOtherAccount));
entry.push_back(Pair("comment", acentry.strComment)); entry.push_back(Pair("comment", acentry.strComment));
@ -1912,9 +1912,9 @@ Value getwalletinfo(const Array& params, bool fHelp)
obj.push_back(Pair("walletversion", pwalletMain->GetVersion())); obj.push_back(Pair("walletversion", pwalletMain->GetVersion()));
obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance()))); obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance())));
obj.push_back(Pair("txcount", (int)pwalletMain->mapWallet.size())); obj.push_back(Pair("txcount", (int)pwalletMain->mapWallet.size()));
obj.push_back(Pair("keypoololdest", (int64_t)pwalletMain->GetOldestKeyPoolTime())); obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime()));
obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize())); obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize()));
if (pwalletMain->IsCrypted()) if (pwalletMain->IsCrypted())
obj.push_back(Pair("unlocked_until", (int64_t)nWalletUnlockTime)); obj.push_back(Pair("unlocked_until", nWalletUnlockTime));
return obj; return obj;
} }