1
0
mirror of https://github.com/GOSTSec/gostcoin synced 2025-01-30 16:34:29 +00:00

fix build warnings

This commit is contained in:
R4SAS 2017-03-28 20:54:08 +03:00
parent bf37748c42
commit 1cd62a79ee
15 changed files with 53 additions and 53 deletions

View File

@ -51,8 +51,8 @@ std::string CUnsignedAlert::ToString() const
return strprintf( return strprintf(
"CAlert(\n" "CAlert(\n"
" nVersion = %d\n" " nVersion = %d\n"
" nRelayUntil = %"PRI64d"\n" " nRelayUntil = %" PRI64d "\n"
" nExpiration = %"PRI64d"\n" " nExpiration = %" PRI64d "\n"
" nID = %d\n" " nID = %d\n"
" nCancel = %d\n" " nCancel = %d\n"
" setCancel = %s\n" " setCancel = %s\n"

View File

@ -354,7 +354,7 @@ static string HTTPReply(int nStatus, const string& strMsg, bool keepalive)
"HTTP/1.1 %d %s\r\n" "HTTP/1.1 %d %s\r\n"
"Date: %s\r\n" "Date: %s\r\n"
"Connection: %s\r\n" "Connection: %s\r\n"
"Content-Length: %"PRIszu"\r\n" "Content-Length: %" PRIszu "\r\n"
"Content-Type: application/json\r\n" "Content-Type: application/json\r\n"
"Server: anoncoin-json-rpc/%s\r\n" "Server: anoncoin-json-rpc/%s\r\n"
"\r\n" "\r\n"

View File

@ -457,7 +457,7 @@ void CDBEnv::Flush(bool fShutdown)
else else
mi++; mi++;
} }
printf("DBFlush(%s)%s ended %15"PRI64d"ms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started", GetTimeMillis() - nStart); printf("DBFlush(%s)%s ended %15" PRI64d "ms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started", GetTimeMillis() - nStart);
if (fShutdown) if (fShutdown)
{ {
char** listp; char** listp;

View File

@ -756,7 +756,7 @@ bool AppInit2(boost::thread_group& threadGroup)
{ {
// try moving the database env out of the way // try moving the database env out of the way
boost::filesystem::path pathDatabase = GetDataDir() / "database"; boost::filesystem::path pathDatabase = GetDataDir() / "database";
boost::filesystem::path pathDatabaseBak = GetDataDir() / strprintf("database.%"PRI64d".bak", GetTime()); boost::filesystem::path pathDatabaseBak = GetDataDir() / strprintf("database.%" PRI64d ".bak", GetTime());
try { try {
boost::filesystem::rename(pathDatabase, pathDatabaseBak); boost::filesystem::rename(pathDatabase, pathDatabaseBak);
printf("Moved old %s to %s. Retrying.\n", pathDatabase.string().c_str(), pathDatabaseBak.string().c_str()); printf("Moved old %s to %s. Retrying.\n", pathDatabase.string().c_str(), pathDatabaseBak.string().c_str());
@ -1048,7 +1048,7 @@ bool AppInit2(boost::thread_group& threadGroup)
printf("Shutdown requested. Exiting.\n"); printf("Shutdown requested. Exiting.\n");
return false; return false;
} }
printf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart); printf(" block index %15" PRI64d "ms\n", GetTimeMillis() - nStart);
if (GetBoolArg("-printblockindex") || GetBoolArg("-printblocktree")) if (GetBoolArg("-printblockindex") || GetBoolArg("-printblocktree"))
{ {
@ -1145,7 +1145,7 @@ bool AppInit2(boost::thread_group& threadGroup)
} }
printf("%s", strErrors.str().c_str()); printf("%s", strErrors.str().c_str());
printf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart); printf(" wallet %15" PRI64d "ms\n", GetTimeMillis() - nStart);
RegisterWallet(pwalletMain); RegisterWallet(pwalletMain);
@ -1167,7 +1167,7 @@ bool AppInit2(boost::thread_group& threadGroup)
printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight); printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight);
nStart = GetTimeMillis(); nStart = GetTimeMillis();
pwalletMain->ScanForWalletTransactions(pindexRescan, true); pwalletMain->ScanForWalletTransactions(pindexRescan, true);
printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart); printf(" rescan %15" PRI64d "ms\n", GetTimeMillis() - nStart);
pwalletMain->SetBestChain(CBlockLocator(pindexBest)); pwalletMain->SetBestChain(CBlockLocator(pindexBest));
nWalletDBUpdated++; nWalletDBUpdated++;
} }
@ -1200,7 +1200,7 @@ bool AppInit2(boost::thread_group& threadGroup)
printf("Invalid or missing peers.dat; recreating\n"); printf("Invalid or missing peers.dat; recreating\n");
} }
printf("Loaded %i addresses from peers.dat %"PRI64d"ms\n", printf("Loaded %i addresses from peers.dat %" PRI64d "ms\n",
addrman.size(), GetTimeMillis() - nStart); addrman.size(), GetTimeMillis() - nStart);
// ********************************************************* Step 11: start node // ********************************************************* Step 11: start node
@ -1214,11 +1214,11 @@ bool AppInit2(boost::thread_group& threadGroup)
RandAddSeedPerfmon(); RandAddSeedPerfmon();
//// debug print //// debug print
printf("mapBlockIndex.size() = %"PRIszu"\n", mapBlockIndex.size()); printf("mapBlockIndex.size() = %" PRIszu "\n", mapBlockIndex.size());
printf("nBestHeight = %d\n", nBestHeight); printf("nBestHeight = %d\n", nBestHeight);
printf("setKeyPool.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->setKeyPool.size() : 0); printf("setKeyPool.size() = %" PRIszu "\n", pwalletMain ? pwalletMain->setKeyPool.size() : 0);
printf("mapWallet.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->mapWallet.size() : 0); printf("mapWallet.size() = %" PRIszu "\n", pwalletMain ? pwalletMain->mapWallet.size() : 0);
printf("mapAddressBook.size() = %"PRIszu"\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0); printf("mapAddressBook.size() = %" PRIszu "\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0);
StartNode(threadGroup); StartNode(threadGroup);

View File

@ -314,7 +314,7 @@ void ThreadIRCSeed()
if (!fNoListen && GetLocal(addrLocal, &addrIPv4) && nNameRetry<3) if (!fNoListen && GetLocal(addrLocal, &addrIPv4) && nNameRetry<3)
strMyName = EncodeAddress(GetLocalAddress(&addrConnect)); strMyName = EncodeAddress(GetLocalAddress(&addrConnect));
if (strMyName == "") if (strMyName == "")
strMyName = strprintf("x%"PRI64u"", GetRand(1000000000)); strMyName = strprintf("x%" PRI64u "", GetRand(1000000000));
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str()); Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
Send(hSocket, strprintf("USER %s 8 * : %s\r", strMyName.c_str(), strMyName.c_str()).c_str()); Send(hSocket, strprintf("USER %s 8 * : %s\r", strMyName.c_str(), strMyName.c_str()).c_str());

View File

@ -308,7 +308,7 @@ bool AddOrphanTx(const CTransaction& tx)
BOOST_FOREACH(const CTxIn& txin, tx.vin) BOOST_FOREACH(const CTxIn& txin, tx.vin)
mapOrphanTransactionsByPrev[txin.prevout.hash].insert(hash); mapOrphanTransactionsByPrev[txin.prevout.hash].insert(hash);
printf("stored orphan tx %s (mapsz %"PRIszu")\n", hash.ToString().c_str(), printf("stored orphan tx %s (mapsz %" PRIszu ")\n", hash.ToString().c_str(),
mapOrphanTransactions.size()); mapOrphanTransactions.size());
return true; return true;
} }
@ -759,7 +759,7 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fCheckIn
// Don't accept it if it can't get into a block // Don't accept it if it can't get into a block
int64 txMinFee = tx.GetMinFee(1000, true, GMF_RELAY); int64 txMinFee = tx.GetMinFee(1000, true, GMF_RELAY);
if (fLimitFree && nFees < txMinFee) if (fLimitFree && nFees < txMinFee)
return error("CTxMemPool::accept() : not enough fees %s, %"PRI64d" < %"PRI64d, return error("CTxMemPool::accept() : not enough fees %s, %" PRI64d " < %" PRI64d,
hash.ToString().c_str(), hash.ToString().c_str(),
nFees, txMinFee); nFees, txMinFee);
@ -1247,7 +1247,7 @@ unsigned int static OldGetNextWorkRequired(const CBlockIndex* pindexLast, const
int64 nActualTimespanMax = fNewDifficultyProtocol ? (nTargetTimespanCurrent*4) : ((nTargetTimespanCurrent*99)/70); int64 nActualTimespanMax = fNewDifficultyProtocol ? (nTargetTimespanCurrent*4) : ((nTargetTimespanCurrent*99)/70);
int64 nActualTimespanMin = fNewDifficultyProtocol ? (nTargetTimespanCurrent/4) : ((nTargetTimespanCurrent*70)/99); int64 nActualTimespanMin = fNewDifficultyProtocol ? (nTargetTimespanCurrent/4) : ((nTargetTimespanCurrent*70)/99);
#ifdef __DEBUG #ifdef __DEBUG
printf(" nActualTimespan = %"PRI64d" before bounds\n", nActualTimespan); printf(" nActualTimespan = %" PRI64d " before bounds\n", nActualTimespan);
#endif #endif
if (pindexLast->nHeight+1 >= nDifficultySwitchHeight2) { if (pindexLast->nHeight+1 >= nDifficultySwitchHeight2) {
if (nActualTimespan < nActualTimespanMin) if (nActualTimespan < nActualTimespanMin)
@ -1282,7 +1282,7 @@ unsigned int static OldGetNextWorkRequired(const CBlockIndex* pindexLast, const
/// debug print /// debug print
#ifdef __DEBUG #ifdef __DEBUG
printf("OldGetNextWorkRequired RETARGET\n"); printf("OldGetNextWorkRequired RETARGET\n");
printf("nTargetTimespan = %"PRI64d" nActualTimespan = %"PRI64d"\n", nTargetTimespan, nActualTimespan); printf("nTargetTimespan = %" PRI64d " nActualTimespan = %" PRI64d "\n", nTargetTimespan, nActualTimespan);
printf("Before: %08x %s\n", pindexLast->nBits, CBigNum().SetCompact(pindexLast->nBits).getuint256().ToString().c_str()); printf("Before: %08x %s\n", pindexLast->nBits, CBigNum().SetCompact(pindexLast->nBits).getuint256().ToString().c_str());
printf("After: %08x %s\n", bnNew.GetCompact(), bnNew.getuint256().ToString().c_str()); printf("After: %08x %s\n", bnNew.GetCompact(), bnNew.getuint256().ToString().c_str());
#endif #endif
@ -1844,7 +1844,7 @@ bool CBlock::ConnectBlock(CValidationState &state, CBlockIndex* pindex, CCoinsVi
printf("- Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin)\n", (unsigned)vtx.size(), 0.001 * nTime, 0.001 * nTime / vtx.size(), nInputs <= 1 ? 0 : 0.001 * nTime / (nInputs-1)); printf("- Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin)\n", (unsigned)vtx.size(), 0.001 * nTime, 0.001 * nTime / vtx.size(), nInputs <= 1 ? 0 : 0.001 * nTime / (nInputs-1));
if (vtx[0].GetValueOut() > GetBlockValue(pindex->nHeight, nFees)) if (vtx[0].GetValueOut() > GetBlockValue(pindex->nHeight, nFees))
return state.DoS(100, error("ConnectBlock() : coinbase pays too much (actual=%"PRI64d" vs limit=%"PRI64d")", vtx[0].GetValueOut(), GetBlockValue(pindex->nHeight, nFees))); return state.DoS(100, error("ConnectBlock() : coinbase pays too much (actual=%" PRI64d " vs limit=%" PRI64d ")", vtx[0].GetValueOut(), GetBlockValue(pindex->nHeight, nFees)));
if (!control.Wait()) if (!control.Wait())
return state.DoS(100, false); return state.DoS(100, false);
@ -1924,8 +1924,8 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
reverse(vConnect.begin(), vConnect.end()); reverse(vConnect.begin(), vConnect.end());
if (vDisconnect.size() > 0) { if (vDisconnect.size() > 0) {
printf("REORGANIZE: Disconnect %"PRIszu" blocks; %s..\n", vDisconnect.size(), pfork->GetBlockHash().ToString().c_str()); printf("REORGANIZE: Disconnect %" PRIszu " blocks; %s..\n", vDisconnect.size(), pfork->GetBlockHash().ToString().c_str());
printf("REORGANIZE: Connect %"PRIszu" blocks; ..%s\n", vConnect.size(), pindexNew->GetBlockHash().ToString().c_str()); printf("REORGANIZE: Connect %" PRIszu " blocks; ..%s\n", vConnect.size(), pindexNew->GetBlockHash().ToString().c_str());
} }
// Disconnect shorter branch // Disconnect shorter branch
@ -3024,7 +3024,7 @@ void PrintBlockTree()
// print item // print item
CBlock block; CBlock block;
block.ReadFromDisk(pindex); block.ReadFromDisk(pindex);
printf("%d (blk%05u.dat:0x%x) %s tx %"PRIszu"", printf("%d (blk%05u.dat:0x%x) %s tx %" PRIszu "",
pindex->nHeight, pindex->nHeight,
pindex->GetBlockPos().nFile, pindex->GetBlockPos().nPos, pindex->GetBlockPos().nFile, pindex->GetBlockPos().nPos,
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", block.GetBlockTime()).c_str(), DateTimeStrFormat("%Y-%m-%d %H:%M:%S", block.GetBlockTime()).c_str(),
@ -3117,7 +3117,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
AbortNode(_("Error: system error: ") + e.what()); AbortNode(_("Error: system error: ") + e.what());
} }
if (nLoaded > 0) if (nLoaded > 0)
printf("Loaded %i blocks from external file in %"PRI64d"ms\n", nLoaded, GetTimeMillis() - nStart); printf("Loaded %i blocks from external file in %" PRI64d "ms\n", nLoaded, GetTimeMillis() - nStart);
return nLoaded > 0; return nLoaded > 0;
} }
@ -3369,7 +3369,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{ {
RandAddSeedPerfmon(); RandAddSeedPerfmon();
if (fDebug) if (fDebug)
printf("received: %s (%"PRIszu" bytes)\n", strCommand.c_str(), vRecv.size()); printf("received: %s (%" PRIszu " bytes)\n", strCommand.c_str(), vRecv.size());
if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0) if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0)
{ {
printf("dropmessagestest DROPPING RECV MESSAGE\n"); printf("dropmessagestest DROPPING RECV MESSAGE\n");
@ -3515,7 +3515,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (vAddr.size() > 1000) if (vAddr.size() > 1000)
{ {
pfrom->Misbehaving(20); pfrom->Misbehaving(20);
return error("message addr size() = %"PRIszu"", vAddr.size()); return error("message addr size() = %" PRIszu "", vAddr.size());
} }
// Store the new addresses // Store the new addresses
@ -3578,7 +3578,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (vInv.size() > MAX_INV_SZ) if (vInv.size() > MAX_INV_SZ)
{ {
pfrom->Misbehaving(20); pfrom->Misbehaving(20);
return error("message inv size() = %"PRIszu"", vInv.size()); return error("message inv size() = %" PRIszu "", vInv.size());
} }
// find last block in inv vector // find last block in inv vector
@ -3627,11 +3627,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (vInv.size() > MAX_INV_SZ) if (vInv.size() > MAX_INV_SZ)
{ {
pfrom->Misbehaving(20); pfrom->Misbehaving(20);
return error("message getdata size() = %"PRIszu"", vInv.size()); return error("message getdata size() = %" PRIszu "", vInv.size());
} }
if (fDebugNet || (vInv.size() != 1)) if (fDebugNet || (vInv.size() != 1))
printf("received getdata (%"PRIszu" invsz)\n", vInv.size()); printf("received getdata (%" PRIszu " invsz)\n", vInv.size());
if ((fDebugNet && vInv.size() > 0) || (vInv.size() == 1)) if ((fDebugNet && vInv.size() > 0) || (vInv.size() == 1))
printf("received getdata for: %s\n", vInv[0].ToString().c_str()); printf("received getdata for: %s\n", vInv[0].ToString().c_str());
@ -3732,7 +3732,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
vWorkQueue.push_back(inv.hash); vWorkQueue.push_back(inv.hash);
vEraseQueue.push_back(inv.hash); vEraseQueue.push_back(inv.hash);
printf("AcceptToMemoryPool: %s %s : accepted %s (poolsz %"PRIszu")\n", printf("AcceptToMemoryPool: %s %s : accepted %s (poolsz %" PRIszu ")\n",
pfrom->addr.ToString().c_str(), pfrom->strSubVer.c_str(), pfrom->addr.ToString().c_str(), pfrom->strSubVer.c_str(),
tx.GetHash().ToString().c_str(), tx.GetHash().ToString().c_str(),
mempool.mapTx.size()); mempool.mapTx.size());
@ -4581,7 +4581,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
nLastBlockTx = nBlockTx; nLastBlockTx = nBlockTx;
nLastBlockSize = nBlockSize; nLastBlockSize = nBlockSize;
printf("CreateNewBlock(): total size %"PRI64u"\n", nBlockSize); printf("CreateNewBlock(): total size %" PRI64u "\n", nBlockSize);
pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees); pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees);
pblocktemplate->vTxFees[0] = -nFees; pblocktemplate->vTxFees[0] = -nFees;
@ -4745,7 +4745,7 @@ void static GostcoinMiner(CWallet *pwallet)
CBlock *pblock = &pblocktemplate->block; CBlock *pblock = &pblocktemplate->block;
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce); IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
printf("Running GostcoinMiner with %"PRIszu" transactions in block (%u bytes)\n", pblock->vtx.size(), printf("Running GostcoinMiner with %" PRIszu " transactions in block (%u bytes)\n", pblock->vtx.size(),
::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION)); ::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION));
// //

View File

@ -449,7 +449,7 @@ public:
{ {
if (scriptPubKey.size() < 6) if (scriptPubKey.size() < 6)
return "CTxOut(error)"; return "CTxOut(error)";
return strprintf("CTxOut(nValue=%"PRI64d".%08"PRI64d", scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30).c_str()); return strprintf("CTxOut(nValue=%" PRI64d ".%08" PRI64d ", scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30).c_str());
} }
void print() const void print() const
@ -645,7 +645,7 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach
std::string ToString() const std::string ToString() const
{ {
std::string str; std::string str;
str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%"PRIszu", vout.size=%"PRIszu", nLockTime=%u)\n", str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%" PRIszu ", vout.size=%" PRIszu ", nLockTime=%u)\n",
GetHash().ToString().c_str(), GetHash().ToString().c_str(),
nVersion, nVersion,
vin.size(), vin.size(),
@ -1482,7 +1482,7 @@ public:
void print() const void print() const
{ {
printf("CBlock(hash=%s, input=%s, PoW=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%"PRIszu")\n", printf("CBlock(hash=%s, input=%s, PoW=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%" PRIszu ")\n",
GetHash().ToString().c_str(), GetHash().ToString().c_str(),
HexStr(BEGIN(nVersion),BEGIN(nVersion)+80,false).c_str(), HexStr(BEGIN(nVersion),BEGIN(nVersion)+80,false).c_str(),
GetHash().ToString().c_str(), GetHash().ToString().c_str(),

View File

@ -1490,7 +1490,7 @@ void DumpAddresses()
CAddrDB adb; CAddrDB adb;
adb.Write(addrman); adb.Write(addrman);
printf("Flushed %d addresses to peers.dat %"PRI64d"ms\n", printf("Flushed %d addresses to peers.dat %" PRI64d "ms\n",
addrman.size(), GetTimeMillis() - nStart); addrman.size(), GetTimeMillis() - nStart);
} }

View File

@ -404,7 +404,7 @@ public:
else else
nRequestTime = 0; nRequestTime = 0;
if (fDebugNet) if (fDebugNet)
printf("askfor %s %"PRI64d" (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str()); printf("askfor %s %" PRI64d " (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str());
// Make sure not to reuse time indexes to keep things in the same order // Make sure not to reuse time indexes to keep things in the same order
int64 nNow = (GetTime() - 1) * 1000000; int64 nNow = (GetTime() - 1) * 1000000;

View File

@ -48,7 +48,7 @@ Value getpeerinfo(const Array& params, bool fHelp)
Object obj; Object obj;
obj.push_back(Pair("addr", stats.addrName)); obj.push_back(Pair("addr", stats.addrName));
obj.push_back(Pair("services", strprintf("%08"PRI64x, stats.nServices))); obj.push_back(Pair("services", strprintf("%08" PRI64x, stats.nServices)));
obj.push_back(Pair("lastsend", (boost::int64_t)stats.nLastSend)); obj.push_back(Pair("lastsend", (boost::int64_t)stats.nLastSend));
obj.push_back(Pair("lastrecv", (boost::int64_t)stats.nLastRecv)); obj.push_back(Pair("lastrecv", (boost::int64_t)stats.nLastRecv));
obj.push_back(Pair("bytessent", (boost::int64_t)stats.nSendBytes)); obj.push_back(Pair("bytessent", (boost::int64_t)stats.nSendBytes));

View File

@ -743,7 +743,7 @@ static CScript _createmultisig(const Array& params)
if ((int)keys.size() < nRequired) if ((int)keys.size() < nRequired)
throw runtime_error( throw runtime_error(
strprintf("not enough keys supplied " strprintf("not enough keys supplied "
"(got %"PRIszu" keys, but need at least %d to redeem)", keys.size(), nRequired)); "(got %" PRIszu " keys, but need at least %d to redeem)", keys.size(), nRequired));
std::vector<CPubKey> pubkeys; std::vector<CPubKey> pubkeys;
pubkeys.resize(keys.size()); pubkeys.resize(keys.size());
for (unsigned int i = 0; i < keys.size(); i++) for (unsigned int i = 0; i < keys.size(); i++)

View File

@ -400,7 +400,7 @@ string FormatMoney(int64 n, bool fPlus)
int64 n_abs = (n > 0 ? n : -n); int64 n_abs = (n > 0 ? n : -n);
int64 quotient = n_abs/COIN; int64 quotient = n_abs/COIN;
int64 remainder = n_abs%COIN; int64 remainder = n_abs%COIN;
string str = strprintf("%"PRI64d".%08"PRI64d, quotient, remainder); string str = strprintf("%" PRI64d ".%08" PRI64d, quotient, remainder);
// Right-trim excess zeros before the decimal point: // Right-trim excess zeros before the decimal point:
int nTrim = 0; int nTrim = 0;
@ -1370,7 +1370,7 @@ void AddTimeData(const CNetAddr& ip, int64 nTime)
// Add data // Add data
vTimeOffsets.input(nOffsetSample); vTimeOffsets.input(nOffsetSample);
printf("Added time data, samples %d, offset %+"PRI64d" (%+"PRI64d" minutes)\n", vTimeOffsets.size(), nOffsetSample, nOffsetSample/60); printf("Added time data, samples %d, offset %+" PRI64d" (%+" PRI64d " minutes)\n", vTimeOffsets.size(), nOffsetSample, nOffsetSample/60);
if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1) if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1)
{ {
int64 nMedian = vTimeOffsets.median(); int64 nMedian = vTimeOffsets.median();
@ -1405,10 +1405,10 @@ void AddTimeData(const CNetAddr& ip, int64 nTime)
} }
if (fDebug) { if (fDebug) {
BOOST_FOREACH(int64 n, vSorted) BOOST_FOREACH(int64 n, vSorted)
printf("%+"PRI64d" ", n); printf("%+" PRI64d " ", n);
printf("| "); printf("| ");
} }
printf("nTimeOffset = %+"PRI64d" (%+"PRI64d" minutes)\n", nTimeOffset, nTimeOffset/60); printf("nTimeOffset = %+" PRI64d " (%+" PRI64d " minutes)\n", nTimeOffset, nTimeOffset/60);
} }
} }

View File

@ -247,7 +247,7 @@ std::string FormatI2PNativeFullVersion();
inline std::string i64tostr(int64 n) inline std::string i64tostr(int64 n)
{ {
return strprintf("%"PRI64d, n); return strprintf("%" PRI64d, n);
} }
inline std::string itostr(int n) inline std::string itostr(int n)

View File

@ -1480,7 +1480,7 @@ void CWallet::PrintWallet(const CBlock& block)
if (mapWallet.count(block.vtx[0].GetHash())) if (mapWallet.count(block.vtx[0].GetHash()))
{ {
CWalletTx& wtx = mapWallet[block.vtx[0].GetHash()]; CWalletTx& wtx = mapWallet[block.vtx[0].GetHash()];
printf(" mine: %d %d %"PRI64d"", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit()); printf(" mine: %d %d %" PRI64d "", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit());
} }
} }
printf("\n"); printf("\n");
@ -1542,7 +1542,7 @@ bool CWallet::NewKeyPool()
walletdb.WritePool(nIndex, CKeyPool(GenerateNewKey())); walletdb.WritePool(nIndex, CKeyPool(GenerateNewKey()));
setKeyPool.insert(nIndex); setKeyPool.insert(nIndex);
} }
printf("CWallet::NewKeyPool wrote %"PRI64d" new keys\n", nKeys); printf("CWallet::NewKeyPool wrote %" PRI64d " new keys\n", nKeys);
} }
return true; return true;
} }
@ -1567,7 +1567,7 @@ bool CWallet::TopUpKeyPool()
if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey()))) if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey())))
throw runtime_error("TopUpKeyPool() : writing generated key failed"); throw runtime_error("TopUpKeyPool() : writing generated key failed");
setKeyPool.insert(nEnd); setKeyPool.insert(nEnd);
printf("keypool added key %"PRI64d", size=%"PRIszu"\n", nEnd, setKeyPool.size()); printf("keypool added key %" PRI64d ", size=%" PRIszu "\n", nEnd, setKeyPool.size());
} }
} }
return true; return true;
@ -1596,7 +1596,7 @@ void CWallet::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool)
if (!HaveKey(keypool.vchPubKey.GetID())) if (!HaveKey(keypool.vchPubKey.GetID()))
throw runtime_error("ReserveKeyFromKeyPool() : unknown key in key pool"); throw runtime_error("ReserveKeyFromKeyPool() : unknown key in key pool");
assert(keypool.vchPubKey.IsValid()); assert(keypool.vchPubKey.IsValid());
printf("keypool reserve %"PRI64d"\n", nIndex); printf("keypool reserve %" PRI64d "\n", nIndex);
} }
} }
@ -1623,7 +1623,7 @@ void CWallet::KeepKey(int64 nIndex)
CWalletDB walletdb(strWalletFile); CWalletDB walletdb(strWalletFile);
walletdb.ErasePool(nIndex); walletdb.ErasePool(nIndex);
} }
printf("keypool keep %"PRI64d"\n", nIndex); printf("keypool keep %" PRI64d "\n", nIndex);
} }
void CWallet::ReturnKey(int64 nIndex) void CWallet::ReturnKey(int64 nIndex)
@ -1633,7 +1633,7 @@ void CWallet::ReturnKey(int64 nIndex)
LOCK(cs_wallet); LOCK(cs_wallet);
setKeyPool.insert(nIndex); setKeyPool.insert(nIndex);
} }
printf("keypool return %"PRI64d"\n", nIndex); printf("keypool return %" PRI64d "\n", nIndex);
} }
bool CWallet::GetKeyFromPool(CPubKey& result, bool fAllowReuse) bool CWallet::GetKeyFromPool(CPubKey& result, bool fAllowReuse)

View File

@ -237,7 +237,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
//// debug print //// debug print
//printf("LoadWallet %s\n", wtx.GetHash().ToString().c_str()); //printf("LoadWallet %s\n", wtx.GetHash().ToString().c_str());
//printf(" %12"PRI64d" %s %s %s\n", //printf(" %12" PRI64d " %s %s %s\n",
// wtx.vout[0].nValue, // wtx.vout[0].nValue,
// DateTimeStrFormat("%Y-%m-%d %H:%M:%S", wtx.GetBlockTime()).c_str(), // DateTimeStrFormat("%Y-%m-%d %H:%M:%S", wtx.GetBlockTime()).c_str(),
// wtx.hashBlock.ToString().c_str(), // wtx.hashBlock.ToString().c_str(),
@ -519,7 +519,7 @@ void ThreadFlushWalletDB(const string& strFile)
bitdb.CheckpointLSN(strFile); bitdb.CheckpointLSN(strFile);
bitdb.mapFileUseCount.erase(mi++); bitdb.mapFileUseCount.erase(mi++);
printf("Flushed wallet.dat %"PRI64d"ms\n", GetTimeMillis() - nStart); printf("Flushed wallet.dat %" PRI64d "ms\n", GetTimeMillis() - nStart);
} }
} }
} }
@ -580,7 +580,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys)
// Set -rescan so any missing transactions will be // Set -rescan so any missing transactions will be
// found. // found.
int64 now = GetTime(); int64 now = GetTime();
std::string newFilename = strprintf("wallet.%"PRI64d".bak", now); std::string newFilename = strprintf("wallet.%" PRI64d ".bak", now);
int result = dbenv.dbenv.dbrename(NULL, filename.c_str(), NULL, int result = dbenv.dbenv.dbrename(NULL, filename.c_str(), NULL,
newFilename.c_str(), DB_AUTO_COMMIT); newFilename.c_str(), DB_AUTO_COMMIT);
@ -599,7 +599,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys)
printf("Salvage(aggressive) found no records in %s.\n", newFilename.c_str()); printf("Salvage(aggressive) found no records in %s.\n", newFilename.c_str());
return false; return false;
} }
printf("Salvage(aggressive) found %"PRIszu" records\n", salvagedData.size()); printf("Salvage(aggressive) found %" PRIszu " records\n", salvagedData.size());
bool fSuccess = allOK; bool fSuccess = allOK;
Db* pdbCopy = new Db(&dbenv.dbenv, 0); Db* pdbCopy = new Db(&dbenv.dbenv, 0);