Permalink
Browse files

Merge remote-tracking branch 'github-2/master'

# Conflicts:
#	datacoin-qt.pro
#	src/alert.cpp
#	src/bitcoinrpc.cpp
#	src/db.cpp
#	src/init.cpp
#	src/main.cpp
#	src/main.h
#	src/net.cpp
#	src/net.h
#	src/prime.cpp
#	src/qt/bitcoin.qrc
#	src/qt/guiutil.cpp
#	src/qt/macdockiconhandler.mm
#	src/qt/res/icons/datacoin-testnet.png
#	src/qt/res/images/splash.png
#	src/qt/res/images/splash_testnet.png
#	src/qt/splashscreen.cpp
#	src/rpcwallet.cpp
#	src/util.cpp
#	src/wallet.cpp
#	src/walletdb.cpp
  • Loading branch information...
gjhiggins committed Apr 3, 2018
2 parents d778f71 + dcbe546 commit d4391daebded5884ed696b3a9dce35c9a12cff74
Showing with 64 additions and 50 deletions.
  1. +2 −2 src/bitcoinrpc.cpp
  2. +1 −1 src/db.cpp
  3. +9 −9 src/init.cpp
  4. +17 −14 src/main.cpp
  5. +3 −3 src/main.h
  6. +2 −1 src/makefile.unix
  7. +3 −2 src/net.cpp
  8. +1 −1 src/net.h
  9. +2 −2 src/prime.cpp
  10. +4 −0 src/qt/sendcoinsdialog.cpp
  11. +2 −1 src/rpcwallet.cpp
  12. +4 −4 src/util.cpp
  13. +10 −6 src/wallet.cpp
  14. +4 −4 src/walletdb.cpp
View
@@ -362,7 +362,7 @@ static string HTTPReply(int nStatus, const string& strMsg, bool keepalive)
"HTTP/1.1 %d %s\r\n"
"Date: %s\r\n"
"Connection: %s\r\n"
"Content-Length: %" PRIszu"\r\n"
"Content-Length: %" PRIszu "\r\n"
"Content-Type: application/json\r\n"
"Server: datacoin-json-rpc/%s\r\n"
"\r\n"
@@ -429,7 +429,7 @@ int ReadHTTPStatus(std::basic_istream<char>& stream, int &proto)
int ReadHTTPHeaders(std::basic_istream<char>& stream, map<string, string>& mapHeadersRet)
{
int nLen = 0;
while (true)
while (true)
{
string str;
std::getline(stream, str);
View
@@ -457,7 +457,7 @@ void CDBEnv::Flush(bool fShutdown)
else
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)
{
char** listp;
View
@@ -653,7 +653,7 @@ bool AppInit2(boost::thread_group& threadGroup)
{
// try moving the database env out of the way
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 {
boost::filesystem::rename(pathDatabase, pathDatabaseBak);
printf("Moved old %s to %s. Retrying.\n", pathDatabase.string().c_str(), pathDatabaseBak.string().c_str());
@@ -913,7 +913,7 @@ bool AppInit2(boost::thread_group& threadGroup)
printf("Shutdown requested. Exiting.\n");
return false;
}
printf(" block index %15" PRI64d"ms\n", GetTimeMillis() - nStart);
printf(" block index %15" PRI64d "ms\n", GetTimeMillis() - nStart);
if (mapArgs.count("-printblock"))
{
@@ -1000,7 +1000,7 @@ bool AppInit2(boost::thread_group& threadGroup)
}
printf("%s", strErrors.str().c_str());
printf(" wallet %15" PRI64d"ms\n", GetTimeMillis() - nStart);
printf(" wallet %15" PRI64d "ms\n", GetTimeMillis() - nStart);
RegisterWallet(pwalletMain);
@@ -1028,7 +1028,7 @@ bool AppInit2(boost::thread_group& threadGroup)
printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight);
nStart = GetTimeMillis();
pwalletMain->ScanForWalletTransactions(pindexRescan, true);
printf(" rescan %15" PRI64d"ms\n", GetTimeMillis() - nStart);
printf(" rescan %15" PRI64d "ms\n", GetTimeMillis() - nStart);
pwalletMain->SetBestChain(CBlockLocator(pindexBest));
nWalletDBUpdated++;
}
@@ -1060,7 +1060,7 @@ bool AppInit2(boost::thread_group& threadGroup)
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);
// ********************************************************* Step 11: start node
@@ -1074,11 +1074,11 @@ bool AppInit2(boost::thread_group& threadGroup)
RandAddSeedPerfmon();
//// debug print
printf("mapBlockIndex.size() = %" PRIszu"\n", mapBlockIndex.size());
printf("mapBlockIndex.size() = %" PRIszu "\n", mapBlockIndex.size());
printf("nBestHeight = %d\n", nBestHeight);
printf("setKeyPool.size() = %" PRIszu"\n", pwalletMain->setKeyPool.size());
printf("mapWallet.size() = %" PRIszu"\n", pwalletMain->mapWallet.size());
printf("mapAddressBook.size() = %" PRIszu"\n", pwalletMain->mapAddressBook.size());
printf("setKeyPool.size() = %" PRIszu "\n", pwalletMain->setKeyPool.size());
printf("mapWallet.size() = %" PRIszu "\n", pwalletMain->mapWallet.size());
printf("mapAddressBook.size() = %" PRIszu "\n", pwalletMain->mapAddressBook.size());
StartNode(threadGroup);
View
@@ -313,7 +313,7 @@ bool AddOrphanTx(const CTransaction& tx)
BOOST_FOREACH(const CTxIn& txin, tx.vin)
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());
return true;
}
@@ -769,7 +769,7 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fCheckIn
// Don't accept it if it can't get into a block
int64 txMinFee = tx.GetMinFee(1000, false, GMF_RELAY);
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(),
nFees, txMinFee);
@@ -821,6 +821,9 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fCheckIn
EraseFromWallets(ptxOld->GetHash());
SyncWithWallets(hash, tx, NULL, true);
printf("CTxMemPool::accept() : accepted %s (poolsz %" PRIszu ")\n",
hash.ToString().c_str(),
mapTx.size());
return true;
}
@@ -1742,8 +1745,8 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
reverse(vConnect.begin(), vConnect.end());
if (vDisconnect.size() > 0) {
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: 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());
}
// Disconnect shorter branch
@@ -2840,7 +2843,7 @@ void PrintBlockTree()
// print item
CBlock block;
block.ReadFromDisk(pindex);
printf("%d (blk%05u.dat:0x%x) %s %s tx %" PRIszu"",
printf("%d (blk%05u.dat:0x%x) %s %s tx %" PRIszu "",
pindex->nHeight,
pindex->GetBlockPos().nFile, pindex->GetBlockPos().nPos,
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", block.GetBlockTime()).c_str(),
@@ -2933,7 +2936,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
AbortNode(_("Error: system error: ") + e.what());
}
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;
}
@@ -3161,7 +3164,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{
RandAddSeedPerfmon();
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)
{
printf("dropmessagestest DROPPING RECV MESSAGE\n");
@@ -3301,7 +3304,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (vAddr.size() > 1000)
{
pfrom->Misbehaving(20);
return error("message addr size() = %" PRIszu"", vAddr.size());
return error("message addr size() = %" PRIszu "", vAddr.size());
}
// Store the new addresses
@@ -3364,7 +3367,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (vInv.size() > MAX_INV_SZ)
{
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
@@ -3413,11 +3416,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (vInv.size() > MAX_INV_SZ)
{
pfrom->Misbehaving(20);
return error("message getdata size() = %" PRIszu"", vInv.size());
return error("message getdata size() = %" PRIszu "", vInv.size());
}
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))
printf("received getdata for: %s\n", vInv[0].ToString().c_str());
@@ -4579,7 +4582,7 @@ void static BitcoinMiner(CWallet *pwallet)
// Print the chosen extra nonce for debugging
printf("BitcoinMiner() : Setting initial extra nonce to %u\n", nExtraNonce);
try { while(true) {
try { while (true) {
while (vNodes.empty())
MilliSleep(1000);
@@ -4602,7 +4605,7 @@ void static BitcoinMiner(CWallet *pwallet)
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce, true);
if (fDebug && GetBoolArg("-printmining"))
printf("Running DatacoinMiner with %" PRIszu" transactions in block (%u bytes)\n", pblock->vtx.size(),
printf("Running DatacoinMiner with %" PRIszu " transactions in block (%u bytes)\n", pblock->vtx.size(),
::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION));
//
@@ -4650,7 +4653,7 @@ void static BitcoinMiner(CWallet *pwallet)
int64 nPrimeTimerStart = GetTimeMicros();
Primorial(nPrimorialMultiplier, mpzPrimorial);
while (true)
while (true)
{
unsigned int nTests = 0;
unsigned int nPrimesHit = 0;
View
@@ -458,7 +458,7 @@ class CTxOut
{
if (scriptPubKey.size() < 6)
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
@@ -658,7 +658,7 @@ class CTransaction
std::string ToString() const
{
std::string str;
str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%" PRIszu", vout.size=%" PRIszu", nLockTime=%u, data.size=%" PRIszu")\n",
str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%" PRIszu ", vout.size=%" PRIszu ", nLockTime=%u, data.size=%" PRIszu ")\n",
GetHash().ToString().c_str(),
nVersion,
vin.size(),
@@ -1516,7 +1516,7 @@ class CBlock : public CBlockHeader
void print() const
{
printf("CBlock(hash=%s, hashBlockHeader=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%" PRIszu")\n",
printf("CBlock(hash=%s, hashBlockHeader=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%" PRIszu ")\n",
GetHash().ToString().c_str(),
GetHeaderHash().ToString().c_str(),
nVersion,
View
@@ -3,10 +3,11 @@
# Distributed under conditional MIT/X11 software license,
# see the accompanying file COPYING
STATIC:=1
# :=0 --> UPnP support turned off by default at runtime
# :=1 --> UPnP support turned on by default at runtime
# :=- --> No UPnP support - miniupnp not required
USE_UPNP:=0
USE_UPNP:=-
# :=1 --> Enable IPv6 support
# :=0 --> Disable IPv6 support
View
@@ -138,7 +138,7 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer)
bool RecvLine(SOCKET hSocket, string& strLine)
{
strLine = "";
while (true)
while (true)
{
char c;
int nBytes = recv(hSocket, &c, 1, 0);
@@ -753,6 +753,7 @@ static list<CNode*> vNodesDisconnected;
void ThreadSocketHandler()
{
unsigned int nPrevNodeCount = 0;
while (true)
{
//
@@ -1260,7 +1261,7 @@ void DumpAddresses()
CAddrDB adb;
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);
}
View
@@ -363,7 +363,7 @@ class CNode
else
nRequestTime = 0;
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
int64 nNow = (GetTime() - 1) * 1000000;
View
@@ -361,7 +361,7 @@ bool TargetGetNext(unsigned int nBits, int64 nInterval, int64 nTargetSpacing, in
bnFractionalDifficulty = nFractionalDifficultyMin;
uint64 nFractionalDifficultyNew = bnFractionalDifficulty.getuint256().Get64();
if (fDebug && GetBoolArg("-printtarget"))
printf("TargetGetNext() : nActualSpacing=%d nFractionDiff=%016" PRI64x" nFractionDiffNew=%016" PRI64x"\n", (int)nActualSpacing, nFractionalDifficulty, nFractionalDifficultyNew);
printf("TargetGetNext() : nActualSpacing=%d nFractionDiff=%016" PRI64x " nFractionDiffNew=%016" PRI64x "\n", (int)nActualSpacing, nFractionalDifficulty, nFractionalDifficultyNew);
// Step up length if fractional past threshold
if (nFractionalDifficultyNew > nFractionalDifficultyThreshold)
{
@@ -376,7 +376,7 @@ bool TargetGetNext(unsigned int nBits, int64 nInterval, int64 nTargetSpacing, in
}
// Convert fractional difficulty back to length
if (!TargetSetFractionalDifficulty(nFractionalDifficultyNew, nBitsNext))
return error("TargetGetNext() : unable to set fractional difficulty prev=0x%016" PRI64x" new=0x%016" PRI64x, nFractionalDifficulty, nFractionalDifficultyNew);
return error("TargetGetNext() : unable to set fractional difficulty prev=0x%016" PRI64x " new=0x%016" PRI64x, nFractionalDifficulty, nFractionalDifficultyNew);
return true;
}
@@ -26,6 +26,10 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
ui->clearButton->setIcon(QIcon());
ui->sendButton->setIcon(QIcon());
#endif
#if QT_VERSION >= 0x040700
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
// ui->lineEditCoinControlChange->setPlaceholderText(tr("Enter a Datacoin address (e.g. DAYGPJgC8hzJhycJxTzj3SisDngxaAcdU5)"));
#endif
addEntry();
View
@@ -312,6 +312,7 @@ Value senddata(const Array& params, bool fHelp)
}
string strError = pwalletMain->SendData(wtx, false, txdata);
if (strError != "")
throw JSONRPCError(RPC_WALLET_ERROR, strError);
@@ -795,7 +796,7 @@ static CScript _createmultisig(const Array& params)
if ((int)keys.size() < nRequired)
throw runtime_error(
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<CKey> pubkeys;
pubkeys.resize(keys.size());
for (unsigned int i = 0; i < keys.size(); i++)
View
@@ -394,7 +394,7 @@ string FormatMoney(int64 n, bool fPlus)
int64 n_abs = (n > 0 ? n : -n);
int64 quotient = 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:
int nTrim = 0;
@@ -1331,7 +1331,7 @@ void AddTimeData(const CNetAddr& ip, int64 nTime)
// Add data
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)
{
int64 nMedian = vTimeOffsets.median();
@@ -1366,10 +1366,10 @@ void AddTimeData(const CNetAddr& ip, int64 nTime)
}
if (fDebug) {
BOOST_FOREACH(int64 n, vSorted)
printf("%+" PRI64d" ", n);
printf("%+" PRI64d " ", n);
printf("| ");
}
printf("nTimeOffset = %+" PRI64d" (%+" PRI64d" minutes)\n", nTimeOffset, nTimeOffset/60);
printf("nTimeOffset = %+" PRI64d " (%+" PRI64d " minutes)\n", nTimeOffset, nTimeOffset/60);
}
}
Oops, something went wrong.

0 comments on commit d4391da

Please sign in to comment.