mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-21 02:55:50 +00:00
windows
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
#include "windatabase.h"
|
#include "windatabase.h"
|
||||||
#include "dbutility.h"
|
#include "dbutility.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
Database* Database::newMysqlDatabase(const char* host,const char* user,const char* pass)
|
Database* Database::newMysqlDatabase(const char* host,const char* user,const char* pass)
|
||||||
{
|
{
|
||||||
return(new WinDatabase(host,user,pass));
|
return(new WinDatabase(host,user,pass));
|
||||||
@@ -71,7 +73,7 @@ int WinDatabase::getNumRowsAffected()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// returns true if the query went ok
|
// returns true if the query went ok
|
||||||
bool WinDatabase::executeSQL(const char* sql)
|
bool WinDatabase::executeSQL(const char* sql, bool fail_okay)
|
||||||
{
|
{
|
||||||
SQLRETURN rc = SQLExecDirect(hstmt,(unsigned char*) sql,SQL_NTS);
|
SQLRETURN rc = SQLExecDirect(hstmt,(unsigned char*) sql,SQL_NTS);
|
||||||
if(rc==SQL_ERROR)
|
if(rc==SQL_ERROR)
|
||||||
@@ -120,8 +122,7 @@ bool WinDatabase::startIterRows()
|
|||||||
|
|
||||||
if(mNumCol)
|
if(mNumCol)
|
||||||
{
|
{
|
||||||
delete[](mColNameTable);
|
mColNameTable.resize(mNumCol);
|
||||||
mColNameTable=new i4_str[mNumCol];
|
|
||||||
|
|
||||||
// fill out the column name table
|
// fill out the column name table
|
||||||
for(int n = 1; n <= mNumCol; n++)
|
for(int n = 1; n <= mNumCol; n++)
|
||||||
@@ -149,14 +150,14 @@ bool WinDatabase::getNextRow()
|
|||||||
char* WinDatabase::getStr(int colIndex,string& retStr)
|
char* WinDatabase::getStr(int colIndex,string& retStr)
|
||||||
{
|
{
|
||||||
colIndex++;
|
colIndex++;
|
||||||
(*retStr)="";
|
retStr="";
|
||||||
char buf[1000];
|
char buf[1000];
|
||||||
// SQLINTEGER len;
|
// SQLINTEGER len;
|
||||||
buf[0]=0;
|
buf[0]=0;
|
||||||
|
|
||||||
while(SQLGetData(hstmt, colIndex, SQL_C_CHAR, &buf, 1000,NULL)!= SQL_NO_DATA)
|
while(SQLGetData(hstmt, colIndex, SQL_C_CHAR, &buf, 1000,NULL)!= SQL_NO_DATA)
|
||||||
{
|
{
|
||||||
(*retStr) += buf;
|
retStr += buf;
|
||||||
// theUI->statusMsg("Win: %s",buf);
|
// theUI->statusMsg("Win: %s",buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +167,7 @@ char* WinDatabase::getStr(int colIndex,string& retStr)
|
|||||||
|
|
||||||
//theUI->statusMsg("Win: %s",buf);
|
//theUI->statusMsg("Win: %s",buf);
|
||||||
|
|
||||||
return(*retStr);
|
return((char*)retStr.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 WinDatabase::getInt(int colIndex)
|
int32 WinDatabase::getInt(int colIndex)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public:
|
|||||||
//char* getPass(){ return((char*)mDBPass.c_str()); }
|
//char* getPass(){ return((char*)mDBPass.c_str()); }
|
||||||
|
|
||||||
// returns true if the query went ok
|
// returns true if the query went ok
|
||||||
bool executeSQL(const char* sql);
|
bool executeSQL(const char* sql, bool fail_okay=false);
|
||||||
|
|
||||||
int getNumRowsAffected();
|
int getNumRowsAffected();
|
||||||
int getLastInsertID();
|
int getLastInsertID();
|
||||||
@@ -49,9 +49,10 @@ public:
|
|||||||
float getFloat(int colIndex);
|
float getFloat(int colIndex);
|
||||||
bool getBool(int colIndex);
|
bool getBool(int colIndex);
|
||||||
uint64 getBigInt(int colIndex);
|
uint64 getBigInt(int colIndex);
|
||||||
bool getBinary(int colIndex,unsigned char* buf,int maxSize);
|
int getBinary(int colIndex,unsigned char* buf,int maxSize);
|
||||||
|
bool getNull(int colIndex){ return(true); }
|
||||||
|
|
||||||
void escape(unsigned char* start,int size,std::string& retStr);
|
void escape(const unsigned char* start,int size,std::string& retStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
121
newcoin.vcxproj
121
newcoin.vcxproj
@@ -19,13 +19,13 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
@@ -48,14 +48,14 @@
|
|||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0501;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>BOOST_TEST_NO_MAIN;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0501;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>..\OpenSSL\include;..\boost_1_47_0;..\protobuf-2.4.1\src\</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\OpenSSL\include;..\boost_1_47_0;..\protobuf-2.4.1\src\</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<AdditionalLibraryDirectories>..\OpenSSL\lib\VC;..\boost_1_47_0\stage\lib;..\protobuf-2.4.1\vsprojects\Debug</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>..\OpenSSL\lib\VC;..\boost_1_47_0\stage\lib;..\protobuf-2.4.1\vsprojects\Debug</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>libeay32MTd.lib;libprotobuf.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>ssleay32MDd.lib;libeay32MTd.lib;libprotobuf.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Command>
|
<Command>
|
||||||
@@ -72,62 +72,84 @@
|
|||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0501;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>BOOST_TEST_NO_MAIN;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0501;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>C:\code\boost_1_47_0;C:\code\protobuf-2.4.1\src\google</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\OpenSSL\include;..\boost_1_47_0;..\protobuf-2.4.1\src</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalLibraryDirectories>C:\code\OpenSSL\lib\VC;C:\code\boost_1_47_0\stage\lib;</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>..\OpenSSL\lib\VC;..\boost_1_47_0\stage\lib;..\protobuf-2.4.1\vsprojects\Release</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>libprotobuf.lib;ssleay32MD.lib;libeay32MD.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="AccountState.cpp" />
|
|
||||||
<ClCompile Include="Application.cpp" />
|
|
||||||
<ClCompile Include="BitcoinUtil.cpp" />
|
|
||||||
<ClCompile Include="CallRPC.cpp" />
|
|
||||||
<ClCompile Include="Config.cpp" />
|
|
||||||
<ClCompile Include="ConnectionPool.cpp" />
|
|
||||||
<ClCompile Include="Conversion.cpp" />
|
|
||||||
<ClCompile Include="cryptopp\cpu.cpp" />
|
<ClCompile Include="cryptopp\cpu.cpp" />
|
||||||
<ClCompile Include="cryptopp\sha.cpp" />
|
<ClCompile Include="cryptopp\sha.cpp" />
|
||||||
<ClCompile Include="database\database.cpp" />
|
<ClCompile Include="database\database.cpp" />
|
||||||
<ClCompile Include="database\sqlite3.c" />
|
<ClCompile Include="database\sqlite3.c" />
|
||||||
<ClCompile Include="database\SqliteDatabase.cpp" />
|
<ClCompile Include="database\SqliteDatabase.cpp" />
|
||||||
<ClCompile Include="DBInit.cpp" />
|
<ClCompile Include="database\win\windatabase.cpp" />
|
||||||
<ClCompile Include="DeterministicKeys.cpp" />
|
|
||||||
<ClCompile Include="HashedObject.cpp" />
|
|
||||||
<ClCompile Include="json\json_reader.cpp" />
|
<ClCompile Include="json\json_reader.cpp" />
|
||||||
<ClCompile Include="json\json_value.cpp" />
|
<ClCompile Include="json\json_value.cpp" />
|
||||||
<ClCompile Include="json\json_writer.cpp" />
|
<ClCompile Include="json\json_writer.cpp" />
|
||||||
<ClCompile Include="KnownNodeList.cpp" />
|
|
||||||
<ClCompile Include="Ledger.cpp" />
|
|
||||||
<ClCompile Include="LedgerHistory.cpp" />
|
|
||||||
<ClCompile Include="LedgerMaster.cpp" />
|
|
||||||
<ClCompile Include="LocalTransaction.cpp" />
|
|
||||||
<ClCompile Include="main.cpp" />
|
|
||||||
<ClCompile Include="NetworkOPs.cpp" />
|
|
||||||
<ClCompile Include="newcoin.pb.cc" />
|
<ClCompile Include="newcoin.pb.cc" />
|
||||||
<ClCompile Include="NewcoinAddress.cpp" />
|
<ClCompile Include="src\AccountState.cpp" />
|
||||||
<ClCompile Include="PackedMessage.cpp" />
|
<ClCompile Include="src\Amount.cpp" />
|
||||||
<ClCompile Include="PeerDoor.cpp" />
|
<ClCompile Include="src\Application.cpp" />
|
||||||
<ClCompile Include="Peer.cpp" />
|
<ClCompile Include="src\BitcoinUtil.cpp" />
|
||||||
<ClCompile Include="PubKeyCache.cpp" />
|
<ClCompile Include="src\CallRPC.cpp" />
|
||||||
<ClCompile Include="RequestParser.cpp" />
|
<ClCompile Include="src\Config.cpp" />
|
||||||
<ClCompile Include="rpc.cpp" />
|
<ClCompile Include="src\ConnectionPool.cpp" />
|
||||||
<ClCompile Include="RPCServer.cpp" />
|
<ClCompile Include="src\Conversion.cpp" />
|
||||||
<ClCompile Include="RPCDoor.cpp" />
|
<ClCompile Include="src\Currency.cpp" />
|
||||||
<ClCompile Include="Serializer.cpp" />
|
<ClCompile Include="src\DBInit.cpp" />
|
||||||
<ClCompile Include="SHAMap.cpp" />
|
<ClCompile Include="src\DeterministicKeys.cpp" />
|
||||||
<ClCompile Include="SHAMapDiff.cpp" />
|
<ClCompile Include="src\ECIES.cpp" />
|
||||||
<ClCompile Include="SHAMapNodes.cpp" />
|
<ClCompile Include="src\Hanko.cpp" />
|
||||||
<ClCompile Include="TimingService.cpp" />
|
<ClCompile Include="src\HashedObject.cpp" />
|
||||||
<ClCompile Include="Transaction.cpp" />
|
<ClCompile Include="src\HttpsClient.cpp" />
|
||||||
<ClCompile Include="UniqueNodeList.cpp" />
|
<ClCompile Include="src\Ledger.cpp" />
|
||||||
<ClCompile Include="util\pugixml.cpp" />
|
<ClCompile Include="src\LedgerAcquire.cpp" />
|
||||||
<ClCompile Include="Wallet.cpp" />
|
<ClCompile Include="src\LedgerFormats.cpp" />
|
||||||
|
<ClCompile Include="src\LedgerHistory.cpp" />
|
||||||
|
<ClCompile Include="src\LedgerIndex.cpp" />
|
||||||
|
<ClCompile Include="src\LedgerMaster.cpp" />
|
||||||
|
<ClCompile Include="src\LedgerNode.cpp" />
|
||||||
|
<ClCompile Include="src\LocalTransaction.cpp" />
|
||||||
|
<ClCompile Include="src\main.cpp" />
|
||||||
|
<ClCompile Include="src\NetworkOPs.cpp" />
|
||||||
|
<ClCompile Include="src\NewcoinAddress.cpp" />
|
||||||
|
<ClCompile Include="src\PackedMessage.cpp" />
|
||||||
|
<ClCompile Include="src\ParseSection.cpp" />
|
||||||
|
<ClCompile Include="src\Peer.cpp" />
|
||||||
|
<ClCompile Include="src\PeerDoor.cpp" />
|
||||||
|
<ClCompile Include="src\PlatRand.cpp" />
|
||||||
|
<ClCompile Include="src\PubKeyCache.cpp" />
|
||||||
|
<ClCompile Include="src\RequestParser.cpp" />
|
||||||
|
<ClCompile Include="src\rfc1751.cpp" />
|
||||||
|
<ClCompile Include="src\rpc.cpp" />
|
||||||
|
<ClCompile Include="src\RPCCommands.cpp" />
|
||||||
|
<ClCompile Include="src\RPCDoor.cpp" />
|
||||||
|
<ClCompile Include="src\RPCServer.cpp" />
|
||||||
|
<ClCompile Include="src\SerializedLedger.cpp" />
|
||||||
|
<ClCompile Include="src\SerializedObject.cpp" />
|
||||||
|
<ClCompile Include="src\SerializedTransaction.cpp" />
|
||||||
|
<ClCompile Include="src\SerializedTypes.cpp" />
|
||||||
|
<ClCompile Include="src\SerializedValidation.cpp" />
|
||||||
|
<ClCompile Include="src\Serializer.cpp" />
|
||||||
|
<ClCompile Include="src\SHAMap.cpp" />
|
||||||
|
<ClCompile Include="src\SHAMapDiff.cpp" />
|
||||||
|
<ClCompile Include="src\SHAMapNodes.cpp" />
|
||||||
|
<ClCompile Include="src\SHAMapSync.cpp" />
|
||||||
|
<ClCompile Include="src\Transaction.cpp" />
|
||||||
|
<ClCompile Include="src\TransactionEngine.cpp" />
|
||||||
|
<ClCompile Include="src\TransactionFormats.cpp" />
|
||||||
|
<ClCompile Include="src\TransactionMaster.cpp" />
|
||||||
|
<ClCompile Include="src\UniqueNodeList.cpp" />
|
||||||
|
<ClCompile Include="src\utils.cpp" />
|
||||||
|
<ClCompile Include="src\Wallet.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="Account.h" />
|
<ClInclude Include="Account.h" />
|
||||||
@@ -189,11 +211,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="config.xml" />
|
<None Include="config.xml" />
|
||||||
<CustomBuild Include="newcoin.proto">
|
|
||||||
<FileType>Document</FileType>
|
|
||||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\protoc-2.4.1-win32\protoc -I=..\newcoin --cpp_out=..\newcoin ..\newcoin\newcoin.proto</Command>
|
|
||||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">newcoin.pb.h</Outputs>
|
|
||||||
</CustomBuild>
|
|
||||||
<None Include="db layout.txt" />
|
<None Include="db layout.txt" />
|
||||||
<None Include="html\newcoin.html">
|
<None Include="html\newcoin.html">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@@ -201,7 +218,15 @@
|
|||||||
<None Include="Makefile" />
|
<None Include="Makefile" />
|
||||||
<None Include="nodes.xml" />
|
<None Include="nodes.xml" />
|
||||||
<None Include="notes.txt" />
|
<None Include="notes.txt" />
|
||||||
<None Include="tests\client2\config.xml" />
|
<CustomBuild Include="src\newcoin.proto">
|
||||||
|
<FileType>Document</FileType>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\protoc-2.4.1-win32\protoc -I=..\newcoin\src --cpp_out=..\newcoin\obj\src ..\newcoin\src\newcoin.proto</Command>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">obj\src\newcoin.pb.h</Outputs>
|
||||||
|
</CustomBuild>
|
||||||
|
<None Include="SConstruct" />
|
||||||
|
<None Include="tests\client2\config.xml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</None>
|
||||||
<None Include="todo.txt" />
|
<None Include="todo.txt" />
|
||||||
<None Include="unl.xml" />
|
<None Include="unl.xml" />
|
||||||
<None Include="wallet.xml" />
|
<None Include="wallet.xml" />
|
||||||
|
|||||||
@@ -37,110 +37,20 @@
|
|||||||
<Filter Include="tests\client2">
|
<Filter Include="tests\client2">
|
||||||
<UniqueIdentifier>{b27b04b8-1c6e-4b20-9364-f18d4682dc00}</UniqueIdentifier>
|
<UniqueIdentifier>{b27b04b8-1c6e-4b20-9364-f18d4682dc00}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Source Files\database">
|
||||||
|
<UniqueIdentifier>{60c3631e-8855-4a61-bdd3-9892d96242d5}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="Application.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ConnectionPool.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Peer.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Config.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="KnownNodeList.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="util\pugixml.cpp">
|
|
||||||
<Filter>Header Files\util</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="LedgerHistory.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Ledger.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Wallet.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="UniqueNodeList.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="PeerDoor.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="RPCDoor.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="newcoin.pb.cc">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="PackedMessage.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="rpc.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="BitcoinUtil.cpp">
|
|
||||||
<Filter>Header Files\util</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="RequestParser.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="RPCServer.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="TimingService.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="LedgerMaster.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="NewcoinAddress.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="cryptopp\cpu.cpp">
|
<ClCompile Include="cryptopp\cpu.cpp">
|
||||||
<Filter>Source Files\cryptopp</Filter>
|
<Filter>Source Files\cryptopp</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="cryptopp\sha.cpp">
|
<ClCompile Include="cryptopp\sha.cpp">
|
||||||
<Filter>Source Files\cryptopp</Filter>
|
<Filter>Source Files\cryptopp</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="database\database.cpp">
|
|
||||||
<Filter>Header Files\util</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="database\SqliteDatabase.cpp">
|
|
||||||
<Filter>Header Files\util</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="database\sqlite3.c">
|
<ClCompile Include="database\sqlite3.c">
|
||||||
<Filter>Header Files\util</Filter>
|
<Filter>Header Files\util</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Conversion.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="AccountState.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="DeterministicKeys.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="SHAMap.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="SHAMapDiff.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="SHAMapNodes.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Serializer.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Transaction.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="json\json_reader.cpp">
|
<ClCompile Include="json\json_reader.cpp">
|
||||||
<Filter>Source Files\json</Filter>
|
<Filter>Source Files\json</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -150,25 +60,181 @@
|
|||||||
<ClCompile Include="json\json_writer.cpp">
|
<ClCompile Include="json\json_writer.cpp">
|
||||||
<Filter>Source Files\json</Filter>
|
<Filter>Source Files\json</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="LocalTransaction.cpp">
|
<ClCompile Include="src\AccountState.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="PubKeyCache.cpp">
|
<ClCompile Include="src\Amount.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="HashedObject.cpp">
|
<ClCompile Include="src\Application.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="NetworkOPs.cpp">
|
<ClCompile Include="src\CallRPC.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="DBInit.cpp">
|
<ClCompile Include="src\Config.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="main.cpp">
|
<ClCompile Include="src\ConnectionPool.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="CallRPC.cpp">
|
<ClCompile Include="src\Conversion.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Currency.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\DBInit.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\DeterministicKeys.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\ECIES.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Hanko.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HashedObject.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HttpsClient.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Ledger.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\LedgerAcquire.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\LedgerFormats.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\LedgerHistory.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\LedgerIndex.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\LedgerMaster.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\LedgerNode.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\LocalTransaction.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\main.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\NetworkOPs.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\NewcoinAddress.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\PackedMessage.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\ParseSection.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Peer.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\PeerDoor.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\PlatRand.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\PubKeyCache.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\RequestParser.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\rfc1751.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\rpc.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\RPCCommands.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\RPCDoor.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\RPCServer.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SerializedLedger.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SerializedObject.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SerializedTransaction.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SerializedTypes.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SerializedValidation.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Serializer.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SHAMap.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SHAMapDiff.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SHAMapNodes.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SHAMapSync.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Transaction.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\TransactionEngine.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\TransactionFormats.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\TransactionMaster.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\UniqueNodeList.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\utils.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Wallet.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\BitcoinUtil.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="database\database.cpp">
|
||||||
|
<Filter>Source Files\database</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="database\SqliteDatabase.cpp">
|
||||||
|
<Filter>Source Files\database</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="database\win\windatabase.cpp">
|
||||||
|
<Filter>Source Files\database</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="newcoin.pb.cc">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@@ -357,8 +423,9 @@
|
|||||||
<None Include="tests\client2\config.xml">
|
<None Include="tests\client2\config.xml">
|
||||||
<Filter>tests\client2</Filter>
|
<Filter>tests\client2</Filter>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="SConstruct" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<CustomBuild Include="newcoin.proto" />
|
<CustomBuild Include="src\newcoin.proto" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -54,6 +54,6 @@ double Amount::getDisplayQuantity() const
|
|||||||
{
|
{
|
||||||
if(!mCurrency.isNational()) throw std::runtime_error("Can only scale national currencies");
|
if(!mCurrency.isNational()) throw std::runtime_error("Can only scale national currencies");
|
||||||
int scale=mCurrency.getScale();
|
int scale=mCurrency.getScale();
|
||||||
return static_cast<double>(mQuantity) * pow(10, 128-scale);
|
return static_cast<double>(mQuantity) * pow((double)10, 128-scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
|
|
||||||
bool AddSystemEntropy()
|
bool AddSystemEntropy()
|
||||||
{ // Get entropy from the Windows crypto provider
|
{ // Get entropy from the Windows crypto provider
|
||||||
|
RAND_screen(); // this isn't really that safe since it only works for end users not servers
|
||||||
|
|
||||||
|
/* TODO: you need the cryptoAPI installed I think for the below to work. I suppose we should require people to install this to build the windows version
|
||||||
char name[512], rand[128];
|
char name[512], rand[128];
|
||||||
DWORD count = 500;
|
DWORD count = 500;
|
||||||
HCRYPTOPROV cryptoHandle;
|
HCRYPTOPROV cryptoHandle;
|
||||||
@@ -39,6 +42,8 @@ bool AddSystemEntropy()
|
|||||||
|
|
||||||
CryptReleaseContext(cryptoHandle, 0);
|
CryptReleaseContext(cryptoHandle, 0);
|
||||||
RAND_seed(rand, 128);
|
RAND_seed(rand, 128);
|
||||||
|
|
||||||
|
*/
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
#include <boost/smart_ptr/make_shared.hpp>
|
#include <boost/smart_ptr/make_shared.hpp>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "Serializer.h"
|
#include "Serializer.h"
|
||||||
#include "BitcoinUtil.h"
|
#include "BitcoinUtil.h"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <boost/smart_ptr/make_shared.hpp>
|
#include <boost/smart_ptr/make_shared.hpp>
|
||||||
|
|
||||||
#include <openssl/sha.h>
|
#include <openssl/sha.h>
|
||||||
|
#include <iostream>
|
||||||
#include "Serializer.h"
|
#include "Serializer.h"
|
||||||
#include "BitcoinUtil.h"
|
#include "BitcoinUtil.h"
|
||||||
#include "SHAMap.h"
|
#include "SHAMap.h"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
|
#include <iostream>
|
||||||
#include "SHAMap.h"
|
#include "SHAMap.h"
|
||||||
|
|
||||||
void SHAMap::getMissingNodes(std::vector<SHAMapNode>& nodeIDs, std::vector<uint256>& hashes, int max)
|
void SHAMap::getMissingNodes(std::vector<SHAMapNode>& nodeIDs, std::vector<uint256>& hashes, int max)
|
||||||
|
|||||||
@@ -115,12 +115,14 @@ int main(int argc, char* argv[])
|
|||||||
if (iCmd)
|
if (iCmd)
|
||||||
vCmd = vm["parameters"].as<std::vector<std::string> >();
|
vCmd = vm["parameters"].as<std::vector<std::string> >();
|
||||||
|
|
||||||
|
/*
|
||||||
char* pvCmd[iCmd];
|
char* pvCmd[iCmd];
|
||||||
|
|
||||||
for (int i=0; i != iCmd; ++i)
|
for (int i=0; i != iCmd; ++i)
|
||||||
pvCmd[i] = (char*) (vCmd[0].c_str());
|
pvCmd[i] = (char*) (vCmd[0].c_str());
|
||||||
|
|
||||||
iResult = unit_test_main(init_unit_test, iCmd, pvCmd);
|
iResult = unit_test_main(init_unit_test, iCmd, pvCmd);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
else if (!vm.count("parameters"))
|
else if (!vm.count("parameters"))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,4 +4,3 @@ REM copy C:\code\newcoin\Release\newcoin.exe C:\code\newcoin\tests\client2
|
|||||||
copy d:\code\newcoin\Debug\newcoin.exe d:\code\newcoin\tests\client1
|
copy d:\code\newcoin\Debug\newcoin.exe d:\code\newcoin\tests\client1
|
||||||
copy d:\code\newcoin\Debug\newcoin.exe d:\code\newcoin\tests\client2
|
copy d:\code\newcoin\Debug\newcoin.exe d:\code\newcoin\tests\client2
|
||||||
|
|
||||||
pause
|
|
||||||
Reference in New Issue
Block a user