mirror of
https://github.com/cygnusxi/CurecoinSource.git
synced 2025-07-27 15:44:25 +02:00
commit
4f82c05182
@ -4,6 +4,12 @@ VERSION = 1.0.0
|
||||
INCLUDEPATH += src src/json src/qt
|
||||
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN __NO_SYSTEM_INCLUDES
|
||||
CONFIG += no_include_pwd
|
||||
QT += core gui network
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
QT += widgets printsupport
|
||||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
|
||||
}
|
||||
|
||||
#uncomment the following section to enable building on windows:
|
||||
#windows:LIBS += -lshlwapi
|
||||
|
@ -389,7 +389,7 @@ int ReadHTTPStatus(std::basic_istream<char>& stream, int &proto)
|
||||
int ReadHTTPHeader(std::basic_istream<char>& stream, map<string, string>& mapHeadersRet)
|
||||
{
|
||||
int nLen = 0;
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
string str;
|
||||
std::getline(stream, str);
|
||||
@ -939,7 +939,7 @@ void ThreadRPCServer3(void* parg)
|
||||
AcceptedConnection *conn = (AcceptedConnection *) parg;
|
||||
|
||||
bool fRun = true;
|
||||
loop {
|
||||
while (true) {
|
||||
if (fShutdown || !fRun)
|
||||
{
|
||||
conn->close();
|
||||
|
@ -802,7 +802,7 @@ bool CTxDB::LoadBlockIndexGuts()
|
||||
|
||||
// Load mapBlockIndex
|
||||
unsigned int fFlags = DB_SET_RANGE;
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
// Read next record
|
||||
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
|
||||
|
@ -77,7 +77,7 @@ static bool Send(SOCKET hSocket, const char* pszSend)
|
||||
|
||||
bool RecvLineIRC(SOCKET hSocket, string& strLine)
|
||||
{
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
bool fRet = RecvLine(hSocket, strLine);
|
||||
if (fRet)
|
||||
@ -100,7 +100,7 @@ bool RecvLineIRC(SOCKET hSocket, string& strLine)
|
||||
|
||||
int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const char* psz3=NULL, const char* psz4=NULL)
|
||||
{
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
string strLine;
|
||||
strLine.reserve(10000);
|
||||
@ -135,7 +135,7 @@ bool Wait(int nSeconds)
|
||||
bool RecvCodeLine(SOCKET hSocket, const char* psz1, string& strRet)
|
||||
{
|
||||
strRet.clear();
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
string strLine;
|
||||
if (!RecvLineIRC(hSocket, strLine))
|
||||
|
@ -26,6 +26,7 @@ static std::map<int, unsigned int> mapStakeModifierCheckpoints =
|
||||
( 148000, 0x111af91cu )
|
||||
;
|
||||
|
||||
|
||||
// Get the last stake modifier and its generation time from a given block
|
||||
static bool GetLastStakeModifier(const CBlockIndex* pindex, uint64& nStakeModifier, int64& nModifierTime)
|
||||
{
|
||||
|
@ -2574,7 +2574,7 @@ static unsigned int nCurrentBlockFile = 1;
|
||||
FILE* AppendBlockFile(unsigned int& nFileRet)
|
||||
{
|
||||
nFileRet = 0;
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
FILE* file = OpenBlockFile(nCurrentBlockFile, 0, "ab");
|
||||
if (!file)
|
||||
@ -3656,7 +3656,7 @@ bool ProcessMessages(CNode* pfrom)
|
||||
// (x) data
|
||||
//
|
||||
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
// Don't bother if send buffer is too full to respond anyway
|
||||
if (pfrom->vSend.size() >= SendBufferSize())
|
||||
@ -4538,7 +4538,7 @@ void curecoinMiner(CWallet *pwallet, bool fProofOfStake)
|
||||
uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();
|
||||
uint256 hashbuf[2];
|
||||
uint256& hash = *alignup<16>(hashbuf);
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
unsigned int nHashesDone = 0;
|
||||
unsigned int nNonceFound;
|
||||
|
16
src/net.cpp
16
src/net.cpp
@ -140,7 +140,7 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer)
|
||||
bool RecvLine(SOCKET hSocket, string& strLine)
|
||||
{
|
||||
strLine = "";
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
char c;
|
||||
int nBytes = recv(hSocket, &c, 1, 0);
|
||||
@ -313,7 +313,7 @@ bool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const cha
|
||||
{
|
||||
if (strLine.empty()) // HTTP response is separated from headers by blank line
|
||||
{
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
if (!RecvLine(hSocket, strLine))
|
||||
{
|
||||
@ -665,7 +665,7 @@ void ThreadSocketHandler2(void* parg)
|
||||
list<CNode*> vNodesDisconnected;
|
||||
unsigned int nPrevNodeCount = 0;
|
||||
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
//
|
||||
// Disconnect nodes
|
||||
@ -1078,7 +1078,7 @@ void ThreadMapPort2(void* parg)
|
||||
else
|
||||
printf("UPnP Port Mapping successful.\n");
|
||||
int i = 1;
|
||||
loop {
|
||||
while (true) {
|
||||
if (fShutdown || !fUseUPnP)
|
||||
{
|
||||
r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port.c_str(), "TCP", 0);
|
||||
@ -1113,7 +1113,7 @@ void ThreadMapPort2(void* parg)
|
||||
freeUPNPDevlist(devlist); devlist = 0;
|
||||
if (r != 0)
|
||||
FreeUPNPUrls(&urls);
|
||||
loop {
|
||||
while (true) {
|
||||
if (fShutdown || !fUseUPnP)
|
||||
return;
|
||||
Sleep(2000);
|
||||
@ -1349,7 +1349,7 @@ void ThreadOpenConnections2(void* parg)
|
||||
|
||||
// Initiate network connections
|
||||
int64 nStart = GetTime();
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
ProcessOneShot();
|
||||
|
||||
@ -1408,7 +1408,7 @@ void ThreadOpenConnections2(void* parg)
|
||||
int64 nANow = GetAdjustedTime();
|
||||
|
||||
int nTries = 0;
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
// use an nUnkBias between 10 (no outgoing connections) and 90 (8 outgoing connections)
|
||||
CAddress addr = addrman.Select(10 + min(nOutbound,8)*10);
|
||||
@ -1501,7 +1501,7 @@ void ThreadOpenAddedConnections2(void* parg)
|
||||
}
|
||||
}
|
||||
}
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
vector<vector<CService> > vservConnectAddresses = vservAddressesToAdd;
|
||||
// Attempt to connect to each IP for each addnode entry until at least one is successful per addnode entry
|
||||
|
@ -134,7 +134,7 @@ void AddressBookPage::setModel(AddressTableModel *model)
|
||||
// Set column widths
|
||||
ui->tableView->horizontalHeader()->resizeSection(
|
||||
AddressTableModel::Address, 320);
|
||||
ui->tableView->horizontalHeader()->setResizeMode(
|
||||
ui->tableView->horizontalHeader()->setSectionResizeMode(
|
||||
AddressTableModel::Label, QHeaderView::Stretch);
|
||||
|
||||
connect(ui->tableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||
|
@ -115,11 +115,11 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
// Do this early as we don't want to bother initializing if we are just calling IPC
|
||||
ipcScanRelay(argc, argv);
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
// Internal string conversion is all UTF-8
|
||||
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForTr());
|
||||
|
||||
#endif
|
||||
Q_INIT_RESOURCE(curecoin);
|
||||
QApplication app(argc, argv);
|
||||
|
||||
|
@ -54,6 +54,7 @@
|
||||
#include <QDragEnterEvent>
|
||||
#include <QUrl>
|
||||
#include <QStyle>
|
||||
#include <QtWidgets>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@ -820,7 +821,7 @@ void curecoinGUI::encryptWallet(bool status)
|
||||
|
||||
void curecoinGUI::backupWallet()
|
||||
{
|
||||
QString saveDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
|
||||
QString saveDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
|
||||
QString filename = QFileDialog::getSaveFileName(this, tr("Backup Wallet"), saveDir, tr("Wallet Data (*.dat)"));
|
||||
if(!filename.isEmpty()) {
|
||||
if(!walletModel->backupWallet(filename)) {
|
||||
|
@ -18,6 +18,9 @@
|
||||
#include <QFileDialog>
|
||||
#include <QDesktopServices>
|
||||
#include <QThread>
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
#include <QUrlQuery>
|
||||
#endif
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
@ -84,6 +87,7 @@ bool parsecurecoinURI(const QUrl &uri, SendCoinsRecipient *out)
|
||||
rv.address = uri.path();
|
||||
rv.amount = 0;
|
||||
QList<QPair<QString, QString> > items = uri.queryItems();
|
||||
|
||||
for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++)
|
||||
{
|
||||
bool fShouldReturnFalse = false;
|
||||
@ -136,7 +140,7 @@ bool parsecurecoinURI(QString uri, SendCoinsRecipient *out)
|
||||
|
||||
QString HtmlEscape(const QString& str, bool fMultiLine)
|
||||
{
|
||||
QString escaped = Qt::escape(str);
|
||||
QString escaped = QString(str.toHtmlEscaped());
|
||||
if(fMultiLine)
|
||||
{
|
||||
escaped = escaped.replace("\n", "<br>\n");
|
||||
@ -171,7 +175,7 @@ QString getSaveFileName(QWidget *parent, const QString &caption,
|
||||
QString myDir;
|
||||
if(dir.isEmpty()) // Default to user documents location
|
||||
{
|
||||
myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
|
||||
myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -98,7 +98,7 @@ static void ipcThread2(void* pArg)
|
||||
size_t nSize = 0;
|
||||
unsigned int nPriority = 0;
|
||||
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
ptime d = boost::posix_time::microsec_clock::universal_time() + millisec(100);
|
||||
if (mq->timed_receive(&buffer, sizeof(buffer), nSize, nPriority, d))
|
||||
|
@ -99,7 +99,7 @@ void SendCoinsDialog::on_sendButton_clicked()
|
||||
QStringList formatted;
|
||||
foreach(const SendCoinsRecipient &rcp, recipients)
|
||||
{
|
||||
formatted.append(tr("<b>%1</b> to %2 (%3)").arg(curecoinUnits::formatWithUnit(curecoinUnits::BTC, rcp.amount), Qt::escape(rcp.label), rcp.address));
|
||||
formatted.append(tr("<b>%1</b> to %2 (%3)").arg(curecoinUnits::formatWithUnit(curecoinUnits::BTC, rcp.amount), QString(rcp.label).toHtmlEscaped(), rcp.address));
|
||||
}
|
||||
|
||||
fNewRecipientAllowed = false;
|
||||
|
@ -1257,7 +1257,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
|
||||
// Compare
|
||||
CScript::const_iterator pc1 = script1.begin();
|
||||
CScript::const_iterator pc2 = script2.begin();
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
if (pc1 == script1.end() && pc2 == script2.end())
|
||||
{
|
||||
|
@ -290,7 +290,7 @@ string vstrprintf(const char *format, va_list ap)
|
||||
char* p = buffer;
|
||||
int limit = sizeof(buffer);
|
||||
int ret;
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
va_list arg_ptr;
|
||||
va_copy(arg_ptr, ap);
|
||||
@ -350,7 +350,7 @@ void ParseString(const string& str, char c, vector<string>& v)
|
||||
return;
|
||||
string::size_type i1 = 0;
|
||||
string::size_type i2;
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
i2 = str.find(c, i1);
|
||||
if (i2 == str.npos)
|
||||
@ -466,7 +466,7 @@ vector<unsigned char> ParseHex(const char* psz)
|
||||
{
|
||||
// convert hex dump to vector
|
||||
vector<unsigned char> vch;
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
while (isspace(*psz))
|
||||
psz++;
|
||||
@ -920,7 +920,7 @@ string DecodeBase32(const string& str)
|
||||
|
||||
bool WildcardMatch(const char* psz, const char* mask)
|
||||
{
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
switch (*mask)
|
||||
{
|
||||
|
@ -35,7 +35,6 @@ typedef unsigned long long uint64;
|
||||
static const int64 COIN = 1000000;
|
||||
static const int64 CENT = 10000;
|
||||
|
||||
#define loop for (;;)
|
||||
#define BEGIN(a) ((char*)&(a))
|
||||
#define END(a) ((char*)&((&(a))[1]))
|
||||
#define UBEGIN(a) ((unsigned char*)&(a))
|
||||
|
@ -1232,7 +1232,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW
|
||||
CTxDB txdb("r");
|
||||
{
|
||||
nFeeRet = nTransactionFee;
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
wtxNew.vin.clear();
|
||||
wtxNew.vout.clear();
|
||||
@ -1495,7 +1495,7 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int
|
||||
}
|
||||
|
||||
int64 nMinFee = 0;
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
// Set output amount
|
||||
if (txNew.vout.size() == 3)
|
||||
|
@ -73,7 +73,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountin
|
||||
if (!pcursor)
|
||||
throw runtime_error("CWalletDB::ListAccountCreditDebit() : cannot create DB cursor");
|
||||
unsigned int fFlags = DB_SET_RANGE;
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
// Read next record
|
||||
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
|
||||
@ -414,7 +414,7 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
|
||||
return DB_CORRUPT;
|
||||
}
|
||||
|
||||
loop
|
||||
while (true)
|
||||
{
|
||||
// Read next record
|
||||
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
|
||||
|
Loading…
x
Reference in New Issue
Block a user