mirror of
https://github.com/AskDavis/Casinotest.git
synced 2026-01-02 20:09:47 -08:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1de014deb | ||
|
|
42a1dc685e | ||
|
|
b3cbb74700 | ||
|
|
dfb03115eb | ||
|
|
f4b40bed09 | ||
|
|
00f5ffa06c | ||
|
|
4add93f3a1 | ||
|
|
9f8937da99 | ||
|
|
1b7473bcb2 | ||
|
|
94d9128cdd | ||
|
|
1a5784fa8b | ||
|
|
8906eb0445 | ||
|
|
5f30e8002b | ||
|
|
b478c57fe4 | ||
|
|
394f6e6efe | ||
|
|
276ef38c7b | ||
|
|
56bf480259 | ||
|
|
2e0aaa5022 | ||
|
|
eb53a54e27 | ||
|
|
1521d79911 | ||
|
|
093b9ec1ff | ||
|
|
7497a0233e | ||
|
|
df82a9e0c7 | ||
|
|
d325409101 | ||
|
|
ce170d8ad7 | ||
|
|
70ee980532 | ||
|
|
5cebe42a99 | ||
|
|
1ac9b40ec5 | ||
|
|
9fceb7451e | ||
|
|
b7d81c6e32 | ||
|
|
958f97b0c1 | ||
|
|
4b1178f643 | ||
|
|
7841130cd3 | ||
|
|
5924b24782 |
20
README.md
20
README.md
@@ -1,5 +1,5 @@
|
|||||||
<h2>Please download the updated wallet asap, hard fork incoming at block 546250</h2>
|
<h2>Wallet 2.0.1.0 Release available</h2>
|
||||||
[Click here to download the most recent wallet version -> 1.3.0 (Updated on July, 18 2014)](https://github.com/casinocoin/casinocoin/releases/tag/1.3.0.0 "Click to go to releases page")
|
[Click here to download the most recent wallet version -> 2.0.1.0 (Updated on December, 11 2015)](https://github.com/casinocoin/casinocoin/releases/tag/2.0.1.0 "Click to go to releases page")
|
||||||
|
|
||||||
<p align="center"><img src="https://raw.github.com/transcoder/CasinoCoin/master/src/qt/res/images/logo.png" /></p>
|
<p align="center"><img src="https://raw.github.com/transcoder/CasinoCoin/master/src/qt/res/images/logo.png" /></p>
|
||||||
|
|
||||||
@@ -35,30 +35,26 @@ Technical Specifications
|
|||||||
- 30 second block time targets
|
- 30 second block time targets
|
||||||
- ~63 million total coins
|
- ~63 million total coins
|
||||||
- new digishield difficulty retargetting system (from block 445000)
|
- new digishield difficulty retargetting system (from block 445000)
|
||||||
- 50 coins per block, permanent reduction to 10 cons per block after block 575000
|
- 50 coins per block, permanent reduction to 10 coins per block after block 575000
|
||||||
- fair launch, absolutely no premine
|
- fair launch, absolutely no premine
|
||||||
|
|
||||||
Casinocoin Mailing Lists
|
Casinocoin Mailing Lists
|
||||||
========================
|
========================
|
||||||
|
|
||||||
If you operate a pool or service that relies on Casinocoin wallets, please subscribe to the "Csinocoin Development" mailing list for notifications of client updates, hardforks,or other issues that may impact you.
|
If you operate a pool or service that relies on CasinoCoin wallets, please subscribe to the "CasinoCoin Development" mailing list for notifications of client updates, hardforks,or other issues that may impact you.
|
||||||
|
|
||||||
- Casinocoin Development mailing list subscription form: http://eepurl.com/WGcoP
|
- CasinoCoin Development mailing list subscription form: http://eepurl.com/WGcoP
|
||||||
|
|
||||||
If you are a community mber interested in more general announcements related to Casinocoin, please subscribe to the "Casinocoin Announcements" mailing list.
|
If you are a community mber interested in more general announcements related to Casinocoin, please subscribe to the "CasinoCoin Announcements" mailing list.
|
||||||
|
|
||||||
- Casinocoin Announcements mailing list subscription form: http://eepurl.com/WGeu1
|
- CasinoCoin Announcements mailing list subscription form: http://eepurl.com/WGeu1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Links
|
Links
|
||||||
======
|
======
|
||||||
|
|
||||||
Website: http://casinocoin.org
|
Website: https://casinocoin.org
|
||||||
|
|
||||||
|
|
||||||
Forum: http://forums.casinocoin.org
|
|
||||||
|
|
||||||
|
|
||||||
Source: https://github.com/casinocoin/casinocoin
|
Source: https://github.com/casinocoin/casinocoin
|
||||||
|
|
||||||
|
|||||||
@@ -1,47 +1,30 @@
|
|||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
TARGET = casinocoin-qt
|
TARGET = casinocoin-qt
|
||||||
macx:TARGET = "CasinoCoin-Qt"
|
VERSION = 3.0.0.0
|
||||||
VERSION = 2.0.0.0
|
|
||||||
INCLUDEPATH += src src/json src/qt
|
INCLUDEPATH += src src/json src/qt
|
||||||
QT += core gui network widgets qml quick
|
QT += core gui network widgets qml quick
|
||||||
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE USE_IPV6 __NO_SYSTEM_INCLUDES
|
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE USE_IPV6
|
||||||
CONFIG += no_include_pwd
|
CONFIG += no_include_pwd
|
||||||
CONFIG += thread
|
CONFIG += thread
|
||||||
CONFIG += static
|
|
||||||
|
|
||||||
BOOST_LIB_SUFFIX=-mgw49-mt-s-1_55
|
# Build boost:
|
||||||
BOOST_THREAD_LIB_SUFFIX=$$BOOST_LIB_SUFFIX
|
# .\b2 toolset=gcc address-model=32 define=BOOST_USE_WINAPI_VERSION=0x0600 variant=release link=static threading=multi runtime-link=static --build-type=complete --with-chrono --with-filesystem --with-program_options --with-system --with-thread stage
|
||||||
BOOST_INCLUDE_PATH=C:/deps/boost_1_55_0
|
# define=BOOST_USE_WINAPI_VERSION=0x0600
|
||||||
BOOST_LIB_PATH=C:/deps/boost_1_55_0/stage/lib
|
BOOST_LIB_SUFFIX=-mt
|
||||||
BDB_INCLUDE_PATH=C:/deps/db-4.8.30.NC/build_unix
|
BOOST_LIB_PATH=C:/msys64/usr/src/deps32/boost_1_60_0/stage/lib
|
||||||
BDB_LIB_PATH=C:/deps/db-4.8.30.NC/build_unix
|
BOOST_INCLUDE_PATH=C:/msys64/usr/src/deps32/boost_1_60_0
|
||||||
|
BDB_INCLUDE_PATH=C:/msys64/usr/src/deps32/db-4.8.30.NC/build_unix
|
||||||
|
BDB_LIB_PATH=C:/msys64/usr/src/deps32/db-4.8.30.NC/build_unix
|
||||||
BDB_LIB_SUFFIX=-4.8
|
BDB_LIB_SUFFIX=-4.8
|
||||||
OPENSSL_INCLUDE_PATH=C:/deps/openssl-1.0.2d/include
|
MINIUPNPC_INCLUDE_PATH=C:/msys64/usr/src/deps32/miniupnpc-1.9/include
|
||||||
OPENSSL_LIB_PATH=C:/deps/openssl-1.0.2d
|
MINIUPNPC_LIB_PATH=C:/msys64/usr/src/deps32/miniupnpc-1.9
|
||||||
MINIUPNPC_INCLUDE_PATH=C:/deps/
|
QRENCODE_INCLUDE_PATH=C:/msys64/usr/src/deps32/qrencode-3.4.4
|
||||||
MINIUPNPC_LIB_PATH=C:/deps/miniupnpc
|
QRENCODE_LIB_PATH=C:/msys64/usr/src/deps32/qrencode-3.4.4/.libs
|
||||||
QRENCODE_INCLUDE_PATH=C:/deps/qrencode-3.4.3
|
|
||||||
QRENCODE_LIB_PATH=C:/deps/qrencode-3.4.3/.libs
|
|
||||||
|
|
||||||
OBJECTS_DIR = build
|
OBJECTS_DIR = build
|
||||||
MOC_DIR = build
|
MOC_DIR = build
|
||||||
UI_DIR = build
|
UI_DIR = build
|
||||||
|
|
||||||
# for extra security against potential buffer overflows: enable GCCs Stack Smashing Protection
|
|
||||||
QMAKE_CXXFLAGS *= -fstack-protector-all
|
|
||||||
QMAKE_LFLAGS *= -fstack-protector-all
|
|
||||||
# Exclude on Windows cross compile with MinGW 4.2.x, as it will result in a non-working executable!
|
|
||||||
# This can be enabled for Windows, when we switch to MinGW >= 4.4.x.
|
|
||||||
|
|
||||||
# for extra security (see: https://wiki.debian.org/Hardening): this flag is GCC compiler-specific
|
|
||||||
QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2
|
|
||||||
# for extra security on Windows: enable ASLR and DEP via GCC linker flags
|
|
||||||
QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat
|
|
||||||
# on Windows: enable GCC large address aware linker flag
|
|
||||||
QMAKE_LFLAGS *= -Wl,--large-address-aware
|
|
||||||
# i686-w64-mingw32
|
|
||||||
QMAKE_LFLAGS *= -static-libgcc -static-libstdc++
|
|
||||||
|
|
||||||
# use: qmake "USE_QRCODE=1"
|
# use: qmake "USE_QRCODE=1"
|
||||||
# libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support
|
# libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support
|
||||||
contains(USE_QRCODE, 1) {
|
contains(USE_QRCODE, 1) {
|
||||||
@@ -117,9 +100,7 @@ contains(USE_BUILD_INFO, 1) {
|
|||||||
DEFINES += HAVE_BUILD_INFO
|
DEFINES += HAVE_BUILD_INFO
|
||||||
}
|
}
|
||||||
|
|
||||||
QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wno-strict-aliasing -Wstack-protector
|
QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused -Wno-strict-aliasing -Wstack-protector -Wno-maybe-uninitialized
|
||||||
|
|
||||||
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-local-typedefs
|
|
||||||
|
|
||||||
##### Start Project Files #####
|
##### Start Project Files #####
|
||||||
|
|
||||||
@@ -239,7 +220,8 @@ HEADERS += src/qt/bitcoingui.h \
|
|||||||
src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.h \
|
src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.h \
|
||||||
src/qt/qtquick_controls/cpp/qmlexchangeslistitem.h \
|
src/qt/qtquick_controls/cpp/qmlexchangeslistitem.h \
|
||||||
src/qt/qtquick_controls/cpp/guiexchangeslistview.h \
|
src/qt/qtquick_controls/cpp/guiexchangeslistview.h \
|
||||||
src/qt/qtquick_controls/cpp/guiexchangescontrol.h
|
src/qt/qtquick_controls/cpp/guiexchangescontrol.h \
|
||||||
|
src/qt/twitter/twitterwidget.h
|
||||||
|
|
||||||
SOURCES += src/qt/bitcoin.cpp \
|
SOURCES += src/qt/bitcoin.cpp \
|
||||||
src/qt/bitcoingui.cpp \
|
src/qt/bitcoingui.cpp \
|
||||||
@@ -340,7 +322,8 @@ SOURCES += src/qt/bitcoin.cpp \
|
|||||||
src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.cpp \
|
src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.cpp \
|
||||||
src/qt/qtquick_controls/cpp/qmlexchangeslistitem.cpp \
|
src/qt/qtquick_controls/cpp/qmlexchangeslistitem.cpp \
|
||||||
src/qt/qtquick_controls/cpp/guiexchangeslistview.cpp \
|
src/qt/qtquick_controls/cpp/guiexchangeslistview.cpp \
|
||||||
src/qt/qtquick_controls/cpp/guiexchangescontrol.cpp
|
src/qt/qtquick_controls/cpp/guiexchangescontrol.cpp \
|
||||||
|
src/qt/twitter/twitterwidget.cpp
|
||||||
|
|
||||||
RESOURCES += src/qt/bitcoin.qrc
|
RESOURCES += src/qt/bitcoin.qrc
|
||||||
|
|
||||||
@@ -376,7 +359,8 @@ OTHER_FILES += README.md \
|
|||||||
src/qt/qtquick_controls/qml/QmlGUIExchangesWindow.qml \
|
src/qt/qtquick_controls/qml/QmlGUIExchangesWindow.qml \
|
||||||
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarWindow.qml \
|
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarWindow.qml \
|
||||||
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarListView.qml \
|
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarListView.qml \
|
||||||
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarControl.qml
|
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarControl.qml \
|
||||||
|
src/qt/twitter/*.qml
|
||||||
|
|
||||||
DISTFILES += \
|
DISTFILES += \
|
||||||
QmlImports.qml
|
QmlImports.qml
|
||||||
@@ -425,15 +409,6 @@ TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
|
|||||||
TSQM.CONFIG = no_link
|
TSQM.CONFIG = no_link
|
||||||
QMAKE_EXTRA_COMPILERS += TSQM
|
QMAKE_EXTRA_COMPILERS += TSQM
|
||||||
|
|
||||||
# platform specific defaults, if not overridden on command line
|
|
||||||
isEmpty(BOOST_LIB_SUFFIX) {
|
|
||||||
BOOST_LIB_SUFFIX = -mgw46-mt-s-1_53
|
|
||||||
}
|
|
||||||
|
|
||||||
isEmpty(BOOST_THREAD_LIB_SUFFIX) {
|
|
||||||
BOOST_THREAD_LIB_SUFFIX = $$BOOST_LIB_SUFFIX
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFINES += WIN32
|
DEFINES += WIN32
|
||||||
RC_FILE = src/qt/res/bitcoin-qt.rc
|
RC_FILE = src/qt/res/bitcoin-qt.rc
|
||||||
|
|
||||||
@@ -449,12 +424,12 @@ RC_FILE = src/qt/res/bitcoin-qt.rc
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Set libraries and includes at end, to use platform-defined defaults if not overridden
|
# Set libraries and includes at end, to use platform-defined defaults if not overridden
|
||||||
INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH
|
INCLUDEPATH += $$BDB_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH $$BOOST_INCLUDE_PATH
|
||||||
LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,)
|
LIBS += $$join(BDB_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,) $$join(BOOST_LIB_PATH,,-L,)
|
||||||
LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX -lpthread
|
LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX -lpthread
|
||||||
# -lgdi32 has to happen after -lcrypto (see #681)
|
# -lgdi32 has to happen after -lcrypto (see #681)
|
||||||
LIBS += -lws2_32 -lole32 -lmswsock -loleaut32 -luuid -lgdi32 -lshlwapi
|
LIBS += -lws2_32 -lole32 -lmswsock -loleaut32 -luuid -lgdi32 -lshlwapi
|
||||||
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX
|
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_LIB_SUFFIX
|
||||||
LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
|
LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
|
||||||
|
|
||||||
system($$QMAKE_LRELEASE -silent $$TRANSLATIONS)
|
system($$QMAKE_LRELEASE -silent $$TRANSLATIONS)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<!-- Written by QtCreator 3.5.0, 2015-12-01T22:30:06. -->
|
<!-- Written by QtCreator 4.0.0, 2016-06-08T18:03:58. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>EnvironmentId</variable>
|
<variable>EnvironmentId</variable>
|
||||||
@@ -40,6 +40,7 @@
|
|||||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||||
@@ -58,78 +59,22 @@
|
|||||||
<data>
|
<data>
|
||||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||||
<valuemap type="QVariantMap">
|
<valuemap type="QVariantMap">
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.5.1 MinGW Static 32bit</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 5.6.0 (mingw32)</value>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.5.1 MinGW Static 32bit</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 5.6.0 (mingw32)</value>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{7d14dbc8-0402-4b0e-98cc-9747e8c52c07}</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{b3cf2641-46bb-4b28-b7a6-2713d9074823}</value>
|
||||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
|
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
|
||||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/a.jochems/Documents/GitHub/casinocoin-GUI-2.0</value>
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
|
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">"USE_UPNP=0" "USE_QRCODE=1" "USE_IPV6=1"</value>
|
||||||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1</value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
|
|
||||||
</valuemap>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
|
||||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
|
||||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
|
|
||||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
|
||||||
</valuemap>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
|
||||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
|
||||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
|
|
||||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
|
||||||
</valuemap>
|
|
||||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
|
||||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
|
||||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
|
||||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
|
||||||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
|
||||||
</valuemap>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
|
||||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/a.jochems/Documents/GitHub/casinocoin-GUI-2.0</value>
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
|
||||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
|
|
||||||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1</value>
|
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
|
||||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
|
||||||
@@ -174,6 +119,60 @@
|
|||||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
||||||
</valuemap>
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/a.jochems/Documents/GitHub/casinocoin-development</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
|
||||||
|
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">"USE_UPNP=0" "USE_QRCODE=1" "USE_IPV6=1"</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
|
||||||
|
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
|
||||||
|
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||||
|
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
||||||
|
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
||||||
|
</valuemap>
|
||||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
|
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
@@ -190,6 +189,11 @@
|
|||||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||||
|
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
|
||||||
|
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
|
||||||
|
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
|
||||||
|
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
|
||||||
|
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||||
@@ -228,12 +232,13 @@
|
|||||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">casinocoin-qt-windows</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">casinocoin-qt-windows</value>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/a.jochems/Documents/GitHub/casinocoin-GUI-2.0/casinocoin-qt-windows.pro</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/a.jochems/Documents/GitHub/casinocoin-development/casinocoin-qt-windows.pro</value>
|
||||||
|
<value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value>
|
||||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
|
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
|
||||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">casinocoin-qt-windows.pro</value>
|
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">casinocoin-qt-windows.pro</value>
|
||||||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
|
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
|
||||||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
|
|
||||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
|
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">C:/Users/a.jochems/Documents/GitHub/casinocoin-development</value>
|
||||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||||
|
|||||||
63
contrib/casinocoind.conf
Normal file
63
contrib/casinocoind.conf
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
description "Casinocoin Core Daemon"
|
||||||
|
|
||||||
|
start on runlevel [2345]
|
||||||
|
stop on starting rc RUNLEVEL=[016]
|
||||||
|
|
||||||
|
env CASINOCOIND_BIN="/usr/bin/casinocoind"
|
||||||
|
env CASINOCOIND_USER="ubuntu"
|
||||||
|
env CASINOCOIND_GROUP="ubuntu"
|
||||||
|
env CASINOCOIND_PIDDIR="/var/run/casinocoind"
|
||||||
|
# upstart can't handle variables constructed with other variables
|
||||||
|
env CASINOCOIND_PIDFILE="/var/run/casinocoind/casinocoind.pid"
|
||||||
|
env CASINOCOIND_CONFIGFILE="/u01/CSC/.casinocoin/casinocoin.conf"
|
||||||
|
env CASINOCOIND_DATADIR="/u01/CSC/data"
|
||||||
|
|
||||||
|
expect fork
|
||||||
|
|
||||||
|
respawn
|
||||||
|
respawn limit 5 120
|
||||||
|
kill timeout 60
|
||||||
|
|
||||||
|
pre-start script
|
||||||
|
# this will catch non-existent config files
|
||||||
|
# bitcoind will check and exit with this very warning, but it can do so
|
||||||
|
# long after forking, leaving upstart to think everything started fine.
|
||||||
|
# since this is a commonly encountered case on install, just check and
|
||||||
|
# warn here.
|
||||||
|
if ! grep -qs '^rpcpassword=' "$CASINOCOIND_CONFIGFILE" ; then
|
||||||
|
echo "ERROR: You must set a secure rpcpassword to run casinocoind."
|
||||||
|
echo "The setting must appear in $CASINOCOIND_CONFIGFILE"
|
||||||
|
echo
|
||||||
|
echo "This password is security critical to securing wallets "
|
||||||
|
echo "and must not be the same as the rpcuser setting."
|
||||||
|
echo "You can generate a suitable random password using the following"
|
||||||
|
echo "command from the shell:"
|
||||||
|
echo
|
||||||
|
echo "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'"
|
||||||
|
echo
|
||||||
|
echo "It is also recommended that you also set alertnotify so you are "
|
||||||
|
echo "notified of problems:"
|
||||||
|
echo
|
||||||
|
echo "ie: alertnotify=echo %%s | mail -s \"Casinocoin Alert\"" \
|
||||||
|
"admin@foo.com"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$CASINOCOIND_PIDDIR"
|
||||||
|
chmod 0755 "$CASINOCOIND_PIDDIR"
|
||||||
|
chown $CASINOCOIND_USER:$CASINOCOIND_GROUP "$CASINOCOIND_PIDDIR"
|
||||||
|
chown $CASINOCOIND_USER:$CASINOCOIND_GROUP "$CASINOCOIND_CONFIGFILE"
|
||||||
|
chmod 0660 "$CASINOCOIND_CONFIGFILE"
|
||||||
|
end script
|
||||||
|
|
||||||
|
exec start-stop-daemon \
|
||||||
|
--start \
|
||||||
|
--pidfile "$CASINOCOIND_PIDFILE" \
|
||||||
|
--chuid $CASINOCOIND_USER:$CASINOCOIND_GROUP \
|
||||||
|
--exec "$CASINOCOIND_BIN" \
|
||||||
|
-- \
|
||||||
|
-pid="$CASINOCOIND_PIDFILE" \
|
||||||
|
-conf="$CASINOCOIND_CONFIGFILE" \
|
||||||
|
-datadir="$CASINOCOIND_DATADIR" \
|
||||||
|
-daemon
|
||||||
BIN
contrib/opengl32sw.dll
Normal file
BIN
contrib/opengl32sw.dll
Normal file
Binary file not shown.
@@ -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"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#ifdef _WIN32_WINNT
|
#ifdef _WIN32_WINNT
|
||||||
#undef _WIN32_WINNT
|
#undef _WIN32_WINNT
|
||||||
#endif
|
#endif
|
||||||
#define _WIN32_WINNT 0x0501
|
#define _WIN32_WINNT 0x0600
|
||||||
#define WIN32_LEAN_AND_MEAN 1
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
#ifndef NOMINMAX
|
#ifndef NOMINMAX
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
|
|||||||
@@ -182,10 +182,10 @@ Value stop(const Array& params, bool fHelp)
|
|||||||
if (fHelp || params.size() > 1)
|
if (fHelp || params.size() > 1)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"stop\n"
|
"stop\n"
|
||||||
"Stop CasinoCoin server.");
|
"Stop "+ COIN_NAME_DISPLAY + " server.");
|
||||||
// Shutdown will take long enough that the response should get back
|
// Shutdown will take long enough that the response should get back
|
||||||
StartShutdown();
|
StartShutdown();
|
||||||
return "CasinoCoin server stopping";
|
return ""+ COIN_NAME_DISPLAY + " server stopping";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ string HTTPPost(const string& strMsg, const map<string,string>& mapRequestHeader
|
|||||||
{
|
{
|
||||||
ostringstream s;
|
ostringstream s;
|
||||||
s << "POST / HTTP/1.1\r\n"
|
s << "POST / HTTP/1.1\r\n"
|
||||||
<< "User-Agent: casinocoin-json-rpc/" << FormatFullVersion() << "\r\n"
|
<< "User-Agent: "+ COIN_NAME + "-json-rpc/" << FormatFullVersion() << "\r\n"
|
||||||
<< "Host: 127.0.0.1\r\n"
|
<< "Host: 127.0.0.1\r\n"
|
||||||
<< "Content-Type: application/json\r\n"
|
<< "Content-Type: application/json\r\n"
|
||||||
<< "Content-Length: " << strMsg.size() << "\r\n"
|
<< "Content-Length: " << strMsg.size() << "\r\n"
|
||||||
@@ -330,7 +330,7 @@ static string HTTPReply(int nStatus, const string& strMsg, bool keepalive)
|
|||||||
if (nStatus == HTTP_UNAUTHORIZED)
|
if (nStatus == HTTP_UNAUTHORIZED)
|
||||||
return strprintf("HTTP/1.0 401 Authorization Required\r\n"
|
return strprintf("HTTP/1.0 401 Authorization Required\r\n"
|
||||||
"Date: %s\r\n"
|
"Date: %s\r\n"
|
||||||
"Server: casinocoin-json-rpc/%s\r\n"
|
"Server: "+ COIN_NAME + "-json-rpc/%s\r\n"
|
||||||
"WWW-Authenticate: Basic realm=\"jsonrpc\"\r\n"
|
"WWW-Authenticate: Basic realm=\"jsonrpc\"\r\n"
|
||||||
"Content-Type: text/html\r\n"
|
"Content-Type: text/html\r\n"
|
||||||
"Content-Length: 296\r\n"
|
"Content-Length: 296\r\n"
|
||||||
@@ -355,9 +355,9 @@ 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: casinocoin-json-rpc/%s\r\n"
|
"Server: "+ COIN_NAME + "-json-rpc/%s\r\n"
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"%s",
|
"%s",
|
||||||
nStatus,
|
nStatus,
|
||||||
@@ -737,7 +737,7 @@ void StartRPCThreads()
|
|||||||
{
|
{
|
||||||
unsigned char rand_pwd[32];
|
unsigned char rand_pwd[32];
|
||||||
RAND_bytes(rand_pwd, 32);
|
RAND_bytes(rand_pwd, 32);
|
||||||
string strWhatAmI = "To use casinocoind";
|
string strWhatAmI = "To use "+ COIN_NAME + "d";
|
||||||
if (mapArgs.count("-server"))
|
if (mapArgs.count("-server"))
|
||||||
strWhatAmI = strprintf(_("To use the %s option"), "\"-server\"");
|
strWhatAmI = strprintf(_("To use the %s option"), "\"-server\"");
|
||||||
else if (mapArgs.count("-daemon"))
|
else if (mapArgs.count("-daemon"))
|
||||||
@@ -746,13 +746,13 @@ void StartRPCThreads()
|
|||||||
_("%s, you must set a rpcpassword in the configuration file:\n"
|
_("%s, you must set a rpcpassword in the configuration file:\n"
|
||||||
"%s\n"
|
"%s\n"
|
||||||
"It is recommended you use the following random password:\n"
|
"It is recommended you use the following random password:\n"
|
||||||
"rpcuser=casinocoinrpc\n"
|
"rpcuser=")+ COIN_NAME + _("rpc\n"
|
||||||
"rpcpassword=%s\n"
|
"rpcpassword=%s\n"
|
||||||
"(you do not need to remember this password)\n"
|
"(you do not need to remember this password)\n"
|
||||||
"The username and password MUST NOT be the same.\n"
|
"The username and password MUST NOT be the same.\n"
|
||||||
"If the file does not exist, create it with owner-readable-only file permissions.\n"
|
"If the file does not exist, create it with owner-readable-only file permissions.\n"
|
||||||
"It is also recommended to set alertnotify so you are notified of problems;\n"
|
"It is also recommended to set alertnotify so you are notified of problems;\n"
|
||||||
"for example: alertnotify=echo %%s | mail -s \"CasinoCoin Alert\" admin@foo.com\n"),
|
"for example: alertnotify=echo %%s | mail -s \"")+ COIN_NAME_DISPLAY + _(" Alert\" admin@foo.com\n"),
|
||||||
strWhatAmI.c_str(),
|
strWhatAmI.c_str(),
|
||||||
GetConfigFile().string().c_str(),
|
GetConfigFile().string().c_str(),
|
||||||
EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str()),
|
EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str()),
|
||||||
|
|||||||
@@ -67,13 +67,21 @@ namespace Checkpoints
|
|||||||
( 317777, uint256("0x0458c7effe8348b551f47c3d7115c9347f4121749549650d495b88e8d0a9c666"))
|
( 317777, uint256("0x0458c7effe8348b551f47c3d7115c9347f4121749549650d495b88e8d0a9c666"))
|
||||||
( 347777, uint256("0x9ba10b9cd9b94e903e67da6a1033841a3e66b6a33f09cbaec2146d4f72dbea2d"))
|
( 347777, uint256("0x9ba10b9cd9b94e903e67da6a1033841a3e66b6a33f09cbaec2146d4f72dbea2d"))
|
||||||
( 377777, uint256("0x6eecff79e07910c69ac5340ad34c74cd95ecdfb0282ac62b30e7ba443114a628"))
|
( 377777, uint256("0x6eecff79e07910c69ac5340ad34c74cd95ecdfb0282ac62b30e7ba443114a628"))
|
||||||
( 444429, uint256("0x01f8b85612927fd3660e7e036f559770ebb09d896f54abf70d99be2fe1793155")) // last solved checkpoint candidate while updating
|
( 444429, uint256("0x01f8b85612927fd3660e7e036f559770ebb09d896f54abf70d99be2fe1793155"))
|
||||||
|
( 750000, uint256("0x4e5e0c5d7ee65cc0cf8cb995ef2c701773026baff189a922d9d51bba21cd8e8f"))
|
||||||
|
( 1000250, uint256("0x43ae9b7d1fcbe37eeb3dc3460b69a574d13e09cdec7d5da01c32d279a452842a"))
|
||||||
|
( 1105321, uint256("0xac44589a3914c6ad1e8e1d2d007fd76271abca6e38518e39b131ead11142f29d"))
|
||||||
|
( 1275800, uint256("0x8d74b3baf71c3f3f31e8d6f8c684d890f65764bded05d67f5d10c3b12ee59c75"))
|
||||||
|
( 1346290, uint256("0x0711f69754fe7f49b965d90db67f94025c3b89c114b60242513b1634220ce2c7"))
|
||||||
|
( 1461488, uint256("0xd23bc59328a745a8ed6803fcb7ea9f582dd09470ea24303ab0312ad8d29a5809"))
|
||||||
|
( 1525492, uint256("0xd315bf68cf03c43ebef827e6db8d5d86a43f261c6e1981a0a5ededa8243a73ce"))
|
||||||
|
// last solved checkpoint candidate while updating
|
||||||
// (we need to know the debug.log tx= for the last checkpoint)
|
// (we need to know the debug.log tx= for the last checkpoint)
|
||||||
;
|
;
|
||||||
static const CCheckpointData data = {
|
static const CCheckpointData data = {
|
||||||
&mapCheckpoints,
|
&mapCheckpoints,
|
||||||
1400510546, // * UNIX timestamp of last checkpoint block
|
1465265319, // * UNIX timestamp of last checkpoint block
|
||||||
661156, // * total number of transactions between genesis and last checkpoint
|
1923205, // * total number of transactions between genesis and last checkpoint
|
||||||
// (the tx=... number in the SetBestChain debug.log lines)
|
// (the tx=... number in the SetBestChain debug.log lines)
|
||||||
4 // * estimated number of transactions per day after checkpoint
|
4 // * estimated number of transactions per day after checkpoint
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
|
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
|
||||||
#define CLIENT_VERSION_MAJOR 2
|
#define CLIENT_VERSION_MAJOR 3
|
||||||
#define CLIENT_VERSION_MINOR 0
|
#define CLIENT_VERSION_MINOR 0
|
||||||
#define CLIENT_VERSION_REVISION 0
|
#define CLIENT_VERSION_REVISION 0
|
||||||
#define CLIENT_VERSION_BUILD 0
|
#define CLIENT_VERSION_BUILD 0
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
// Copyright year (2009-this)
|
// Copyright year (2009-this)
|
||||||
// Todo: update this when changing our copyright comments in the source
|
// Todo: update this when changing our copyright comments in the source
|
||||||
#define COPYRIGHT_YEAR 2015
|
#define COPYRIGHT_YEAR 2016
|
||||||
|
|
||||||
// Converts the parameter X to a string after macro replacement on X has been performed.
|
// Converts the parameter X to a string after macro replacement on X has been performed.
|
||||||
// Don't merge these into one macro!
|
// Don't merge these into one macro!
|
||||||
|
|||||||
@@ -6,13 +6,12 @@
|
|||||||
#define _BITCOIN_COMPAT_H 1
|
#define _BITCOIN_COMPAT_H 1
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define _WIN32_WINNT 0x0501
|
#define _WIN32_WINNT 0x0600
|
||||||
#define WIN32_LEAN_AND_MEAN 1
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
#ifndef NOMINMAX
|
#ifndef NOMINMAX
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#endif
|
#endif
|
||||||
#define FD_SETSIZE 1024 // max number of fds in fd_set
|
#define FD_SETSIZE 1024 // max number of fds in fd_set
|
||||||
#include <winsock2.h>
|
|
||||||
#include <mswsock.h>
|
#include <mswsock.h>
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
#else
|
#else
|
||||||
@@ -26,12 +25,12 @@
|
|||||||
#include <ifaddrs.h>
|
#include <ifaddrs.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef u_int SOCKET;
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define MSG_NOSIGNAL 0
|
#define MSG_NOSIGNAL 0
|
||||||
#define MSG_DONTWAIT 0
|
#define MSG_DONTWAIT 0
|
||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
#else
|
#else
|
||||||
|
typedef u_int SOCKET;
|
||||||
#include "errno.h"
|
#include "errno.h"
|
||||||
#define WSAGetLastError() errno
|
#define WSAGetLastError() errno
|
||||||
#define WSAEINVAL EINVAL
|
#define WSAEINVAL EINVAL
|
||||||
|
|||||||
@@ -456,7 +456,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;
|
||||||
|
|||||||
53
src/init.cpp
53
src/init.cpp
@@ -10,6 +10,7 @@
|
|||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "ui_interface.h"
|
#include "ui_interface.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/filesystem/fstream.hpp>
|
#include <boost/filesystem/fstream.hpp>
|
||||||
@@ -78,7 +79,7 @@ volatile bool fRequestShutdown = false;
|
|||||||
|
|
||||||
void StartShutdown()
|
void StartShutdown()
|
||||||
{
|
{
|
||||||
boost::this_thread::sleep_for( boost::chrono::seconds( 1 ) );
|
boost::this_thread::sleep_for( boost::chrono::seconds( 1 ) );
|
||||||
fRequestShutdown = true;
|
fRequestShutdown = true;
|
||||||
}
|
}
|
||||||
bool ShutdownRequested()
|
bool ShutdownRequested()
|
||||||
@@ -180,12 +181,12 @@ bool AppInit(int argc, char* argv[])
|
|||||||
if (mapArgs.count("-?") || mapArgs.count("--help"))
|
if (mapArgs.count("-?") || mapArgs.count("--help"))
|
||||||
{
|
{
|
||||||
// First part of help message is specific to bitcoind / RPC client
|
// First part of help message is specific to bitcoind / RPC client
|
||||||
std::string strUsage = _("CasinoCoin version") + " " + FormatFullVersion() + "\n\n" +
|
std::string strUsage = COIN_NAME_DISPLAY + " version" + " " + FormatFullVersion() + "\n\n" +
|
||||||
_("Usage:") + "\n" +
|
_("Usage:") + "\n" +
|
||||||
" casinocoind [options] " + "\n" +
|
" "+ COIN_NAME + "d [options] " + "\n" +
|
||||||
" casinocoind [options] <command> [params] " + _("Send command to -server or casinocoind") + "\n" +
|
" "+ COIN_NAME + "d [options] <command> [params] " + "Send command to -server or "+ COIN_NAME + "d" + "\n" +
|
||||||
" casinocoind [options] help " + _("List commands") + "\n" +
|
" "+ COIN_NAME + "d [options] help " + "List commands" + "\n" +
|
||||||
" casinocoind [options] help <command> " + _("Get help for a command") + "\n";
|
" "+ COIN_NAME + "d [options] help <command> " + "Get help for a command" + "\n";
|
||||||
|
|
||||||
strUsage += "\n" + HelpMessage();
|
strUsage += "\n" + HelpMessage();
|
||||||
|
|
||||||
@@ -195,7 +196,7 @@ bool AppInit(int argc, char* argv[])
|
|||||||
|
|
||||||
// Command-line RPC
|
// Command-line RPC
|
||||||
for (int i = 1; i < argc; i++)
|
for (int i = 1; i < argc; i++)
|
||||||
if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "casinocoin:"))
|
if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], (std::string("") + COIN_NAME + ":").c_str()))
|
||||||
fCommandLine = true;
|
fCommandLine = true;
|
||||||
|
|
||||||
if (fCommandLine)
|
if (fCommandLine)
|
||||||
@@ -298,8 +299,8 @@ std::string HelpMessage()
|
|||||||
{
|
{
|
||||||
string strUsage = _("Options:") + "\n" +
|
string strUsage = _("Options:") + "\n" +
|
||||||
" -? " + _("This help message") + "\n" +
|
" -? " + _("This help message") + "\n" +
|
||||||
" -conf=<file> " + _("Specify configuration file (default: casinocoin.conf)") + "\n" +
|
" -conf=<file> " + "Specify configuration file (default: "+ COIN_NAME + ".conf)" + "\n" +
|
||||||
" -pid=<file> " + _("Specify pid file (default: casinocoind.pid)") + "\n" +
|
" -pid=<file> " + "Specify pid file (default: "+ COIN_NAME + "d.pid)" + "\n" +
|
||||||
" -gen " + _("Generate coins (default: 0)") + "\n" +
|
" -gen " + _("Generate coins (default: 0)") + "\n" +
|
||||||
" -datadir=<dir> " + _("Specify data directory") + "\n" +
|
" -datadir=<dir> " + _("Specify data directory") + "\n" +
|
||||||
" -dbcache=<n> " + _("Set database cache size in megabytes (default: 25)") + "\n" +
|
" -dbcache=<n> " + _("Set database cache size in megabytes (default: 25)") + "\n" +
|
||||||
@@ -376,7 +377,7 @@ std::string HelpMessage()
|
|||||||
" -blockmaxsize=<n> " + _("Set maximum block size in bytes (default: 250000)") + "\n" +
|
" -blockmaxsize=<n> " + _("Set maximum block size in bytes (default: 250000)") + "\n" +
|
||||||
" -blockprioritysize=<n> " + _("Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)") + "\n" +
|
" -blockprioritysize=<n> " + _("Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)") + "\n" +
|
||||||
|
|
||||||
"\n" + _("SSL options: (see the CasinoCoin Wiki for SSL setup instructions)") + "\n" +
|
"\n" + "SSL options: (see the "+ COIN_NAME_DISPLAY + " Wiki for SSL setup instructions)" + "\n" +
|
||||||
" -rpcssl " + _("Use OpenSSL (https) for JSON-RPC connections") + "\n" +
|
" -rpcssl " + _("Use OpenSSL (https) for JSON-RPC connections") + "\n" +
|
||||||
" -rpcsslcertificatechainfile=<file.cert> " + _("Server certificate file (default: server.cert)") + "\n" +
|
" -rpcsslcertificatechainfile=<file.cert> " + _("Server certificate file (default: server.cert)") + "\n" +
|
||||||
" -rpcsslprivatekeyfile=<file.pem> " + _("Server private key (default: server.pem)") + "\n" +
|
" -rpcsslprivatekeyfile=<file.pem> " + _("Server private key (default: server.pem)") + "\n" +
|
||||||
@@ -645,12 +646,13 @@ bool AppInit2(boost::thread_group& threadGroup)
|
|||||||
if (file) fclose(file);
|
if (file) fclose(file);
|
||||||
static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
|
static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
|
||||||
if (!lock.try_lock())
|
if (!lock.try_lock())
|
||||||
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. CasinoCoin is probably already running."), strDataDir.c_str()));
|
return InitError(strprintf((std::string("Cannot obtain a lock on data directory %s. ")+ COIN_NAME_DISPLAY + " is probably already running.").c_str(), strDataDir.c_str()));
|
||||||
|
|
||||||
if (GetBoolArg("-shrinkdebugfile", !fDebug))
|
if (GetBoolArg("-shrinkdebugfile", !fDebug))
|
||||||
ShrinkDebugFile();
|
ShrinkDebugFile();
|
||||||
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
||||||
printf("CasinoCoin version %s (%s)\n", FormatFullVersion().c_str(), CLIENT_DATE.c_str());
|
std::string versionString = COIN_NAME_DISPLAY + " version %s (%s)\n";
|
||||||
|
printf(versionString.c_str(), FormatFullVersion().c_str(), CLIENT_DATE.c_str());
|
||||||
printf("Using OpenSSL version %s\n", SSLeay_version(SSLEAY_VERSION));
|
printf("Using OpenSSL version %s\n", SSLeay_version(SSLEAY_VERSION));
|
||||||
if (!fLogTimestamps)
|
if (!fLogTimestamps)
|
||||||
printf("Startup time: %s\n", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", GetTime()).c_str());
|
printf("Startup time: %s\n", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", GetTime()).c_str());
|
||||||
@@ -660,8 +662,9 @@ bool AppInit2(boost::thread_group& threadGroup)
|
|||||||
std::ostringstream strErrors;
|
std::ostringstream strErrors;
|
||||||
|
|
||||||
if (fDaemon)
|
if (fDaemon)
|
||||||
fprintf(stdout, "CasinoCoin server starting\n");
|
{
|
||||||
|
fprintf(stdout, "%s server starting\n", COIN_NAME_DISPLAY.c_str());
|
||||||
|
}
|
||||||
if (nScriptCheckThreads) {
|
if (nScriptCheckThreads) {
|
||||||
printf("Using %u threads for script verification\n", nScriptCheckThreads);
|
printf("Using %u threads for script verification\n", nScriptCheckThreads);
|
||||||
for (int i=0; i<nScriptCheckThreads-1; i++)
|
for (int i=0; i<nScriptCheckThreads-1; i++)
|
||||||
@@ -683,7 +686,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());
|
||||||
@@ -947,7 +950,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"))
|
||||||
{
|
{
|
||||||
@@ -1001,10 +1004,10 @@ bool AppInit2(boost::thread_group& threadGroup)
|
|||||||
InitWarning(msg);
|
InitWarning(msg);
|
||||||
}
|
}
|
||||||
else if (nLoadWalletRet == DB_TOO_NEW)
|
else if (nLoadWalletRet == DB_TOO_NEW)
|
||||||
strErrors << _("Error loading wallet.dat: Wallet requires newer version of CasinoCoin") << "\n";
|
strErrors << "Error loading wallet.dat: Wallet requires newer version of " << COIN_NAME_DISPLAY << "\n";
|
||||||
else if (nLoadWalletRet == DB_NEED_REWRITE)
|
else if (nLoadWalletRet == DB_NEED_REWRITE)
|
||||||
{
|
{
|
||||||
strErrors << _("Wallet needed to be rewritten: restart CasinoCoin to complete") << "\n";
|
strErrors << "Wallet needed to be rewritten: restart "<< COIN_NAME_DISPLAY << " to complete" << "\n";
|
||||||
printf("%s", strErrors.str().c_str());
|
printf("%s", strErrors.str().c_str());
|
||||||
return InitError(strErrors.str());
|
return InitError(strErrors.str());
|
||||||
}
|
}
|
||||||
@@ -1044,7 +1047,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);
|
||||||
|
|
||||||
@@ -1066,7 +1069,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++;
|
||||||
}
|
}
|
||||||
@@ -1099,7 +1102,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
|
||||||
@@ -1113,11 +1116,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);
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ $(shell CC="$(CC)" CXX="$(CXX)" TARGET_OS="$(TARGET_OS)" \
|
|||||||
include build_config.mk
|
include build_config.mk
|
||||||
|
|
||||||
CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
|
CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
|
||||||
CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT)
|
CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -std=c++14
|
||||||
|
|
||||||
LDFLAGS += $(PLATFORM_LDFLAGS)
|
LDFLAGS += $(PLATFORM_LDFLAGS)
|
||||||
LIBS += $(PLATFORM_LIBS)
|
LIBS += $(PLATFORM_LIBS)
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ case "$TARGET_OS" in
|
|||||||
;;
|
;;
|
||||||
OS_WINDOWS_CROSSCOMPILE | NATIVE_WINDOWS)
|
OS_WINDOWS_CROSSCOMPILE | NATIVE_WINDOWS)
|
||||||
PLATFORM=OS_WINDOWS
|
PLATFORM=OS_WINDOWS
|
||||||
COMMON_FLAGS="-fno-builtin-memcmp -D_REENTRANT -DOS_WINDOWS -DLEVELDB_PLATFORM_WINDOWS -DWINVER=0x0500 -D__USE_MINGW_ANSI_STDIO=1"
|
COMMON_FLAGS="-fno-builtin-memcmp -D_REENTRANT -DOS_WINDOWS -DLEVELDB_PLATFORM_WINDOWS -DWINVER=0x0600 -D__USE_MINGW_ANSI_STDIO=1"
|
||||||
PLATFORM_SOURCES="util/env_win.cc"
|
PLATFORM_SOURCES="util/env_win.cc"
|
||||||
PLATFORM_LIBS="-lshlwapi"
|
PLATFORM_LIBS="-lshlwapi"
|
||||||
PORT_FILE=port/port_win.cc
|
PORT_FILE=port/port_win.cc
|
||||||
|
|||||||
91
src/main.cpp
91
src/main.cpp
@@ -66,7 +66,7 @@ map<uint256, set<uint256> > mapOrphanTransactionsByPrev;
|
|||||||
// Constant stuff for coinbase transactions we create:
|
// Constant stuff for coinbase transactions we create:
|
||||||
CScript COINBASE_FLAGS;
|
CScript COINBASE_FLAGS;
|
||||||
|
|
||||||
const string strMessageMagic = "CasinoCoin Signed Message:\n";
|
const string strMessageMagic = COIN_NAME_DISPLAY + " Signed Message:\n";
|
||||||
|
|
||||||
double dHashesPerSec = 0.0;
|
double dHashesPerSec = 0.0;
|
||||||
int64 nHPSTimerStart = 0;
|
int64 nHPSTimerStart = 0;
|
||||||
@@ -309,7 +309,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;
|
||||||
}
|
}
|
||||||
@@ -755,7 +755,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);
|
||||||
|
|
||||||
@@ -1109,18 +1109,24 @@ int64 static GetBlockValue(int nHeight, int64 nFees)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Permantently reduce the number of mined coins to 10 after block 575000
|
// Permantently reduce the number of mined coins to 10 after block 575000
|
||||||
|
// Permantently reduce the number of minded coins to 1 after block 1575000
|
||||||
|
// coin supply at that height = 38577206
|
||||||
|
// Blocks until max coin supply -> 63000000 - 38577206 = 24422794
|
||||||
|
// New height for reduction to 0 coins -> 1575000 + 24422794 = 25997794
|
||||||
if(nHeight > 575000){
|
if(nHeight > 575000){
|
||||||
if(nHeight < 3756000){
|
if(nHeight < 1575000)
|
||||||
nSubsidy = 10 * COIN;
|
{
|
||||||
|
nSubsidy = 10 * COIN;
|
||||||
|
}
|
||||||
|
else if(nHeight >= 1575000 && nHeight <= 25997794){
|
||||||
|
nSubsidy = 1 * COIN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nSubsidy = 0 * COIN;
|
nSubsidy = 0 * COIN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// return subsidy + fees
|
||||||
|
|
||||||
|
|
||||||
return nSubsidy + nFees;
|
return nSubsidy + nFees;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1133,12 +1139,12 @@ int64 GetTotalCoinSupply(int nHeight, bool noCheckpoints)
|
|||||||
int heights[] = {
|
int heights[] = {
|
||||||
100000, 200000, 300000, 400000, 500000,
|
100000, 200000, 300000, 400000, 500000,
|
||||||
600000, 700000, 800000, 900000, 1000000,
|
600000, 700000, 800000, 900000, 1000000,
|
||||||
1100000
|
1100000, 1200000, 1300000, 1400000, 1500000
|
||||||
};
|
};
|
||||||
int64 supplies[] = {
|
int64 supplies[] = {
|
||||||
482721500000000, 982721500000000, 1482721500000000, 1982721500000000, 2482721500000000,
|
482721500000000, 982721500000000, 1482721500000000, 1982721500000000, 2482721500000000,
|
||||||
2882721500000000, 2982721500000000, 3082721500000000, 3182721500000000, 3282721500000000,
|
2882721500000000, 2982721500000000, 3082721500000000, 3182721500000000, 3282721500000000,
|
||||||
3382721500000000
|
3382721500000000, 3482721500000000, 3582721500000000, 3682721500000000, 3782721500000000
|
||||||
};
|
};
|
||||||
if (nHeight>=1 ) {
|
if (nHeight>=1 ) {
|
||||||
int numHeights = (int)(sizeof(heights)/sizeof(heights[0]));
|
int numHeights = (int)(sizeof(heights)/sizeof(heights[0]));
|
||||||
@@ -1239,7 +1245,7 @@ unsigned int static GetNextWorkRequired_V1(const CBlockIndex* pindexLast, const
|
|||||||
|
|
||||||
// Limit adjustment step
|
// Limit adjustment step
|
||||||
int64 nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime();
|
int64 nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime();
|
||||||
printf(" nActualTimespan = %"PRI64d" before bounds\n", nActualTimespan);
|
printf(" nActualTimespan = %" PRI64d " before bounds\n", nActualTimespan);
|
||||||
if (nActualTimespan < nTargetTimespan/4)
|
if (nActualTimespan < nTargetTimespan/4)
|
||||||
nActualTimespan = nTargetTimespan/4;
|
nActualTimespan = nTargetTimespan/4;
|
||||||
if (nActualTimespan > nTargetTimespan*4)
|
if (nActualTimespan > nTargetTimespan*4)
|
||||||
@@ -1256,7 +1262,7 @@ unsigned int static GetNextWorkRequired_V1(const CBlockIndex* pindexLast, const
|
|||||||
|
|
||||||
/// debug print
|
/// debug print
|
||||||
printf("Difficulty Retarget - GetNextWorkRequired_V1 RETARGET\n");
|
printf("Difficulty Retarget - GetNextWorkRequired_V1 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());
|
||||||
|
|
||||||
@@ -1390,7 +1396,7 @@ unsigned int static DigiShield(const CBlockIndex* pindexLast, const CBlockHeader
|
|||||||
|
|
||||||
// Limit adjustment step
|
// Limit adjustment step
|
||||||
int64 nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime();
|
int64 nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime();
|
||||||
printf(" nActualTimespan = %"PRI64d" before bounds\n", nActualTimespan);
|
printf(" nActualTimespan = %" PRI64d " before bounds\n", nActualTimespan);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1406,7 +1412,7 @@ unsigned int static DigiShield(const CBlockIndex* pindexLast, const CBlockHeader
|
|||||||
|
|
||||||
/// debug print
|
/// debug print
|
||||||
printf("DigiShield RETARGET \n");
|
printf("DigiShield RETARGET \n");
|
||||||
printf("retargetTimespan = %"PRI64d" nActualTimespan = %"PRI64d"\n", retargetTimespan, nActualTimespan);
|
printf("retargetTimespan = %" PRI64d " nActualTimespan = %" PRI64d "\n", retargetTimespan, 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());
|
||||||
|
|
||||||
@@ -1964,7 +1970,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);
|
||||||
@@ -2044,8 +2050,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
|
||||||
@@ -3153,7 +3159,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(),
|
||||||
@@ -3246,7 +3252,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3494,21 +3500,37 @@ void static ProcessGetData(CNode* pfrom)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool static CheckValidClientVersion(int clientVersion)
|
||||||
|
{
|
||||||
|
// From block 1575000 onwards version must be 80001 (MIN_PEER_PROTO_VERSION)
|
||||||
|
// Before that version was 70004
|
||||||
|
if(pindexBest->nHeight >= 1575000)
|
||||||
|
{
|
||||||
|
if(clientVersion < MIN_PEER_PROTO_VERSION)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(clientVersion < 70004)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
|
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");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (strCommand == "version")
|
if (strCommand == "version")
|
||||||
{
|
{
|
||||||
// Each connection can only send one version message
|
// Each connection can only send one version message
|
||||||
@@ -3523,7 +3545,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
|
|||||||
CAddress addrFrom;
|
CAddress addrFrom;
|
||||||
uint64 nNonce = 1;
|
uint64 nNonce = 1;
|
||||||
vRecv >> pfrom->nVersion >> pfrom->nServices >> nTime >> addrMe;
|
vRecv >> pfrom->nVersion >> pfrom->nServices >> nTime >> addrMe;
|
||||||
if (pfrom->nVersion < MIN_PEER_PROTO_VERSION)
|
// Check version related to blockheight
|
||||||
|
if(!CheckValidClientVersion(pfrom->nVersion))
|
||||||
{
|
{
|
||||||
// disconnect from peers older than this proto version
|
// disconnect from peers older than this proto version
|
||||||
printf("partner %s using obsolete version %i; disconnecting\n", pfrom->addr.ToString().c_str(), pfrom->nVersion);
|
printf("partner %s using obsolete version %i; disconnecting\n", pfrom->addr.ToString().c_str(), pfrom->nVersion);
|
||||||
@@ -3637,7 +3660,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
|
||||||
@@ -3700,7 +3723,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
|
||||||
@@ -3749,11 +3772,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());
|
||||||
@@ -3854,7 +3877,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->cleanSubVer.c_str(),
|
pfrom->addr.ToString().c_str(), pfrom->cleanSubVer.c_str(),
|
||||||
tx.GetHash().ToString().c_str(),
|
tx.GetHash().ToString().c_str(),
|
||||||
mempool.mapTx.size());
|
mempool.mapTx.size());
|
||||||
@@ -4492,7 +4515,7 @@ public:
|
|||||||
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
||||||
{
|
{
|
||||||
// Create new block
|
// Create new block
|
||||||
auto_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());
|
std::unique_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());
|
||||||
if(!pblocktemplate.get())
|
if(!pblocktemplate.get())
|
||||||
return NULL;
|
return NULL;
|
||||||
CBlock *pblock = &pblocktemplate->block; // pointer for convenience
|
CBlock *pblock = &pblocktemplate->block; // pointer for convenience
|
||||||
@@ -4703,7 +4726,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;
|
||||||
@@ -4860,13 +4883,13 @@ void static CasinoCoinMiner(CWallet *pwallet)
|
|||||||
unsigned int nTransactionsUpdatedLast = nTransactionsUpdated;
|
unsigned int nTransactionsUpdatedLast = nTransactionsUpdated;
|
||||||
CBlockIndex* pindexPrev = pindexBest;
|
CBlockIndex* pindexPrev = pindexBest;
|
||||||
|
|
||||||
auto_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey(reservekey));
|
std::unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey(reservekey));
|
||||||
if (!pblocktemplate.get())
|
if (!pblocktemplate.get())
|
||||||
return;
|
return;
|
||||||
CBlock *pblock = &pblocktemplate->block;
|
CBlock *pblock = &pblocktemplate->block;
|
||||||
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
|
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
|
||||||
|
|
||||||
printf("Running CasinoCoinMiner with %"PRIszu" transactions in block (%u bytes)\n", pblock->vtx.size(),
|
printf("Running CasinoCoinMiner with %" PRIszu " transactions in block (%u bytes)\n", pblock->vtx.size(),
|
||||||
::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION));
|
::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION));
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -448,7 +448,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
|
||||||
@@ -644,7 +644,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(),
|
||||||
@@ -1488,7 +1488,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(),
|
||||||
GetPoWHash().ToString().c_str(),
|
GetPoWHash().ToString().c_str(),
|
||||||
|
|||||||
@@ -16,16 +16,16 @@ USE_IPV6:=1
|
|||||||
USE_QRCODE=1
|
USE_QRCODE=1
|
||||||
|
|
||||||
# define libraries
|
# define libraries
|
||||||
BOOST_LIB_PATH=/home/ubuntu/deps/linux/boost_1_55_0/stage/lib
|
BOOST_LIB_PATH=$HOME/deps/boost_1_60_0/stage/lib
|
||||||
BDB_LIB_PATH=/home/ubuntu/deps/linux/db-4.8.30.NC/build_unix
|
BDB_LIB_PATH=$HOME/deps/db-5.1.29.NC/build_unix
|
||||||
OPENSSL_LIB_PATH=/home/ubuntu/deps/linux/openssl-1.0.1h
|
OPENSSL_LIB_PATH=$HOME/deps/openssl-1.0.2g
|
||||||
MINIUPNPC_LIB_PATH=/home/ubuntu/deps/linux/miniupnpc
|
MINIUPNPC_LIB_PATH=$HOME/deps/miniupnpc-1.9
|
||||||
|
|
||||||
# define includes
|
# define includes
|
||||||
BOOST_INCLUDE_PATH=/home/ubuntu/deps/linux/boost_1_55_0
|
BOOST_INCLUDE_PATH=$HOME/deps/boost_1_60_0
|
||||||
BDB_INCLUDE_PATH=/home/ubuntu/deps/linux/db-4.8.30.NC/build_unix
|
BDB_INCLUDE_PATH=$HOME/deps/db-5.1.29.NC/build_unix
|
||||||
OPENSSL_INCLUDE_PATH=/home/ubuntu/deps/linux/openssl-1.0.1h
|
OPENSSL_INCLUDE_PATH=$HOME/deps/openssl-1.0.2g
|
||||||
MINIUPNPC_INCLUDE_PATH=/home/ubuntu/deps/linux
|
MINIUPNPC_INCLUDE_PATH=$HOME/deps/miniupnpc-1.9
|
||||||
|
|
||||||
LINK:=$(CXX)
|
LINK:=$(CXX)
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ DEBUGFLAGS=-g
|
|||||||
|
|
||||||
# CXXFLAGS can be specified on the make command line, so we use xCXXFLAGS that only
|
# CXXFLAGS can be specified on the make command line, so we use xCXXFLAGS that only
|
||||||
# adds some defaults in front. Unfortunately, CXXFLAGS=... $(CXXFLAGS) does not work.
|
# adds some defaults in front. Unfortunately, CXXFLAGS=... $(CXXFLAGS) does not work.
|
||||||
xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \
|
xCXXFLAGS=-O2 -std=c++14 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \
|
||||||
$(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)
|
$(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)
|
||||||
|
|
||||||
# LDFLAGS can be specified on the make command line, so we use xLDFLAGS that only
|
# LDFLAGS can be specified on the make command line, so we use xLDFLAGS that only
|
||||||
|
|||||||
@@ -1262,7 +1262,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -366,7 +366,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;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public:
|
|||||||
QString getDescription() const{ return m_strDescription; }
|
QString getDescription() const{ return m_strDescription; }
|
||||||
double getLastBidPriceBTC() const{ return m_dblLastBidPriceBTC; }
|
double getLastBidPriceBTC() const{ return m_dblLastBidPriceBTC; }
|
||||||
double getLastAskPriceBTC() const{ return m_dblLastAskPriceBTC; }
|
double getLastAskPriceBTC() const{ return m_dblLastAskPriceBTC; }
|
||||||
double getLastPriceBTC() const{ return m_dblLastBidPriceBTC; }
|
double getLastPriceBTC() const{ return m_dblLastPriceBTC; }
|
||||||
double getVolume24H() const{ return m_dblVolume24H; }
|
double getVolume24H() const{ return m_dblVolume24H; }
|
||||||
QString getLastUpdateTime() const{ return m_strLastUpdateTime; }
|
QString getLastUpdateTime() const{ return m_strLastUpdateTime; }
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "guiconstants.h"
|
#include "guiconstants.h"
|
||||||
#include "walletmodel.h"
|
#include "walletmodel.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
@@ -98,7 +99,8 @@ void AskPassphraseDialog::accept()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm wallet encryption"),
|
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm wallet encryption"),
|
||||||
tr("Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR CASINOCOINS</b>!") + "<br><br>" + tr("Are you sure you wish to encrypt your wallet?"),
|
tr((std::string("Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR ")
|
||||||
|
+ COIN_NAME_DISPLAY + "</b>!").c_str()) + "<br><br>" + tr("Are you sure you wish to encrypt your wallet?"),
|
||||||
QMessageBox::Yes|QMessageBox::Cancel,
|
QMessageBox::Yes|QMessageBox::Cancel,
|
||||||
QMessageBox::Cancel);
|
QMessageBox::Cancel);
|
||||||
if(retval == QMessageBox::Yes)
|
if(retval == QMessageBox::Yes)
|
||||||
@@ -109,9 +111,9 @@ void AskPassphraseDialog::accept()
|
|||||||
{
|
{
|
||||||
QMessageBox::warning(this, tr("Wallet encrypted"),
|
QMessageBox::warning(this, tr("Wallet encrypted"),
|
||||||
"<qt>" +
|
"<qt>" +
|
||||||
tr("CasinoCoin will close now to finish the encryption process. "
|
tr((std::string("")+ COIN_NAME_DISPLAY + " will close now to finish the encryption process. "
|
||||||
"Remember that encrypting your wallet cannot fully protect "
|
"Remember that encrypting your wallet cannot fully protect "
|
||||||
"your casinocoins from being stolen by malware infecting your computer.") +
|
"your "+ COIN_NAME + " from being stolen by malware infecting your computer.").c_str()) +
|
||||||
"<br><br><b>" +
|
"<br><br><b>" +
|
||||||
tr("IMPORTANT: Any previous backups you have made of your wallet file "
|
tr("IMPORTANT: Any previous backups you have made of your wallet file "
|
||||||
"should be replaced with the newly generated, encrypted wallet file. "
|
"should be replaced with the newly generated, encrypted wallet file. "
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ static std::string Translate(const char* psz)
|
|||||||
static void handleRunawayException(std::exception *e)
|
static void handleRunawayException(std::exception *e)
|
||||||
{
|
{
|
||||||
PrintExceptionContinue(e, "Runaway exception");
|
PrintExceptionContinue(e, "Runaway exception");
|
||||||
QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occurred. CasinoCoin can no longer continue safely and will quit.") + QString("\n\n") + QString::fromStdString(strMiscWarning));
|
QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr(("A fatal error occurred. "+ COIN_NAME_DISPLAY + " can no longer continue safely and will quit.").c_str()) + QString("\n\n") + QString::fromStdString(strMiscWarning));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// This message can not be translated, as translation is not initialized yet
|
// This message can not be translated, as translation is not initialized yet
|
||||||
// (which not yet possible because lang=XX can be overridden in bitcoin.conf in the data directory)
|
// (which not yet possible because lang=XX can be overridden in bitcoin.conf in the data directory)
|
||||||
QMessageBox::critical(0, "CasinoCoin",
|
QMessageBox::critical(0, COIN_NAME_DISPLAY.c_str(),
|
||||||
QString("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"])));
|
QString("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"])));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -154,12 +154,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Application identification (must be set before OptionsModel is initialized,
|
// Application identification (must be set before OptionsModel is initialized,
|
||||||
// as it is used to locate QSettings)
|
// as it is used to locate QSettings)
|
||||||
QApplication::setOrganizationName("CasinoCoin");
|
QApplication::setOrganizationName(COIN_NAME_DISPLAY.c_str());
|
||||||
QApplication::setOrganizationDomain("casinocoin.org");
|
QApplication::setOrganizationDomain("casinocoin.org");
|
||||||
if(GetBoolArg("-testnet")) // Separate UI settings for testnet
|
if(GetBoolArg("-testnet")) // Separate UI settings for testnet
|
||||||
QApplication::setApplicationName("CasinoCoin-Qt-testnet");
|
QApplication::setApplicationName((""+ COIN_NAME_DISPLAY + "-Qt-testnet").c_str());
|
||||||
else
|
else
|
||||||
QApplication::setApplicationName("CasinoCoin-Qt");
|
QApplication::setApplicationName((""+ COIN_NAME_DISPLAY + "-Qt").c_str());
|
||||||
|
|
||||||
// ... then GUI settings:
|
// ... then GUI settings:
|
||||||
OptionsModel optionsModel;
|
OptionsModel optionsModel;
|
||||||
|
|||||||
@@ -135,5 +135,11 @@
|
|||||||
<file>qtquick_controls/qml/QmlGUIExchangesWindow.qml</file>
|
<file>qtquick_controls/qml/QmlGUIExchangesWindow.qml</file>
|
||||||
<file>qtquick_controls/qml/QmlGUIExchangesListView.qml</file>
|
<file>qtquick_controls/qml/QmlGUIExchangesListView.qml</file>
|
||||||
<file>qtquick_controls/qml/QmlGUIExchangesControl.qml</file>
|
<file>qtquick_controls/qml/QmlGUIExchangesControl.qml</file>
|
||||||
|
<file>twitter/FlipBar.qml</file>
|
||||||
|
<file>twitter/TweetDelegate.qml</file>
|
||||||
|
<file>twitter/tweetsearch.js</file>
|
||||||
|
<file>twitter/TweetsModel.qml</file>
|
||||||
|
<file>twitter/CasinocoinTwitterFeed.qml</file>
|
||||||
|
<file>twitter/resources/anonymous.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ void BitcoinGUI::restoreWindowGeometry()
|
|||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
QPoint pos = settings.value("nWindowPos").toPoint();
|
QPoint pos = settings.value("nWindowPos").toPoint();
|
||||||
QSize size = settings.value("nWindowSize", QSize(850, 550)).toSize();
|
QSize size = settings.value("nWindowSize", QSize(900, 650)).toSize();
|
||||||
if (!pos.x() && !pos.y())
|
if (!pos.x() && !pos.y())
|
||||||
{
|
{
|
||||||
QRect screen = QApplication::desktop()->screenGeometry();
|
QRect screen = QApplication::desktop()->screenGeometry();
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include "version.h"
|
||||||
// Automatically generated by extract_strings.py
|
// Automatically generated by extract_strings.py
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define UNUSED __attribute__((unused))
|
#define UNUSED __attribute__((unused))
|
||||||
@@ -6,18 +7,19 @@
|
|||||||
#define UNUSED
|
#define UNUSED
|
||||||
#endif
|
#endif
|
||||||
static const char UNUSED *bitcoin_strings[] = {
|
static const char UNUSED *bitcoin_strings[] = {
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("") +
|
||||||
"%s, you must set a rpcpassword in the configuration file:\n"
|
"%s, you must set a rpcpassword in the configuration file:\n" +
|
||||||
"%s\n"
|
"%s\n" +
|
||||||
"It is recommended you use the following random password:\n"
|
"It is recommended you use the following random password:\n" +
|
||||||
"rpcuser=casinocoinrpc\n"
|
"rpcuser=" + COIN_NAME +"rpc\n" +
|
||||||
"rpcpassword=%s\n"
|
"rpcpassword=%s\n" +
|
||||||
"(you do not need to remember this password)\n"
|
"(you do not need to remember this password)\n" +
|
||||||
"The username and password MUST NOT be the same.\n"
|
"The username and password MUST NOT be the same.\n" +
|
||||||
"If the file does not exist, create it with owner-readable-only file "
|
"If the file does not exist, create it with owner-readable-only file " +
|
||||||
"permissions.\n"
|
"permissions.\n" +
|
||||||
"It is also recommended to set alertnotify so you are notified of problems;\n"
|
"It is also recommended to set alertnotify so you are notified of problems;\n" +
|
||||||
"for example: alertnotify=echo %%s | mail -s \"CasinoCoin Alert\" admin@foo.com\n"),
|
"for example: alertnotify=echo %%s | mail -s \"" + COIN_NAME_DISPLAY +
|
||||||
|
" Alert\" admin@foo.com\n").c_str()),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
||||||
"Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:"
|
"Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:"
|
||||||
"@STRENGTH)"),
|
"@STRENGTH)"),
|
||||||
@@ -29,9 +31,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", ""
|
|||||||
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
||||||
"Bind to given address and always listen on it. Use [host]:port notation for "
|
"Bind to given address and always listen on it. Use [host]:port notation for "
|
||||||
"IPv6"),
|
"IPv6"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("") +
|
||||||
"Cannot obtain a lock on data directory %s. CasinoCoin is probably already "
|
"Cannot obtain a lock on data directory %s. "+ COIN_NAME_DISPLAY + " is probably already "
|
||||||
"running."),
|
"running.").c_str()),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
||||||
"Error: The transaction was rejected! This might happen if some of the coins "
|
"Error: The transaction was rejected! This might happen if some of the coins "
|
||||||
"in your wallet were already spent, such as if you used a copy of wallet.dat "
|
"in your wallet were already spent, such as if you used a copy of wallet.dat "
|
||||||
@@ -62,17 +64,17 @@ QT_TRANSLATE_NOOP("bitcoin-core", ""
|
|||||||
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
||||||
"This is a pre-release test build - use at your own risk - do not use for "
|
"This is a pre-release test build - use at your own risk - do not use for "
|
||||||
"mining or merchant applications"),
|
"mining or merchant applications"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("") +
|
||||||
"Unable to bind to %s on this computer. CasinoCoin is probably already running."),
|
"Unable to bind to %s on this computer. "+ COIN_NAME_DISPLAY + " is probably already running.").c_str()),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
||||||
"Warning: -paytxfee is set very high! This is the transaction fee you will "
|
"Warning: -paytxfee is set very high! This is the transaction fee you will "
|
||||||
"pay if you send a transaction."),
|
"pay if you send a transaction."),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
||||||
"Warning: Displayed transactions may not be correct! You may need to upgrade, "
|
"Warning: Displayed transactions may not be correct! You may need to upgrade, "
|
||||||
"or other nodes may need to upgrade."),
|
"or other nodes may need to upgrade."),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("") +
|
||||||
"Warning: Please check that your computer's date and time are correct! If "
|
"Warning: Please check that your computer's date and time are correct! If "
|
||||||
"your clock is wrong CasinoCoin will not work properly."),
|
"your clock is wrong "+ COIN_NAME_DISPLAY + " will not work properly.").c_str()),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
QT_TRANSLATE_NOOP("bitcoin-core", ""
|
||||||
"Warning: error reading wallet.dat! All keys read correctly, but transaction "
|
"Warning: error reading wallet.dat! All keys read correctly, but transaction "
|
||||||
"data or address book entries might be missing or incorrect."),
|
"data or address book entries might be missing or incorrect."),
|
||||||
@@ -91,7 +93,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Add a node to connect to and attempt to keep
|
|||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Allow JSON-RPC connections from specified IP address"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Allow JSON-RPC connections from specified IP address"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Attempt to recover private keys from a corrupt wallet.dat"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Attempt to recover private keys from a corrupt wallet.dat"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "CasinoCoin version"),
|
QT_TRANSLATE_NOOP("bitcoin-core", (COIN_NAME_DISPLAY + " version").c_str()),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Block creation options:"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Block creation options:"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot downgrade wallet"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot downgrade wallet"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -bind address: '%s'"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -bind address: '%s'"),
|
||||||
@@ -109,7 +111,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Error initializing wallet database environmen
|
|||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading block database"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading block database"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet corrupted"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet corrupted"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet requires newer version of CasinoCoin"),
|
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("Error loading wallet.dat: Wallet requires newer version of ")+ COIN_NAME_DISPLAY + "").c_str()),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Error opening block database"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Error opening block database"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Error"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Error"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low!"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low!"),
|
||||||
@@ -162,9 +164,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Rebuild block chain index from current blk000
|
|||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Rescan the block chain for missing wallet transactions"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Rescan the block chain for missing wallet transactions"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "SSL options: (see the CasinoCoin Wiki for SSL setup instructions)"),
|
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("SSL options: (see the ") + COIN_NAME_DISPLAY + " Wiki for SSL setup instructions)").c_str()),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Select the version of socks proxy to use (4-5, default: 5)"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Select the version of socks proxy to use (4-5, default: 5)"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Send command to -server or casinocoind"),
|
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("Send command to -server or ") + COIN_NAME + "d").c_str()),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Send commands to node running on <ip> (default: 127.0.0.1)"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Send commands to node running on <ip> (default: 127.0.0.1)"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to debugger"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to debugger"),
|
||||||
@@ -177,10 +179,10 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Set minimum block size in bytes (default: 0)"
|
|||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Set the number of threads to service RPC calls (default: 4)"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Set the number of threads to service RPC calls (default: 4)"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Shrink debug.log file on client startup (default: 1 when no -debug)"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Shrink debug.log file on client startup (default: 1 when no -debug)"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Signing transaction failed"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Signing transaction failed"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Specify configuration file (default: casinocoin.conf)"),
|
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("Specify configuration file (default: ") + COIN_NAME + ".conf)").c_str()),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Specify connection timeout in milliseconds (default: 5000)"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Specify connection timeout in milliseconds (default: 5000)"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Specify data directory"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Specify data directory"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Specify pid file (default: casinocoind.pid)"),
|
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("Specify pid file (default: ") + COIN_NAME + "d.pid)").c_str()),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "System error: "),
|
QT_TRANSLATE_NOOP("bitcoin-core", "System error: "),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "This help message"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "This help message"),
|
||||||
@@ -202,7 +204,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Use the test network"),
|
|||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Username for JSON-RPC connections"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Username for JSON-RPC connections"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying blocks..."),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying blocks..."),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet..."),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet..."),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart CasinoCoin to complete"),
|
QT_TRANSLATE_NOOP("bitcoin-core", (std::string("Wallet needed to be rewritten: restart ")+ COIN_NAME_DISPLAY + " to complete").c_str()),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Warning"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Warning"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade required!"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade required!"),
|
||||||
QT_TRANSLATE_NOOP("bitcoin-core", "You need to rebuild the database using -reindex to change -txindex"),
|
QT_TRANSLATE_NOOP("bitcoin-core", "You need to rebuild the database using -reindex to change -txindex"),
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ QList<Currencies::FiatCurrencyID> Currencies::availableCurrencies()
|
|||||||
currencylist.append(CNY);
|
currencylist.append(CNY);
|
||||||
currencylist.append(JPY);
|
currencylist.append(JPY);
|
||||||
currencylist.append(RUB);
|
currencylist.append(RUB);
|
||||||
|
currencylist.append(CAD);
|
||||||
|
currencylist.append(GBP);
|
||||||
|
currencylist.append(AUD);
|
||||||
|
currencylist.append(NZD);
|
||||||
return currencylist;
|
return currencylist;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,6 +32,10 @@ bool Currencies::valid(int currency)
|
|||||||
case CNY:
|
case CNY:
|
||||||
case JPY:
|
case JPY:
|
||||||
case RUB:
|
case RUB:
|
||||||
|
case CAD:
|
||||||
|
case GBP:
|
||||||
|
case AUD:
|
||||||
|
case NZD:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@@ -43,6 +51,10 @@ QString Currencies::name(int currency)
|
|||||||
case CNY: return QString("CNY");
|
case CNY: return QString("CNY");
|
||||||
case JPY: return QString("JPY");
|
case JPY: return QString("JPY");
|
||||||
case RUB: return QString("RUB");
|
case RUB: return QString("RUB");
|
||||||
|
case CAD: return QString("CAD");
|
||||||
|
case GBP: return QString("GBP");
|
||||||
|
case AUD: return QString("AUD");
|
||||||
|
case NZD: return QString("NZD");
|
||||||
default: return QString("???");
|
default: return QString("???");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,11 +63,15 @@ QString Currencies::description(int currency)
|
|||||||
{
|
{
|
||||||
switch(currency)
|
switch(currency)
|
||||||
{
|
{
|
||||||
case USD: return QString("US Dollars");
|
case USD: return QString("US Dollar");
|
||||||
case EUR: return QString("European Euro");
|
case EUR: return QString("European Euro");
|
||||||
case CNY: return QString("Chinese Yuan");
|
case CNY: return QString("Chinese Yuan");
|
||||||
case JPY: return QString("Japanese Yen");
|
case JPY: return QString("Japanese Yen");
|
||||||
case RUB: return QString("Russian Ruble");
|
case RUB: return QString("Russian Ruble");
|
||||||
|
case CAD: return QString("Canadian Dollar");
|
||||||
|
case GBP: return QString("British Pound");
|
||||||
|
case AUD: return QString("Australian Dollar");
|
||||||
|
case NZD: return QString("New Zealand Dollar");
|
||||||
default: return QString("???");
|
default: return QString("???");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -69,14 +85,22 @@ QString Currencies::symbol(int currency)
|
|||||||
case CNY: return QString("¥");
|
case CNY: return QString("¥");
|
||||||
case JPY: return QString("¥");
|
case JPY: return QString("¥");
|
||||||
case RUB: return QString("₽");
|
case RUB: return QString("₽");
|
||||||
|
case CAD: return QString("$");
|
||||||
|
case GBP: return QString("£");
|
||||||
|
case AUD: return QString("$");
|
||||||
|
case NZD: return QString("$");
|
||||||
default: return QString("$");
|
default: return QString("$");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Currencies::format(int currency, double value, bool useSymbol)
|
QString Currencies::format(int currency, double value, bool useSymbol, int decimals, bool isSatoshi)
|
||||||
{
|
{
|
||||||
// divide by satoshi
|
// divide by satoshi
|
||||||
double fiatValue = value * 0.00000001;
|
double fiatValue = value;
|
||||||
|
if(isSatoshi)
|
||||||
|
{
|
||||||
|
fiatValue *= 0.00000001;
|
||||||
|
}
|
||||||
QString formattedValue = "";
|
QString formattedValue = "";
|
||||||
if(useSymbol)
|
if(useSymbol)
|
||||||
{
|
{
|
||||||
@@ -84,7 +108,7 @@ QString Currencies::format(int currency, double value, bool useSymbol)
|
|||||||
}
|
}
|
||||||
// apply format
|
// apply format
|
||||||
QLocale::setDefault( QLocale(QLocale::English, QLocale::UnitedStates) );
|
QLocale::setDefault( QLocale(QLocale::English, QLocale::UnitedStates) );
|
||||||
formattedValue.append(QString("%L1").arg(fiatValue, 0, 'f', 2)).append(" ").append(name(currency));
|
formattedValue.append(QString("%L1").arg(fiatValue, 0, 'f', decimals)).append(" ").append(name(currency));
|
||||||
return formattedValue;
|
return formattedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ public:
|
|||||||
CNY,
|
CNY,
|
||||||
JPY,
|
JPY,
|
||||||
RUB,
|
RUB,
|
||||||
|
CAD,
|
||||||
|
GBP,
|
||||||
|
AUD,
|
||||||
|
NZD,
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Get list of currencies, for drop-down box
|
//! Get list of currencies, for drop-down box
|
||||||
@@ -29,7 +33,7 @@ public:
|
|||||||
//! symbol
|
//! symbol
|
||||||
static QString symbol(int currency);
|
static QString symbol(int currency);
|
||||||
//! Format value
|
//! Format value
|
||||||
static QString format(int currency, double value, bool symbol);
|
static QString format(int currency, double value, bool symbol, int decimals, bool isSatoshi);
|
||||||
|
|
||||||
//! @name AbstractListModel implementation
|
//! @name AbstractListModel implementation
|
||||||
//! List model for currency drop-down selection box.
|
//! List model for currency drop-down selection box.
|
||||||
|
|||||||
@@ -35,50 +35,12 @@
|
|||||||
<property name="horizontalSpacing">
|
<property name="horizontalSpacing">
|
||||||
<number>15</number>
|
<number>15</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QFrame" name="exchangeInfoBox">
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Sunken</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
|
||||||
<item row="1" column="0">
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayoutExchanges"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="lblExchangesHeader">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">color: rgb(166, 27, 31);</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Exchanges</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QFrame" name="coinInfoBox">
|
<widget class="QFrame" name="coinInfoBox">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>3</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>1</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="layoutDirection">
|
<property name="layoutDirection">
|
||||||
@@ -96,6 +58,12 @@
|
|||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="lblInformationHeader">
|
<widget class="QLabel" name="lblInformationHeader">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>10</pointsize>
|
<pointsize>10</pointsize>
|
||||||
@@ -120,19 +88,19 @@
|
|||||||
<number>15</number>
|
<number>15</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="verticalSpacing">
|
<property name="verticalSpacing">
|
||||||
<number>10</number>
|
<number>12</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>10</number>
|
<number>10</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>10</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>10</number>
|
<number>10</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>10</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="lblBlockHeight">
|
<widget class="QLabel" name="lblBlockHeight">
|
||||||
@@ -202,7 +170,7 @@
|
|||||||
<string notr="true">-</string>
|
<string notr="true">-</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -221,178 +189,6 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QLabel" name="txtCoinSupply">
|
<widget class="QLabel" name="txtCoinSupply">
|
||||||
<property name="palette">
|
|
||||||
<palette>
|
|
||||||
<active>
|
|
||||||
<colorrole role="WindowText">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>0</red>
|
|
||||||
<green>0</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Button">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>255</red>
|
|
||||||
<green>255</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Text">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>0</red>
|
|
||||||
<green>0</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="ButtonText">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>0</red>
|
|
||||||
<green>0</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Base">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>255</red>
|
|
||||||
<green>255</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Window">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>255</red>
|
|
||||||
<green>255</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
</active>
|
|
||||||
<inactive>
|
|
||||||
<colorrole role="WindowText">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>0</red>
|
|
||||||
<green>0</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Button">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>255</red>
|
|
||||||
<green>255</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Text">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>0</red>
|
|
||||||
<green>0</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="ButtonText">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>0</red>
|
|
||||||
<green>0</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Base">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>255</red>
|
|
||||||
<green>255</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Window">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>255</red>
|
|
||||||
<green>255</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
</inactive>
|
|
||||||
<disabled>
|
|
||||||
<colorrole role="WindowText">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>0</red>
|
|
||||||
<green>0</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Button">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>255</red>
|
|
||||||
<green>255</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Text">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>0</red>
|
|
||||||
<green>0</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="ButtonText">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>0</red>
|
|
||||||
<green>0</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Base">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>255</red>
|
|
||||||
<green>255</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
<colorrole role="Window">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>255</red>
|
|
||||||
<green>255</green>
|
|
||||||
<blue>255</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
</disabled>
|
|
||||||
</palette>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<weight>75</weight>
|
<weight>75</weight>
|
||||||
@@ -411,6 +207,66 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="lblCoinValue">
|
||||||
|
<property name="text">
|
||||||
|
<string>Coin Value</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QLabel" name="txtCoinValue">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>-</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="lblCoinFiatValue">
|
||||||
|
<property name="text">
|
||||||
|
<string>Coin Fiat Value</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QLabel" name="txtCoinFiatValue">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>-</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="lblEstimatedMarketCapital">
|
||||||
|
<property name="text">
|
||||||
|
<string>Estimated Marketcapital</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QLabel" name="txtEstimatedMarketCapital">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>-</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
<widget class="QLabel" name="lblConnections">
|
<widget class="QLabel" name="lblConnections">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
@@ -423,7 +279,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="6" column="1">
|
||||||
<widget class="QLabel" name="txtConnections">
|
<widget class="QLabel" name="txtConnections">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
@@ -442,7 +298,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="7" column="0">
|
||||||
<widget class="QLabel" name="lblDifficulty">
|
<widget class="QLabel" name="lblDifficulty">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
@@ -455,7 +311,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="7" column="1">
|
||||||
<widget class="QLabel" name="txtDifficulty">
|
<widget class="QLabel" name="txtDifficulty">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
@@ -474,7 +330,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="8" column="0">
|
||||||
<widget class="QLabel" name="lblHashRate">
|
<widget class="QLabel" name="lblHashRate">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
@@ -487,7 +343,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="8" column="1">
|
||||||
<widget class="QLabel" name="txtHashRate">
|
<widget class="QLabel" name="txtHashRate">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
@@ -506,43 +362,105 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
|
||||||
<widget class="QLabel" name="lblTransactionCount">
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Transactions</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1">
|
|
||||||
<widget class="QLabel" name="txtTransactionCount">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">-</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QFrame" name="twitterFeedBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>2</horstretch>
|
||||||
|
<verstretch>1</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="layoutDirection">
|
||||||
|
<enum>Qt::LeftToRight</enum>
|
||||||
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Sunken</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
|
<item row="1" column="0">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayoutTwitter"/>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lblTwitterHeader">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">color: rgb(166, 27, 31);</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Twitter</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QFrame" name="exchangeInfoBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>1</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Sunken</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
|
<item row="1" column="0">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayoutExchanges"/>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lblExchangesHeader">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">color: rgb(166, 27, 31);</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Exchanges</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|||||||
@@ -38,230 +38,265 @@
|
|||||||
<number>7</number>
|
<number>7</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>470</width>
|
<width>470</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>470</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>7</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="bottomMargin">
|
||||||
<size>
|
<number>7</number>
|
||||||
<width>470</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<item>
|
||||||
<property name="topMargin">
|
<layout class="QFormLayout" name="formLayout_2">
|
||||||
<number>7</number>
|
<property name="fieldGrowthPolicy">
|
||||||
</property>
|
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||||
<property name="bottomMargin">
|
</property>
|
||||||
<number>7</number>
|
<property name="horizontalSpacing">
|
||||||
</property>
|
<number>12</number>
|
||||||
<item>
|
</property>
|
||||||
<layout class="QFormLayout" name="formLayout_2">
|
<property name="verticalSpacing">
|
||||||
<property name="fieldGrowthPolicy">
|
<number>12</number>
|
||||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
</property>
|
||||||
</property>
|
<item row="0" column="0" colspan="2">
|
||||||
<property name="horizontalSpacing">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
<number>12</number>
|
<item>
|
||||||
</property>
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="verticalSpacing">
|
<property name="font">
|
||||||
<number>12</number>
|
<font>
|
||||||
</property>
|
<pointsize>10</pointsize>
|
||||||
<item row="0" column="0" colspan="2">
|
<weight>75</weight>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<bold>true</bold>
|
||||||
<item>
|
</font>
|
||||||
<widget class="QLabel" name="label_5">
|
</property>
|
||||||
<property name="font">
|
<property name="styleSheet">
|
||||||
<font>
|
<string notr="true">color: rgb(166, 27, 31);</string>
|
||||||
<pointsize>10</pointsize>
|
</property>
|
||||||
<weight>75</weight>
|
<property name="text">
|
||||||
<bold>true</bold>
|
<string>Wallet</string>
|
||||||
</font>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="styleSheet">
|
</item>
|
||||||
<string notr="true">color: rgb(166, 27, 31);</string>
|
<item>
|
||||||
</property>
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="text">
|
<property name="orientation">
|
||||||
<string>Wallet</string>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="sizeHint" stdset="0">
|
||||||
</item>
|
<size>
|
||||||
<item>
|
<width>40</width>
|
||||||
<spacer name="horizontalSpacer_2">
|
<height>20</height>
|
||||||
<property name="orientation">
|
</size>
|
||||||
<enum>Qt::Horizontal</enum>
|
</property>
|
||||||
</property>
|
</spacer>
|
||||||
<property name="sizeHint" stdset="0">
|
</item>
|
||||||
<size>
|
<item>
|
||||||
<width>40</width>
|
<widget class="QLabel" name="labelWalletStatus">
|
||||||
<height>20</height>
|
<property name="toolTip">
|
||||||
</size>
|
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the CasinoCoin network after a connection is established, but this process has not completed yet.</string>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
<property name="styleSheet">
|
||||||
</item>
|
<string notr="true">color: rgb(166, 27, 31);</string>
|
||||||
<item>
|
</property>
|
||||||
<widget class="QLabel" name="labelWalletStatus">
|
<property name="text">
|
||||||
<property name="toolTip">
|
<string notr="true">(out of sync)</string>
|
||||||
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the CasinoCoin network after a connection is established, but this process has not completed yet.</string>
|
</property>
|
||||||
</property>
|
<property name="alignment">
|
||||||
<property name="styleSheet">
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
<string notr="true">color: rgb(166, 27, 31);</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="text">
|
</item>
|
||||||
<string notr="true">(out of sync)</string>
|
</layout>
|
||||||
</property>
|
</item>
|
||||||
<property name="alignment">
|
<item row="1" column="0">
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
<widget class="QLabel" name="labelBalanceText">
|
||||||
</property>
|
<property name="text">
|
||||||
</widget>
|
<string>Balance:</string>
|
||||||
</item>
|
</property>
|
||||||
</layout>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="1">
|
||||||
<widget class="QLabel" name="labelBalanceText">
|
<widget class="QLabel" name="labelBalance">
|
||||||
<property name="text">
|
<property name="font">
|
||||||
<string>Balance:</string>
|
<font>
|
||||||
</property>
|
<pointsize>10</pointsize>
|
||||||
</widget>
|
<weight>75</weight>
|
||||||
</item>
|
<bold>true</bold>
|
||||||
<item row="1" column="1">
|
</font>
|
||||||
<widget class="QLabel" name="labelBalance">
|
</property>
|
||||||
<property name="font">
|
<property name="cursor">
|
||||||
<font>
|
<cursorShape>IBeamCursor</cursorShape>
|
||||||
<pointsize>10</pointsize>
|
</property>
|
||||||
<weight>75</weight>
|
<property name="toolTip">
|
||||||
<bold>true</bold>
|
<string>Your current balance</string>
|
||||||
</font>
|
</property>
|
||||||
</property>
|
<property name="text">
|
||||||
<property name="cursor">
|
<string notr="true">0 CSC</string>
|
||||||
<cursorShape>IBeamCursor</cursorShape>
|
</property>
|
||||||
</property>
|
<property name="alignment">
|
||||||
<property name="toolTip">
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
<string>Your current balance</string>
|
</property>
|
||||||
</property>
|
<property name="textInteractionFlags">
|
||||||
<property name="text">
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
<string notr="true">0 CSC</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="alignment">
|
</item>
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<item row="2" column="0">
|
||||||
</property>
|
<widget class="QLabel" name="labelUnconfirmedText">
|
||||||
<property name="textInteractionFlags">
|
<property name="text">
|
||||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
<string>Unconfirmed:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="1">
|
||||||
<widget class="QLabel" name="labelUnconfirmedText">
|
<widget class="QLabel" name="labelUnconfirmed">
|
||||||
<property name="text">
|
<property name="font">
|
||||||
<string>Unconfirmed:</string>
|
<font>
|
||||||
</property>
|
<weight>75</weight>
|
||||||
</widget>
|
<bold>true</bold>
|
||||||
</item>
|
</font>
|
||||||
<item row="2" column="1">
|
</property>
|
||||||
<widget class="QLabel" name="labelUnconfirmed">
|
<property name="cursor">
|
||||||
<property name="font">
|
<cursorShape>IBeamCursor</cursorShape>
|
||||||
<font>
|
</property>
|
||||||
<weight>75</weight>
|
<property name="toolTip">
|
||||||
<bold>true</bold>
|
<string>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</string>
|
||||||
</font>
|
</property>
|
||||||
</property>
|
<property name="text">
|
||||||
<property name="cursor">
|
<string notr="true">0 CSC</string>
|
||||||
<cursorShape>IBeamCursor</cursorShape>
|
</property>
|
||||||
</property>
|
<property name="alignment">
|
||||||
<property name="toolTip">
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
<string>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</string>
|
</property>
|
||||||
</property>
|
<property name="textInteractionFlags">
|
||||||
<property name="text">
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
<string notr="true">0 CSC</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="alignment">
|
</item>
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<item row="3" column="0">
|
||||||
</property>
|
<widget class="QLabel" name="labelImmatureText">
|
||||||
<property name="textInteractionFlags">
|
<property name="text">
|
||||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
<string>Immature:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="1">
|
||||||
<widget class="QLabel" name="labelImmatureText">
|
<widget class="QLabel" name="labelImmature">
|
||||||
<property name="text">
|
<property name="font">
|
||||||
<string>Immature:</string>
|
<font>
|
||||||
</property>
|
<weight>75</weight>
|
||||||
</widget>
|
<bold>true</bold>
|
||||||
</item>
|
</font>
|
||||||
<item row="3" column="1">
|
</property>
|
||||||
<widget class="QLabel" name="labelImmature">
|
<property name="toolTip">
|
||||||
<property name="font">
|
<string>Mined balance that has not yet matured</string>
|
||||||
<font>
|
</property>
|
||||||
<weight>75</weight>
|
<property name="text">
|
||||||
<bold>true</bold>
|
<string notr="true">0 CSC</string>
|
||||||
</font>
|
</property>
|
||||||
</property>
|
<property name="alignment">
|
||||||
<property name="toolTip">
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
<string>Mined balance that has not yet matured</string>
|
</property>
|
||||||
</property>
|
<property name="textInteractionFlags">
|
||||||
<property name="text">
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
<string notr="true">0 CSC</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="alignment">
|
</item>
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<item row="4" column="0">
|
||||||
</property>
|
<widget class="QLabel" name="labelBalanceFiatText">
|
||||||
<property name="textInteractionFlags">
|
<property name="text">
|
||||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
<string>Estimated Fiat Balance:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="1">
|
||||||
<widget class="QLabel" name="labelBalanceFiatText">
|
<widget class="QLabel" name="labelBalanceFiat">
|
||||||
<property name="text">
|
<property name="font">
|
||||||
<string>Estimated Fiat Balance:</string>
|
<font>
|
||||||
</property>
|
<weight>75</weight>
|
||||||
</widget>
|
<bold>true</bold>
|
||||||
</item>
|
</font>
|
||||||
<item row="4" column="1">
|
</property>
|
||||||
<widget class="QLabel" name="labelBalanceFiat">
|
<property name="toolTip">
|
||||||
<property name="font">
|
<string>Estimated Fiat balance calculated against current market value</string>
|
||||||
<font>
|
</property>
|
||||||
<weight>75</weight>
|
<property name="text">
|
||||||
<bold>true</bold>
|
<string notr="true">0</string>
|
||||||
</font>
|
</property>
|
||||||
</property>
|
<property name="alignment">
|
||||||
<property name="toolTip">
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
<string>Estimated Fiat balance calculated against current market value</string>
|
</property>
|
||||||
</property>
|
<property name="textInteractionFlags">
|
||||||
<property name="text">
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
<string notr="true">0</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="alignment">
|
</item>
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<item row="5" column="0">
|
||||||
</property>
|
<widget class="QLabel" name="lblTransactionCount">
|
||||||
<property name="textInteractionFlags">
|
<property name="styleSheet">
|
||||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="text">
|
||||||
</item>
|
<string>Transactions:</string>
|
||||||
<item row="5" column="0" colspan="2">
|
</property>
|
||||||
<spacer name="verticalSpacer">
|
<property name="wordWrap">
|
||||||
<property name="orientation">
|
<bool>true</bool>
|
||||||
<enum>Qt::Vertical</enum>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="sizeHint" stdset="0">
|
</item>
|
||||||
<size>
|
<item row="5" column="1">
|
||||||
<width>20</width>
|
<widget class="QLabel" name="txtTransactionCount">
|
||||||
<height>100</height>
|
<property name="font">
|
||||||
</size>
|
<font>
|
||||||
</property>
|
<weight>75</weight>
|
||||||
</spacer>
|
<bold>true</bold>
|
||||||
</item>
|
</font>
|
||||||
</layout>
|
</property>
|
||||||
</item>
|
<property name="styleSheet">
|
||||||
<item>
|
<string notr="true"/>
|
||||||
<layout class="QVBoxLayout" name="verticalLayoutAdvertWidget"/>
|
</property>
|
||||||
</item>
|
<property name="text">
|
||||||
</layout>
|
<string notr="true">-</string>
|
||||||
</widget>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0" colspan="2">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>100</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayoutAdvertWidget"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class GUI20Skin : public QObject
|
|||||||
Q_PROPERTY( QColor colorTextActiveAutocomplete READ GetColorTextActiveAutocomplete CONSTANT )
|
Q_PROPERTY( QColor colorTextActiveAutocomplete READ GetColorTextActiveAutocomplete CONSTANT )
|
||||||
Q_PROPERTY( QColor colorTextDisabled READ GetColorTextDisabled CONSTANT )
|
Q_PROPERTY( QColor colorTextDisabled READ GetColorTextDisabled CONSTANT )
|
||||||
Q_PROPERTY( QColor colorTextDisabledAutocomplete READ GetColorTextDisabledAutocomplete CONSTANT )
|
Q_PROPERTY( QColor colorTextDisabledAutocomplete READ GetColorTextDisabledAutocomplete CONSTANT )
|
||||||
|
Q_PROPERTY( QColor colorTextBlack READ GetColorTextBlack CONSTANT )
|
||||||
|
|
||||||
Q_ENUMS( ESizeConstants )
|
Q_ENUMS( ESizeConstants )
|
||||||
|
|
||||||
@@ -80,6 +81,7 @@ public:
|
|||||||
const QColor GetColorTextActiveAutocomplete() const {return colorTextActiveAutocomplete;}
|
const QColor GetColorTextActiveAutocomplete() const {return colorTextActiveAutocomplete;}
|
||||||
const QColor GetColorTextDisabled() const {return colorTextDisabled;}
|
const QColor GetColorTextDisabled() const {return colorTextDisabled;}
|
||||||
const QColor GetColorTextDisabledAutocomplete() const {return colorTextDisabledAutocomplete;}
|
const QColor GetColorTextDisabledAutocomplete() const {return colorTextDisabledAutocomplete;}
|
||||||
|
const QColor GetColorTextBlack() const {return colorTextBlack;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QColor colorToolbarMainGradientBegin;
|
const QColor colorToolbarMainGradientBegin;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#ifdef _WIN32_WINNT
|
#ifdef _WIN32_WINNT
|
||||||
#undef _WIN32_WINNT
|
#undef _WIN32_WINNT
|
||||||
#endif
|
#endif
|
||||||
#define _WIN32_WINNT 0x0501
|
#define _WIN32_WINNT 0x0600
|
||||||
#ifdef _WIN32_IE
|
#ifdef _WIN32_IE
|
||||||
#undef _WIN32_IE
|
#undef _WIN32_IE
|
||||||
#endif
|
#endif
|
||||||
@@ -84,7 +84,7 @@ void setupAmountWidget(QLineEdit *widget, QWidget *parent)
|
|||||||
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
|
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
|
||||||
{
|
{
|
||||||
// return if URI is not valid or is no bitcoin URI
|
// return if URI is not valid or is no bitcoin URI
|
||||||
if(!uri.isValid() || uri.scheme() != QString("casinocoin"))
|
if(!uri.isValid() || uri.scheme() != QString(COIN_NAME.c_str()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SendCoinsRecipient rv;
|
SendCoinsRecipient rv;
|
||||||
@@ -139,9 +139,9 @@ bool parseBitcoinURI(QString uri, SendCoinsRecipient *out)
|
|||||||
//
|
//
|
||||||
// Cannot handle this later, because bitcoin:// will cause Qt to see the part after // as host,
|
// Cannot handle this later, because bitcoin:// will cause Qt to see the part after // as host,
|
||||||
// which will lower-case it (and thus invalidate the address).
|
// which will lower-case it (and thus invalidate the address).
|
||||||
if(uri.startsWith("casinocoin://"))
|
if(uri.startsWith(QString((COIN_NAME + "://").c_str())))
|
||||||
{
|
{
|
||||||
uri.replace(0, 11, "casinocoin:");
|
uri.replace(0, (COIN_NAME.length()+1), QString((COIN_NAME + ":").c_str()));
|
||||||
}
|
}
|
||||||
QUrl uriInstance(uri);
|
QUrl uriInstance(uri);
|
||||||
return parseBitcoinURI(uriInstance, out);
|
return parseBitcoinURI(uriInstance, out);
|
||||||
@@ -301,7 +301,7 @@ bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt)
|
|||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
boost::filesystem::path static StartupShortcutPath()
|
boost::filesystem::path static StartupShortcutPath()
|
||||||
{
|
{
|
||||||
return GetSpecialFolderPath(CSIDL_STARTUP) / "CasinoCoin.lnk";
|
return GetSpecialFolderPath(CSIDL_STARTUP) / (COIN_NAME_DISPLAY + ".lnk").c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GetStartOnSystemStartup()
|
bool GetStartOnSystemStartup()
|
||||||
@@ -383,7 +383,7 @@ boost::filesystem::path static GetAutostartDir()
|
|||||||
|
|
||||||
boost::filesystem::path static GetAutostartFilePath()
|
boost::filesystem::path static GetAutostartFilePath()
|
||||||
{
|
{
|
||||||
return GetAutostartDir() / "casinocoin.desktop";
|
return GetAutostartDir() / ""+ COIN_NAME + ".desktop";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GetStartOnSystemStartup()
|
bool GetStartOnSystemStartup()
|
||||||
@@ -424,7 +424,7 @@ bool SetStartOnSystemStartup(bool fAutoStart)
|
|||||||
// Write a bitcoin.desktop file to the autostart directory:
|
// Write a bitcoin.desktop file to the autostart directory:
|
||||||
optionFile << "[Desktop Entry]\n";
|
optionFile << "[Desktop Entry]\n";
|
||||||
optionFile << "Type=Application\n";
|
optionFile << "Type=Application\n";
|
||||||
optionFile << "Name=CasinoCoin\n";
|
optionFile << "Name="+ COIN_NAME_DISPLAY + "\n";
|
||||||
optionFile << "Exec=" << pszExePath << " -min\n";
|
optionFile << "Exec=" << pszExePath << " -min\n";
|
||||||
optionFile << "Terminal=false\n";
|
optionFile << "Terminal=false\n";
|
||||||
optionFile << "Hidden=false\n";
|
optionFile << "Hidden=false\n";
|
||||||
@@ -495,10 +495,10 @@ bool SetStartOnSystemStartup(bool fAutoStart) { return false; }
|
|||||||
HelpMessageBox::HelpMessageBox(QWidget *parent) :
|
HelpMessageBox::HelpMessageBox(QWidget *parent) :
|
||||||
QMessageBox(parent)
|
QMessageBox(parent)
|
||||||
{
|
{
|
||||||
header = tr("CasinoCoin-Qt") + " " + tr("version") + " " +
|
header = tr((COIN_NAME_DISPLAY + "-Qt").c_str()) + " " + tr("version") + " " +
|
||||||
QString::fromStdString(FormatFullVersion()) + "\n\n" +
|
QString::fromStdString(FormatFullVersion()) + "\n\n" +
|
||||||
tr("Usage:") + "\n" +
|
tr("Usage:") + "\n" +
|
||||||
" casinocoin-qt [" + tr("command-line options") + "] " + "\n";
|
QString::fromStdString(" "+ COIN_NAME + "-qt [") + tr("command-line options") + "] " + "\n";
|
||||||
|
|
||||||
coreOptions = QString::fromStdString(HelpMessage());
|
coreOptions = QString::fromStdString(HelpMessage());
|
||||||
|
|
||||||
@@ -507,7 +507,7 @@ HelpMessageBox::HelpMessageBox(QWidget *parent) :
|
|||||||
" -min " + tr("Start minimized") + "\n" +
|
" -min " + tr("Start minimized") + "\n" +
|
||||||
" -splash " + tr("Show splash screen on startup (default: 1)") + "\n";
|
" -splash " + tr("Show splash screen on startup (default: 1)") + "\n";
|
||||||
|
|
||||||
setWindowTitle(tr("CasinoCoin-Qt"));
|
setWindowTitle(tr((COIN_NAME_DISPLAY + "-Qt").c_str()));
|
||||||
setTextFormat(Qt::PlainText);
|
setTextFormat(Qt::PlainText);
|
||||||
// setMinimumWidth is ignored for QMessageBox so put in non-breaking spaces to make it wider.
|
// setMinimumWidth is ignored for QMessageBox so put in non-breaking spaces to make it wider.
|
||||||
setText(header + QString(QChar(0x2003)).repeated(50));
|
setText(header + QString(QChar(0x2003)).repeated(50));
|
||||||
|
|||||||
@@ -4,34 +4,32 @@
|
|||||||
#include "clientmodel.h"
|
#include "clientmodel.h"
|
||||||
#include "bitcoinrpc.h"
|
#include "bitcoinrpc.h"
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
#include <QDebug>
|
||||||
#include "bitcoinunits.h"
|
#include "bitcoinunits.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "overviewpage.h"
|
||||||
#include "qtquick_controls/cpp/guiexchangeswidget.h"
|
#include "qtquick_controls/cpp/guiexchangeswidget.h"
|
||||||
|
#include "twitter/twitterwidget.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
InfoPage::InfoPage(QWidget *parent) :
|
InfoPage::InfoPage(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::InfoPage),
|
ui(new Ui::InfoPage),
|
||||||
exchangesWidget( 0 )
|
exchangesWidget( 0 ),
|
||||||
|
twitterWidget( 0 )
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
// ui->casinoInfoBox->setVisible(false);
|
ui->coinInfoBox->setMinimumHeight(250);
|
||||||
// ui->newsItemsBox->setVisible(false);
|
ui->twitterFeedBox->setMinimumHeight(250);
|
||||||
|
ui->exchangeInfoBox->setMinimumHeight(250);
|
||||||
|
createTwitterWidget();
|
||||||
createExchangesWidget();
|
createExchangesWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfoPage::setWalletModel(WalletModel *model)
|
void InfoPage::setWalletModel(WalletModel *model)
|
||||||
{
|
{
|
||||||
this->walletModel = model;
|
this->walletModel = model;
|
||||||
if(model)
|
|
||||||
{
|
|
||||||
// subscribe to transaction changes
|
|
||||||
connect(model, SIGNAL(numTransactionsChanged(int)), this, SLOT(setNumTransactions(int)));
|
|
||||||
setNumTransactions(model->getNumTransactions());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfoPage::setClientModel(ClientModel *model)
|
void InfoPage::setClientModel(ClientModel *model)
|
||||||
@@ -58,7 +56,10 @@ void InfoPage::setNumBlocks(int count, int countOfPeers)
|
|||||||
// block height changed so update all possible values as well
|
// block height changed so update all possible values as well
|
||||||
if(clientModel)
|
if(clientModel)
|
||||||
{
|
{
|
||||||
ui->txtLastBlockTime->setText(clientModel->getLastBlockDate().toString());
|
QDateTime blockTime = clientModel->getLastBlockDate().toTimeSpec(Qt::UTC);
|
||||||
|
QString formattedBlockTime = blockTime.toString("dd-MM-yyyy HH:mm:ss");
|
||||||
|
formattedBlockTime.append(" UTC");
|
||||||
|
ui->txtLastBlockTime->setText(formattedBlockTime);
|
||||||
ui->txtDifficulty->setText(QString::number(GetDifficulty()));
|
ui->txtDifficulty->setText(QString::number(GetDifficulty()));
|
||||||
ui->txtCoinSupply->setText(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, GetTotalCoinSupply(count, false)));
|
ui->txtCoinSupply->setText(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, GetTotalCoinSupply(count, false)));
|
||||||
double megaHash = GetNetworkHashRate(-1, count) / 1000000;
|
double megaHash = GetNetworkHashRate(-1, count) / 1000000;
|
||||||
@@ -66,11 +67,6 @@ void InfoPage::setNumBlocks(int count, int countOfPeers)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfoPage::setNumTransactions(int count)
|
|
||||||
{
|
|
||||||
ui->txtTransactionCount->setText(QString::number(count));
|
|
||||||
}
|
|
||||||
|
|
||||||
double InfoPage::GetNetworkHashRate(int lookup, int height) {
|
double InfoPage::GetNetworkHashRate(int lookup, int height) {
|
||||||
CBlockIndex *pb = pindexBest;
|
CBlockIndex *pb = pindexBest;
|
||||||
|
|
||||||
@@ -113,9 +109,22 @@ InfoPage::~InfoPage()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InfoPage::createTwitterWidget()
|
||||||
|
{
|
||||||
|
twitterWidget = new TwitterWidget( this );
|
||||||
|
ui->verticalLayoutTwitter->addWidget( twitterWidget->dockQmlToWidget() );
|
||||||
|
}
|
||||||
|
|
||||||
void InfoPage::createExchangesWidget()
|
void InfoPage::createExchangesWidget()
|
||||||
{
|
{
|
||||||
exchangesWidget = new GUIExchangesWidget( this );
|
exchangesWidget = new GUIExchangesWidget( this );
|
||||||
exchangesWidget->slotPopulateExchangesFromWeb();
|
exchangesWidget->slotPopulateExchangesFromWeb();
|
||||||
ui->verticalLayoutExchanges->addWidget( exchangesWidget->dockQmlToWidget() );
|
ui->verticalLayoutExchanges->addWidget( exchangesWidget->dockQmlToWidget() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InfoPage::setCoinValues(QString coinValue, QString coinFiatValue, QString marketCapital)
|
||||||
|
{
|
||||||
|
ui->txtCoinValue->setText(coinValue);
|
||||||
|
ui->txtCoinFiatValue->setText(coinFiatValue);
|
||||||
|
ui->txtEstimatedMarketCapital->setText(marketCapital);
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
class WalletModel;
|
class WalletModel;
|
||||||
class ClientModel;
|
class ClientModel;
|
||||||
class GUIExchangesWidget;
|
class GUIExchangesWidget;
|
||||||
|
class TwitterWidget;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class InfoPage;
|
class InfoPage;
|
||||||
@@ -20,8 +21,8 @@ public slots:
|
|||||||
void setNumConnections(int count);
|
void setNumConnections(int count);
|
||||||
/** Set number of blocks shown in the UI */
|
/** Set number of blocks shown in the UI */
|
||||||
void setNumBlocks(int count, int countOfPeers);
|
void setNumBlocks(int count, int countOfPeers);
|
||||||
/** Set number of transactions shown in the UI */
|
/** Set coin values */
|
||||||
void setNumTransactions(int count);
|
void setCoinValues(const QString coinValue, const QString coinFiatValue, const QString marketCapital);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit InfoPage(QWidget *parent = 0);
|
explicit InfoPage(QWidget *parent = 0);
|
||||||
@@ -34,8 +35,10 @@ private:
|
|||||||
WalletModel *walletModel;
|
WalletModel *walletModel;
|
||||||
ClientModel *clientModel;
|
ClientModel *clientModel;
|
||||||
GUIExchangesWidget* exchangesWidget;
|
GUIExchangesWidget* exchangesWidget;
|
||||||
|
TwitterWidget* twitterWidget;
|
||||||
|
|
||||||
void createExchangesWidget();
|
void createTwitterWidget();
|
||||||
|
void createExchangesWidget();
|
||||||
double GetNetworkHashRate(int lookup, int height);
|
double GetNetworkHashRate(int lookup, int height);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ OverviewPage::OverviewPage(QWidget *parent) :
|
|||||||
ui->listTransactions->setItemDelegate(txdelegate);
|
ui->listTransactions->setItemDelegate(txdelegate);
|
||||||
ui->listTransactions->setIconSize(QSize(DECORATION_SIZE, DECORATION_SIZE));
|
ui->listTransactions->setIconSize(QSize(DECORATION_SIZE, DECORATION_SIZE));
|
||||||
ui->listTransactions->setMinimumHeight(NUM_ITEMS * (DECORATION_SIZE + 2));
|
ui->listTransactions->setMinimumHeight(NUM_ITEMS * (DECORATION_SIZE + 2));
|
||||||
|
ui->listTransactions->setMinimumWidth(350);
|
||||||
ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect, false);
|
ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
|
|
||||||
connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SLOT(handleTransactionClicked(QModelIndex)));
|
connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SLOT(handleTransactionClicked(QModelIndex)));
|
||||||
@@ -139,8 +140,13 @@ OverviewPage::OverviewPage(QWidget *parent) :
|
|||||||
// start with displaying the "out of sync" warnings
|
// start with displaying the "out of sync" warnings
|
||||||
showOutOfSyncWarning(true);
|
showOutOfSyncWarning(true);
|
||||||
|
|
||||||
// get CoinInfo from the web
|
// get CoinInfo on startup
|
||||||
getCoinInfo();
|
getCoinInfo();
|
||||||
|
// start timer to get CoinInfo from the web every interval
|
||||||
|
coinInfoRefreshTimer.setSingleShot( false );
|
||||||
|
coinInfoRefreshTimer.setInterval( 1000 * 300 ); // every 5 minuts
|
||||||
|
connect( &coinInfoRefreshTimer, SIGNAL( timeout() ), this, SLOT(getCoinInfo()), Qt::UniqueConnection );
|
||||||
|
coinInfoRefreshTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewPage::handleTransactionClicked(const QModelIndex &index)
|
void OverviewPage::handleTransactionClicked(const QModelIndex &index)
|
||||||
@@ -213,6 +219,10 @@ void OverviewPage::setWalletModel(WalletModel *model)
|
|||||||
|
|
||||||
// set visibility of adverts widget
|
// set visibility of adverts widget
|
||||||
updateDisplayPromotions(model->getOptionsModel()->getDisplayPromotions());
|
updateDisplayPromotions(model->getOptionsModel()->getDisplayPromotions());
|
||||||
|
|
||||||
|
// subscribe to transaction changes
|
||||||
|
connect(model, SIGNAL(numTransactionsChanged(int)), this, SLOT(setNumTransactions(int)));
|
||||||
|
setNumTransactions(model->getNumTransactions());
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the display unit, to not use the default ("BTC")
|
// update the display unit, to not use the default ("BTC")
|
||||||
@@ -257,6 +267,7 @@ void OverviewPage::updateCoinInfoFromWeb( JsonCoinInfoParser* coinInfoParser )
|
|||||||
{
|
{
|
||||||
qDebug() << "CoinInfo ID: " << coinInfoParser->getCoinInfo().find("ID").value().toDouble();
|
qDebug() << "CoinInfo ID: " << coinInfoParser->getCoinInfo().find("ID").value().toDouble();
|
||||||
qDebug() << "CoinInfo InfoTime: " <<coinInfoParser->getCoinInfo().find("InfoTime").value().toString();
|
qDebug() << "CoinInfo InfoTime: " <<coinInfoParser->getCoinInfo().find("InfoTime").value().toString();
|
||||||
|
qDebug() << "CoinInfo CoinValue: " << QString::number( coinInfoParser->getCoinInfo().find("PriceBTC").value().toDouble(), 'f', 8 );
|
||||||
// save the coin information
|
// save the coin information
|
||||||
coinInformation = coinInfoParser->getCoinInfo();
|
coinInformation = coinInfoParser->getCoinInfo();
|
||||||
// calculate and set the estimated fiat balance
|
// calculate and set the estimated fiat balance
|
||||||
@@ -271,9 +282,19 @@ void OverviewPage::updateFiatBalance(int currency)
|
|||||||
if(!coinInformation.isEmpty())
|
if(!coinInformation.isEmpty())
|
||||||
{
|
{
|
||||||
QString conversionCurrency = QString("Price").append(Currencies::name(currency));
|
QString conversionCurrency = QString("Price").append(Currencies::name(currency));
|
||||||
|
QString coinValue = QString::number( coinInformation.find("PriceBTC").value().toDouble(), 'f', 8 );
|
||||||
double currencyValue = coinInformation.find(conversionCurrency).value().toDouble();
|
double currencyValue = coinInformation.find(conversionCurrency).value().toDouble();
|
||||||
|
double marketCapValue = coinInformation.find("MarketCapital").value().toDouble();
|
||||||
|
// create formated fiat value
|
||||||
|
QString formattedFiatValue = Currencies::format(currency, currencyValue, true, 4, false);
|
||||||
|
// create formatted market capital value
|
||||||
|
QString formattedMarketCapital = Currencies::format(Currencies::USD, marketCapValue, true, 2, false);
|
||||||
|
// emit signal for change value
|
||||||
|
emit coinValueChanged(coinValue, formattedFiatValue, formattedMarketCapital);
|
||||||
|
// calculate and set fiat balance
|
||||||
double fiatBalance = currentBalance * currencyValue;
|
double fiatBalance = currentBalance * currencyValue;
|
||||||
ui->labelBalanceFiat->setText(Currencies::format(currency,fiatBalance,true));
|
QString fiatBalanceString = Currencies::format(currency,fiatBalance,true, 2, true);
|
||||||
|
ui->labelBalanceFiat->setText(fiatBalanceString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,6 +311,11 @@ void OverviewPage::updateDisplayPromotions(bool checked)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OverviewPage::setNumTransactions(int count)
|
||||||
|
{
|
||||||
|
ui->txtTransactionCount->setText(QString::number(count));
|
||||||
|
}
|
||||||
|
|
||||||
OverviewPage::~OverviewPage()
|
OverviewPage::~OverviewPage()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class OverviewPage;
|
class OverviewPage;
|
||||||
@@ -35,9 +36,11 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance);
|
void setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance);
|
||||||
|
void setNumTransactions(int count);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void transactionClicked(const QModelIndex &index);
|
void transactionClicked(const QModelIndex &index);
|
||||||
|
void coinValueChanged(const QString coinValue, const QString formattedCoinFiatValue, const QString marketCapital);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::OverviewPage *ui;
|
Ui::OverviewPage *ui;
|
||||||
@@ -56,8 +59,8 @@ private:
|
|||||||
/** Get the CoinInfo from REST service */
|
/** Get the CoinInfo from REST service */
|
||||||
CasinoCoinWebAPIParser* cscWebApiParser;
|
CasinoCoinWebAPIParser* cscWebApiParser;
|
||||||
CasinoCoinWebAPI* cscWebApi;
|
CasinoCoinWebAPI* cscWebApi;
|
||||||
void getCoinInfo();
|
|
||||||
QJsonObject coinInformation;
|
QJsonObject coinInformation;
|
||||||
|
QTimer coinInfoRefreshTimer;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateDisplayUnit();
|
void updateDisplayUnit();
|
||||||
@@ -66,6 +69,7 @@ private slots:
|
|||||||
void updateCoinInfoFromWeb( JsonCoinInfoParser* coinInfoParser );
|
void updateCoinInfoFromWeb( JsonCoinInfoParser* coinInfoParser );
|
||||||
void updateFiatBalance(int currency);
|
void updateFiatBalance(int currency);
|
||||||
void updateDisplayPromotions(bool checked);
|
void updateDisplayPromotions(bool checked);
|
||||||
|
void getCoinInfo();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // OVERVIEWPAGE_H
|
#endif // OVERVIEWPAGE_H
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ PaymentServer::PaymentServer(QApplication* parent) : QObject(parent), saveURIs(t
|
|||||||
uriServer = new QLocalServer(this);
|
uriServer = new QLocalServer(this);
|
||||||
|
|
||||||
if (!uriServer->listen(name))
|
if (!uriServer->listen(name))
|
||||||
qDebug() << tr("Cannot start casinocoin: click-to-pay handler");
|
qDebug() << tr((std::string("Cannot start ")+ COIN_NAME + ": click-to-pay handler").c_str());
|
||||||
else
|
else
|
||||||
connect(uriServer, SIGNAL(newConnection()), this, SLOT(handleURIConnection()));
|
connect(uriServer, SIGNAL(newConnection()), this, SLOT(handleURIConnection()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include "guiconstants.h"
|
#include "guiconstants.h"
|
||||||
#include "guiutil.h"
|
#include "guiutil.h"
|
||||||
#include "optionsmodel.h"
|
#include "optionsmodel.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#if QT_VERSION < 0x050000
|
#if QT_VERSION < 0x050000
|
||||||
@@ -85,7 +86,7 @@ void QRCodeDialog::genCode()
|
|||||||
|
|
||||||
QString QRCodeDialog::getURI()
|
QString QRCodeDialog::getURI()
|
||||||
{
|
{
|
||||||
QString ret = QString("casinocoin:%1").arg(address);
|
QString ret = QString((COIN_NAME + ":%1").c_str()).arg(address);
|
||||||
int paramCount = 0;
|
int paramCount = 0;
|
||||||
|
|
||||||
ui->outUri->clear();
|
ui->outUri->clear();
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ QWidget* GUIExchangesWidget::dockQmlToWidget()
|
|||||||
pPlaceHolder = QWidget::createWindowContainer( pExchangesWindow, this );
|
pPlaceHolder = QWidget::createWindowContainer( pExchangesWindow, this );
|
||||||
if ( pPlaceHolder )
|
if ( pPlaceHolder )
|
||||||
{
|
{
|
||||||
pPlaceHolder->setMinimumSize( 500, 200 );
|
pPlaceHolder->setMinimumSize( 500, 170 );
|
||||||
pPlaceHolder->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
pPlaceHolder->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
139
src/qt/twitter/CasinocoinTwitterFeed.qml
Normal file
139
src/qt/twitter/CasinocoinTwitterFeed.qml
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2015 The Qt Company Ltd.
|
||||||
|
** Contact: http://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of the examples of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:BSD$
|
||||||
|
** You may use this file under the terms of the BSD license as follows:
|
||||||
|
**
|
||||||
|
** "Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions are
|
||||||
|
** met:
|
||||||
|
** * Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** * Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in
|
||||||
|
** the documentation and/or other materials provided with the
|
||||||
|
** distribution.
|
||||||
|
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived
|
||||||
|
** from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
import "tweetsearch.js" as Helper
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: id_TwitterRoot
|
||||||
|
width: parent ? parent.width : 0
|
||||||
|
height: parent ? parent.height : 0
|
||||||
|
color: GUI20Skin.colorFrameBackground
|
||||||
|
|
||||||
|
property int inAnimDur: 250
|
||||||
|
property int counter: 0
|
||||||
|
property alias isLoading: tweetsModel.isLoading
|
||||||
|
property var idx
|
||||||
|
property var ids
|
||||||
|
|
||||||
|
Component.onCompleted: ids = new Array()
|
||||||
|
|
||||||
|
function idInModel(id)
|
||||||
|
{
|
||||||
|
for (var j = 0; j < ids.length; j++)
|
||||||
|
if (ids[j] === id)
|
||||||
|
return 1
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
TweetsModel {
|
||||||
|
id: tweetsModel
|
||||||
|
onIsLoaded: {
|
||||||
|
console.debug("Reload")
|
||||||
|
idx = new Array()
|
||||||
|
for (var i = 0; i < tweetsModel.model.count; i++) {
|
||||||
|
var id = tweetsModel.model.get(i).id
|
||||||
|
if (!idInModel(id))
|
||||||
|
idx.push(i)
|
||||||
|
}
|
||||||
|
console.debug(idx.length + " new tweets")
|
||||||
|
id_TwitterRoot.counter = idx.length
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: timer
|
||||||
|
interval: 500; running: id_TwitterRoot.counter; repeat: true
|
||||||
|
onTriggered: {
|
||||||
|
id_TwitterRoot.counter--;
|
||||||
|
var id = tweetsModel.model.get(idx[id_TwitterRoot.counter]).id;
|
||||||
|
var item = tweetsModel.model.get(id_TwitterRoot.counter);
|
||||||
|
if(item.retweeted_status != undefined){
|
||||||
|
item = item.retweeted_status;
|
||||||
|
}
|
||||||
|
mainListView.add( { "statusText": Helper.insertLinks(item.text, item.entities),
|
||||||
|
"twitterName": item.user.screen_name,
|
||||||
|
"name" : item.user.name,
|
||||||
|
"userImage": item.user.profile_image_url,
|
||||||
|
"source": item.source,
|
||||||
|
"id": id,
|
||||||
|
"uri": Helper.insertLinks(item.user.url, item.user.entities),
|
||||||
|
"published": item.created_at } );
|
||||||
|
ids.push(id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: refreshTwitterFeedTimer
|
||||||
|
interval: 600000;
|
||||||
|
running: true;
|
||||||
|
repeat: true;
|
||||||
|
onTriggered: tweetsModel.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollView {
|
||||||
|
id: mainScrollView
|
||||||
|
anchors.fill: id_TwitterRoot
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: mainListView
|
||||||
|
anchors.fill: mainScrollView
|
||||||
|
delegate: TweetDelegate { }
|
||||||
|
model: ListModel { id: finalModel }
|
||||||
|
|
||||||
|
add: Transition {
|
||||||
|
NumberAnimation { property: "hm"; from: 0; to: 1.0; duration: 300; easing.type: Easing.OutQuad }
|
||||||
|
PropertyAction { property: "appear"; value: 250 }
|
||||||
|
}
|
||||||
|
|
||||||
|
onDragEnded: tweetsModel.reload()
|
||||||
|
|
||||||
|
function clear() {
|
||||||
|
ids = new Array()
|
||||||
|
model.clear()
|
||||||
|
}
|
||||||
|
|
||||||
|
function add(obj) {
|
||||||
|
model.insert(0, obj)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
173
src/qt/twitter/FlipBar.qml
Normal file
173
src/qt/twitter/FlipBar.qml
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2015 The Qt Company Ltd.
|
||||||
|
** Contact: http://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of the examples of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:BSD$
|
||||||
|
** You may use this file under the terms of the BSD license as follows:
|
||||||
|
**
|
||||||
|
** "Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions are
|
||||||
|
** met:
|
||||||
|
** * Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** * Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in
|
||||||
|
** the documentation and/or other materials provided with the
|
||||||
|
** distribution.
|
||||||
|
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived
|
||||||
|
** from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: container
|
||||||
|
property int animDuration: 300
|
||||||
|
property Item front: Item {}
|
||||||
|
property Item back: Item {}
|
||||||
|
property real factor: 0.1 // amount the edges fold in for the 3D effect
|
||||||
|
property alias delta: effect.delta
|
||||||
|
property Item cur: frontShown ? front : back
|
||||||
|
property Item noncur: frontShown ? back : front
|
||||||
|
|
||||||
|
function swap() {
|
||||||
|
var tmp = front;
|
||||||
|
front = back;
|
||||||
|
back = tmp;
|
||||||
|
resync();
|
||||||
|
}
|
||||||
|
|
||||||
|
width: cur.width
|
||||||
|
height: cur.height
|
||||||
|
onFrontChanged: resync();
|
||||||
|
onBackChanged: resync();
|
||||||
|
|
||||||
|
function resync() {//TODO: Are the items ever actually visible?
|
||||||
|
back.parent = container;
|
||||||
|
front.parent = container;
|
||||||
|
frontShown ? back.visible = false : front.visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
property bool frontShown: true
|
||||||
|
|
||||||
|
onFrontShownChanged: {
|
||||||
|
back.visible = !frontShown
|
||||||
|
front.visible = frontShown
|
||||||
|
}
|
||||||
|
|
||||||
|
function flipUp(start) {
|
||||||
|
effect.visible = true;
|
||||||
|
effect.sourceA = effect.source1
|
||||||
|
effect.sourceB = effect.source2
|
||||||
|
if (start == undefined)
|
||||||
|
start = 1.0;
|
||||||
|
deltaAnim.from = start;
|
||||||
|
deltaAnim.to = 0.0
|
||||||
|
dAnim.start();
|
||||||
|
frontShown = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function flipDown(start) {
|
||||||
|
effect.visible = true;
|
||||||
|
effect.sourceA = effect.source1
|
||||||
|
effect.sourceB = effect.source2
|
||||||
|
if (start == undefined)
|
||||||
|
start = 0.0;
|
||||||
|
deltaAnim.from = start;
|
||||||
|
deltaAnim.to = 1.0
|
||||||
|
dAnim.start();
|
||||||
|
frontShown = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ShaderEffect {
|
||||||
|
id: effect
|
||||||
|
width: cur.width
|
||||||
|
height: cur.height
|
||||||
|
property real factor: container.factor * width
|
||||||
|
property real delta: 1.0
|
||||||
|
|
||||||
|
mesh: GridMesh { resolution: Qt.size(8,2) }
|
||||||
|
|
||||||
|
SequentialAnimation on delta {
|
||||||
|
id: dAnim
|
||||||
|
running: false
|
||||||
|
NumberAnimation {
|
||||||
|
id: deltaAnim
|
||||||
|
duration: animDuration//expose anim
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
property variant sourceA: source1
|
||||||
|
property variant sourceB: source1
|
||||||
|
property variant source1: ShaderEffectSource {
|
||||||
|
sourceItem: front
|
||||||
|
hideSource: effect.visible
|
||||||
|
}
|
||||||
|
|
||||||
|
property variant source2: ShaderEffectSource {
|
||||||
|
sourceItem: back
|
||||||
|
hideSource: effect.visible
|
||||||
|
}
|
||||||
|
|
||||||
|
fragmentShader: "
|
||||||
|
uniform lowp float qt_Opacity;
|
||||||
|
uniform sampler2D sourceA;
|
||||||
|
uniform sampler2D sourceB;
|
||||||
|
uniform highp float delta;
|
||||||
|
varying highp vec2 qt_TexCoord0;
|
||||||
|
void main() {
|
||||||
|
highp vec4 tex = vec4(qt_TexCoord0.x, qt_TexCoord0.y * 2.0, qt_TexCoord0.x, (qt_TexCoord0.y-0.5) * 2.0);
|
||||||
|
highp float shade = clamp(delta*2.0, 0.5, 1.0);
|
||||||
|
highp vec4 col;
|
||||||
|
if (qt_TexCoord0.y < 0.5) {
|
||||||
|
col = texture2D(sourceA, tex.xy) * (shade);
|
||||||
|
} else {
|
||||||
|
col = texture2D(sourceB, tex.zw) * (1.5 - shade);
|
||||||
|
col.w = 1.0;
|
||||||
|
}
|
||||||
|
gl_FragColor = col * qt_Opacity;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
property real h: height
|
||||||
|
vertexShader: "
|
||||||
|
uniform highp float delta;
|
||||||
|
uniform highp float factor;
|
||||||
|
uniform highp float h;
|
||||||
|
uniform highp mat4 qt_Matrix;
|
||||||
|
attribute highp vec4 qt_Vertex;
|
||||||
|
attribute highp vec2 qt_MultiTexCoord0;
|
||||||
|
varying highp vec2 qt_TexCoord0;
|
||||||
|
void main() {
|
||||||
|
highp vec4 pos = qt_Vertex;
|
||||||
|
if (qt_MultiTexCoord0.y == 0.0)
|
||||||
|
pos.x += factor * (1. - delta) * (qt_MultiTexCoord0.x * -2.0 + 1.0);
|
||||||
|
else if (qt_MultiTexCoord0.y == 1.0)
|
||||||
|
pos.x += factor * (delta) * (qt_MultiTexCoord0.x * -2.0 + 1.0);
|
||||||
|
else
|
||||||
|
pos.y = delta * h;
|
||||||
|
gl_Position = qt_Matrix * pos;
|
||||||
|
qt_TexCoord0 = qt_MultiTexCoord0;
|
||||||
|
}"
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
188
src/qt/twitter/TweetDelegate.qml
Normal file
188
src/qt/twitter/TweetDelegate.qml
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2015 The Qt Company Ltd.
|
||||||
|
** Contact: http://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of the examples of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:BSD$
|
||||||
|
** You may use this file under the terms of the BSD license as follows:
|
||||||
|
**
|
||||||
|
** "Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions are
|
||||||
|
** met:
|
||||||
|
** * Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** * Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in
|
||||||
|
** the documentation and/or other materials provided with the
|
||||||
|
** distribution.
|
||||||
|
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived
|
||||||
|
** from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
import "tweetsearch.js" as Helper
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: container
|
||||||
|
property real hm: 1.0
|
||||||
|
property int appear: -1
|
||||||
|
property real startRotation: 1
|
||||||
|
|
||||||
|
onAppearChanged: {
|
||||||
|
container.startRotation = 0.5
|
||||||
|
flipBar.animDuration = appear;
|
||||||
|
delayedAnim.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
SequentialAnimation {
|
||||||
|
id: delayedAnim
|
||||||
|
PauseAnimation { duration: 50 }
|
||||||
|
ScriptAction { script: flipBar.flipDown(startRotation); }
|
||||||
|
}
|
||||||
|
|
||||||
|
width: parent ? parent.width : 0
|
||||||
|
height: flipBar.height * hm
|
||||||
|
|
||||||
|
FlipBar {
|
||||||
|
id: flipBar
|
||||||
|
|
||||||
|
property bool flipped: false
|
||||||
|
delta: startRotation
|
||||||
|
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
width: container.ListView.view ? container.ListView.view.width : 0
|
||||||
|
height: Math.max(72, tweet.y + tweet.height + 10)
|
||||||
|
|
||||||
|
front: Rectangle {
|
||||||
|
width: container.ListView.view ? container.ListView.view.width : 0
|
||||||
|
height: Math.max(72, tweet.y + tweet.height + 10)
|
||||||
|
|
||||||
|
Rectangle { color: GUI20Skin.colorToolbarMainGradientEnd; width: parent.width; height: 1 }
|
||||||
|
Rectangle { color: GUI20Skin.colorToolbarMainGradientEnd; width: parent.width; height: 1; anchors.bottom: parent.bottom }
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: placeHolder
|
||||||
|
source: "resources/anonymous.png"
|
||||||
|
x: 10; y: 9
|
||||||
|
visible: avatar.status != Image.Ready
|
||||||
|
}
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: avatar
|
||||||
|
source: model.userImage
|
||||||
|
anchors.fill: placeHolder
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
flipBar.flipUp()
|
||||||
|
flipBar.flipped = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: name
|
||||||
|
text: model.name
|
||||||
|
anchors { left: avatar.right; leftMargin: 10; top: avatar.top; topMargin: -3 }
|
||||||
|
font.pixelSize: 12
|
||||||
|
font.bold: true
|
||||||
|
color: GUI20Skin.colorToolbarMainGradientEnd
|
||||||
|
linkColor: "blue"
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: tweet
|
||||||
|
text: model.statusText
|
||||||
|
anchors { left: avatar.right; leftMargin: 10; top: name.bottom; topMargin: 0; right: parent.right; rightMargin: 10 }
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
font.pixelSize: 12
|
||||||
|
font.bold: false
|
||||||
|
color: "black"
|
||||||
|
linkColor: "blue"
|
||||||
|
onLinkActivated: {
|
||||||
|
var tag = link.split("https://twitter.com/search?q=%23")
|
||||||
|
var user = link.split("https://twitter.com/")
|
||||||
|
if (tag[1] != undefined) {
|
||||||
|
mainListView.positionViewAtBeginning()
|
||||||
|
mainListView.clear()
|
||||||
|
mainListView.autoSearch('tag', tag[1])
|
||||||
|
tweetsModel.from = ""
|
||||||
|
tweetsModel.phrase = "#" + tag[1]
|
||||||
|
} else if (user[1] != undefined) {
|
||||||
|
mainListView.positionViewAtBeginning()
|
||||||
|
mainListView.clear()
|
||||||
|
mainListView.autoSearch('user', user[1])
|
||||||
|
tweetsModel.phrase = ""
|
||||||
|
tweetsModel.from = user[1]
|
||||||
|
} else
|
||||||
|
Qt.openUrlExternally(link)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
back: Rectangle {
|
||||||
|
width: container.ListView.view ? container.ListView.view.width : 0
|
||||||
|
height: Math.max(72, tweet.y + tweet.height + 10)
|
||||||
|
color: "#be4a25"
|
||||||
|
|
||||||
|
Rectangle { color: "#ff6633"; width: parent.width; height: 1 }
|
||||||
|
Rectangle { color: "#80341a"; width: parent.width; height: 1; anchors.bottom: parent.bottom }
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: avatar2
|
||||||
|
source: model.userImage
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 10
|
||||||
|
y: 9
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
flipBar.flipDown()
|
||||||
|
flipBar.flipped = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: username
|
||||||
|
text: model.twitterName
|
||||||
|
x: 10; anchors { top: avatar2.top; topMargin: -3 }
|
||||||
|
font.pixelSize: 12
|
||||||
|
font.bold: true
|
||||||
|
color: "black"
|
||||||
|
linkColor: "blue"
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: model.source + "<br>" + Helper.formatDate(model.published) + "<br>" + model.uri
|
||||||
|
x: 10; anchors { top: username.bottom; topMargin: 0 }
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
font.pixelSize: 12
|
||||||
|
font.bold: false
|
||||||
|
color: "#ffc2ad"
|
||||||
|
linkColor: "blue"
|
||||||
|
onLinkActivated: Qt.openUrlExternally(link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
126
src/qt/twitter/TweetsModel.qml
Normal file
126
src/qt/twitter/TweetsModel.qml
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2015 The Qt Company Ltd.
|
||||||
|
** Contact: http://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of the examples of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:BSD$
|
||||||
|
** You may use this file under the terms of the BSD license as follows:
|
||||||
|
**
|
||||||
|
** "Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions are
|
||||||
|
** met:
|
||||||
|
** * Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** * Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in
|
||||||
|
** the documentation and/or other materials provided with the
|
||||||
|
** distribution.
|
||||||
|
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived
|
||||||
|
** from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
import "tweetsearch.js" as Helper
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: wrapper
|
||||||
|
|
||||||
|
//! [auth tokens]
|
||||||
|
property string consumerKey : ""
|
||||||
|
property string consumerSecret : ""
|
||||||
|
//! [auth tokens]
|
||||||
|
property string bearerToken : ""
|
||||||
|
|
||||||
|
property variant model: tweets
|
||||||
|
property string from : "CasinocoinNews"
|
||||||
|
property string phrase : ""
|
||||||
|
|
||||||
|
property int status: XMLHttpRequest.UNSENT
|
||||||
|
property bool isLoading: status === XMLHttpRequest.LOADING
|
||||||
|
property bool wasLoading: false
|
||||||
|
signal isLoaded
|
||||||
|
|
||||||
|
ListModel { id: tweets }
|
||||||
|
|
||||||
|
function encodePhrase(x) { return encodeURIComponent(x); }
|
||||||
|
|
||||||
|
function reload() {
|
||||||
|
tweets.clear()
|
||||||
|
|
||||||
|
if (from == "" && phrase == "")
|
||||||
|
return;
|
||||||
|
|
||||||
|
//! [requesting]
|
||||||
|
var req = new XMLHttpRequest;
|
||||||
|
req.open("GET", "https://api.twitter.com/1.1/statuses/user_timeline.json?" +
|
||||||
|
"&count=10&screen_name=" + from);
|
||||||
|
req.setRequestHeader("Authorization", "Bearer " + bearerToken);
|
||||||
|
req.onreadystatechange = function() {
|
||||||
|
status = req.readyState;
|
||||||
|
if (status === XMLHttpRequest.DONE) {
|
||||||
|
var objectArray = JSON.parse(req.responseText);
|
||||||
|
if (objectArray.errors !== undefined)
|
||||||
|
console.log("Error fetching tweets: " + objectArray.errors[0].message)
|
||||||
|
else {
|
||||||
|
for (var key in objectArray) {
|
||||||
|
var jsonObject = objectArray[key];
|
||||||
|
tweets.append(jsonObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (wasLoading == true)
|
||||||
|
wrapper.isLoaded()
|
||||||
|
}
|
||||||
|
wasLoading = (status === XMLHttpRequest.LOADING);
|
||||||
|
}
|
||||||
|
req.send();
|
||||||
|
//! [requesting]
|
||||||
|
}
|
||||||
|
|
||||||
|
onPhraseChanged: reload();
|
||||||
|
onFromChanged: reload();
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (consumerKey === "" || consumerSecret == "") {
|
||||||
|
bearerToken = encodeURIComponent(Helper.demoToken())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var authReq = new XMLHttpRequest;
|
||||||
|
authReq.open("POST", "https://api.twitter.com/oauth2/token");
|
||||||
|
authReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
|
||||||
|
authReq.setRequestHeader("Authorization", "Basic " + Qt.btoa(consumerKey + ":" + consumerSecret));
|
||||||
|
authReq.onreadystatechange = function() {
|
||||||
|
if (authReq.readyState === XMLHttpRequest.DONE) {
|
||||||
|
var jsonResponse = JSON.parse(authReq.responseText);
|
||||||
|
if (jsonResponse.errors !== undefined)
|
||||||
|
console.log("Authentication error: " + jsonResponse.errors[0].message)
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bearerToken = jsonResponse.access_token;
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
authReq.send("grant_type=client_credentials");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
BIN
src/qt/twitter/resources/anonymous.png
Normal file
BIN
src/qt/twitter/resources/anonymous.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src/qt/twitter/resources/bird-anim-sprites.png
Normal file
BIN
src/qt/twitter/resources/bird-anim-sprites.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
src/qt/twitter/resources/icon-clear.png
Normal file
BIN
src/qt/twitter/resources/icon-clear.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/qt/twitter/resources/icon-loading.png
Normal file
BIN
src/qt/twitter/resources/icon-loading.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/qt/twitter/resources/icon-refresh.png
Normal file
BIN
src/qt/twitter/resources/icon-refresh.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/qt/twitter/resources/icon-search.png
Normal file
BIN
src/qt/twitter/resources/icon-search.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
62
src/qt/twitter/tweetsearch.js
Normal file
62
src/qt/twitter/tweetsearch.js
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
.pragma library
|
||||||
|
|
||||||
|
function formatDate(date)
|
||||||
|
{
|
||||||
|
var da = new Date(date)
|
||||||
|
return da.toDateString()
|
||||||
|
}
|
||||||
|
|
||||||
|
function demoToken()
|
||||||
|
{
|
||||||
|
var a = new Array(22).join('A')
|
||||||
|
return a + String.fromCharCode(0x44, 0x69, 0x4a, 0x52, 0x51, 0x41, 0x41, 0x41, 0x41,
|
||||||
|
0x41, 0x41, 0x74, 0x2b, 0x72, 0x6a, 0x6c, 0x2b, 0x71,
|
||||||
|
0x6d, 0x7a, 0x30, 0x72, 0x63, 0x79, 0x2b, 0x42, 0x62,
|
||||||
|
0x75, 0x58, 0x42, 0x42, 0x73, 0x72, 0x55, 0x48, 0x47,
|
||||||
|
0x45, 0x67, 0x3d, 0x71, 0x30, 0x45, 0x4b, 0x32, 0x61,
|
||||||
|
0x57, 0x71, 0x51, 0x4d, 0x62, 0x31, 0x35, 0x67, 0x43,
|
||||||
|
0x5a, 0x4e, 0x77, 0x5a, 0x6f, 0x39, 0x79, 0x71, 0x61,
|
||||||
|
0x65, 0x30, 0x68, 0x70, 0x65, 0x32, 0x46, 0x44, 0x73,
|
||||||
|
0x53, 0x39, 0x32, 0x57, 0x41, 0x75, 0x30, 0x67)
|
||||||
|
}
|
||||||
|
|
||||||
|
function linkForEntity(entity)
|
||||||
|
{
|
||||||
|
return (entity.url ? entity.url :
|
||||||
|
(entity.screen_name ? 'https://twitter.com/' + entity.screen_name :
|
||||||
|
'https://twitter.com/search?q=%23' + entity.text))
|
||||||
|
}
|
||||||
|
|
||||||
|
function textForEntity(entity)
|
||||||
|
{
|
||||||
|
return (entity.display_url ? entity.display_url :
|
||||||
|
(entity.screen_name ? entity.screen_name : entity.text))
|
||||||
|
}
|
||||||
|
|
||||||
|
function insertLinks(text, entities)
|
||||||
|
{
|
||||||
|
if (typeof text !== 'string')
|
||||||
|
return "";
|
||||||
|
|
||||||
|
if (!entities)
|
||||||
|
return text;
|
||||||
|
|
||||||
|
// Add all links (urls, usernames and hashtags) to an array and sort them in
|
||||||
|
// descending order of appearance in text
|
||||||
|
var links = []
|
||||||
|
if (entities.urls)
|
||||||
|
links = entities.urls.concat(entities.hashtags, entities.user_mentions)
|
||||||
|
else if (entities.url)
|
||||||
|
links = entities.url.urls
|
||||||
|
|
||||||
|
links.sort(function(a, b) { return b.indices[0] - a.indices[0] })
|
||||||
|
|
||||||
|
for (var i = 0; i < links.length; i++) {
|
||||||
|
var offset = links[i].url ? 0 : 1
|
||||||
|
text = text.substring(0, links[i].indices[0] + offset) +
|
||||||
|
'<a href=\"' + linkForEntity(links[i]) + '\">' +
|
||||||
|
textForEntity(links[i]) + '</a>' +
|
||||||
|
text.substring(links[i].indices[1])
|
||||||
|
}
|
||||||
|
return text.replace(/\n/g, '<br>');
|
||||||
|
}
|
||||||
40
src/qt/twitter/twitterwidget.cpp
Normal file
40
src/qt/twitter/twitterwidget.cpp
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#include "twitterwidget.h"
|
||||||
|
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QQuickView>
|
||||||
|
#include <QQmlContext>
|
||||||
|
|
||||||
|
#include "gui20_skin.h"
|
||||||
|
|
||||||
|
TwitterWidget::TwitterWidget(QWidget *parent)
|
||||||
|
: QWidget(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
TwitterWidget::~TwitterWidget()
|
||||||
|
{
|
||||||
|
// member objects are moved to qml engine and it manages their instances
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget* TwitterWidget::dockQmlToWidget()
|
||||||
|
{
|
||||||
|
QQuickView* pTwitterWindow = new QQuickView;
|
||||||
|
QWidget* pPlaceHolder = 0;
|
||||||
|
if ( pTwitterWindow )
|
||||||
|
{
|
||||||
|
QQmlContext* pContext = pTwitterWindow->rootContext();
|
||||||
|
if ( pContext )
|
||||||
|
{
|
||||||
|
pContext->setContextProperty( "GUI20Skin", &GUI20Skin::Instance() );
|
||||||
|
}
|
||||||
|
pTwitterWindow->setSource( QUrl( QStringLiteral( "qrc:/qml/twitter/CasinocoinTwitterFeed.qml" ) ) );
|
||||||
|
pPlaceHolder = QWidget::createWindowContainer( pTwitterWindow, this );
|
||||||
|
if ( pPlaceHolder )
|
||||||
|
{
|
||||||
|
pPlaceHolder->setMinimumSize( 500, 170 );
|
||||||
|
pPlaceHolder->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pPlaceHolder;
|
||||||
|
}
|
||||||
25
src/qt/twitter/twitterwidget.h
Normal file
25
src/qt/twitter/twitterwidget.h
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef TWITTERWIDGET_H
|
||||||
|
#define TWITTERWIDGET_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
class TwitterWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
TwitterWidget( QWidget *parent = 0) ;
|
||||||
|
~TwitterWidget();
|
||||||
|
|
||||||
|
QWidget* dockQmlToWidget();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
private:
|
||||||
|
void registerCustomQmlTypes();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TWITTERWIDGET_H
|
||||||
@@ -91,7 +91,8 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui):
|
|||||||
connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));
|
connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString)));
|
||||||
// Clicking on "Export" allows to export the transaction list
|
// Clicking on "Export" allows to export the transaction list
|
||||||
connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked()));
|
connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked()));
|
||||||
|
// subscribe to coin value changes
|
||||||
|
connect(overviewPage, SIGNAL(coinValueChanged(const QString, const QString, const QString)), infoPage, SLOT(setCoinValues(const QString, const QString, const QString)));
|
||||||
gotoOverviewPage();
|
gotoOverviewPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ Value importprivkey(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
if (fHelp || params.size() < 1 || params.size() > 3)
|
if (fHelp || params.size() < 1 || params.size() > 3)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"importprivkey <casinocoinprivkey> [label] [rescan=true]\n"
|
"importprivkey <"+ COIN_NAME + "privkey> [label] [rescan=true]\n"
|
||||||
"Adds a private key (as returned by dumpprivkey) to your wallet.");
|
"Adds a private key (as returned by dumpprivkey) to your wallet.");
|
||||||
|
|
||||||
string strSecret = params[0].get_str();
|
string strSecret = params[0].get_str();
|
||||||
@@ -79,13 +79,13 @@ Value dumpprivkey(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
if (fHelp || params.size() != 1)
|
if (fHelp || params.size() != 1)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"dumpprivkey <casinocoinaddress>\n"
|
"dumpprivkey <"+ COIN_NAME + "address>\n"
|
||||||
"Reveals the private key corresponding to <casinocoinaddress>.");
|
"Reveals the private key corresponding to <"+ COIN_NAME + "address>.");
|
||||||
|
|
||||||
string strAddress = params[0].get_str();
|
string strAddress = params[0].get_str();
|
||||||
CBitcoinAddress address;
|
CBitcoinAddress address;
|
||||||
if (!address.SetString(strAddress))
|
if (!address.SetString(strAddress))
|
||||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid CasinoCoin address");
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid "+ COIN_NAME_DISPLAY + " address");
|
||||||
CKeyID keyID;
|
CKeyID keyID;
|
||||||
if (!address.GetKeyID(keyID))
|
if (!address.GetKeyID(keyID))
|
||||||
throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to a key");
|
throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to a key");
|
||||||
|
|||||||
@@ -171,10 +171,10 @@ Value getworkex(const Array& params, bool fHelp)
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (vNodes.empty())
|
if (vNodes.empty())
|
||||||
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "CasinoCoin is not connected!");
|
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, ""+ COIN_NAME_DISPLAY + " is not connected!");
|
||||||
|
|
||||||
if (IsInitialBlockDownload())
|
if (IsInitialBlockDownload())
|
||||||
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "CasinoCoin is downloading blocks...");
|
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, ""+ COIN_NAME_DISPLAY + " is downloading blocks...");
|
||||||
|
|
||||||
typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t;
|
typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t;
|
||||||
static mapNewBlock_t mapNewBlock; // FIXME: thread safety
|
static mapNewBlock_t mapNewBlock; // FIXME: thread safety
|
||||||
@@ -311,10 +311,10 @@ Value getwork(const Array& params, bool fHelp)
|
|||||||
"If [data] is specified, tries to solve the block and returns true if it was successful.");
|
"If [data] is specified, tries to solve the block and returns true if it was successful.");
|
||||||
|
|
||||||
if (vNodes.empty())
|
if (vNodes.empty())
|
||||||
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "CasinoCoin is not connected!");
|
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, ""+ COIN_NAME_DISPLAY + " is not connected!");
|
||||||
|
|
||||||
if (IsInitialBlockDownload())
|
if (IsInitialBlockDownload())
|
||||||
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "CasinoCoin is downloading blocks...");
|
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, ""+ COIN_NAME_DISPLAY + " is downloading blocks...");
|
||||||
|
|
||||||
typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t;
|
typedef map<uint256, pair<CBlock*, CScript> > mapNewBlock_t;
|
||||||
static mapNewBlock_t mapNewBlock; // FIXME: thread safety
|
static mapNewBlock_t mapNewBlock; // FIXME: thread safety
|
||||||
@@ -453,10 +453,10 @@ Value getblocktemplate(const Array& params, bool fHelp)
|
|||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode");
|
||||||
|
|
||||||
if (vNodes.empty())
|
if (vNodes.empty())
|
||||||
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "CasinoCoin is not connected!");
|
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, ""+ COIN_NAME_DISPLAY + " is not connected!");
|
||||||
|
|
||||||
if (IsInitialBlockDownload())
|
if (IsInitialBlockDownload())
|
||||||
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "CasinoCoin is downloading blocks...");
|
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, ""+ COIN_NAME_DISPLAY + " is downloading blocks...");
|
||||||
|
|
||||||
// Update block
|
// Update block
|
||||||
static unsigned int nTransactionsUpdatedLast;
|
static unsigned int nTransactionsUpdatedLast;
|
||||||
|
|||||||
@@ -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));
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ Value listunspent(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
CBitcoinAddress address(input.get_str());
|
CBitcoinAddress address(input.get_str());
|
||||||
if (!address.IsValid())
|
if (!address.IsValid())
|
||||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid CasinoCoin address: ")+input.get_str());
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid "+ COIN_NAME_DISPLAY + " address: ")+input.get_str());
|
||||||
if (setAddress.count(address))
|
if (setAddress.count(address))
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+input.get_str());
|
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+input.get_str());
|
||||||
setAddress.insert(address);
|
setAddress.insert(address);
|
||||||
@@ -294,7 +294,7 @@ Value createrawtransaction(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
CBitcoinAddress address(s.name_);
|
CBitcoinAddress address(s.name_);
|
||||||
if (!address.IsValid())
|
if (!address.IsValid())
|
||||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid CasinoCoin address: ")+s.name_);
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid "+ COIN_NAME_DISPLAY + " address: ")+s.name_);
|
||||||
|
|
||||||
if (setAddress.count(address))
|
if (setAddress.count(address))
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_);
|
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_);
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ Value getnewaddress(const Array& params, bool fHelp)
|
|||||||
if (fHelp || params.size() > 1)
|
if (fHelp || params.size() > 1)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"getnewaddress [account]\n"
|
"getnewaddress [account]\n"
|
||||||
"Returns a new CasinoCoin address for receiving payments. "
|
"Returns a new " + COIN_NAME_DISPLAY + " address for receiving payments. "
|
||||||
"If [account] is specified (recommended), it is added to the address book "
|
"If [account] is specified (recommended), it is added to the address book "
|
||||||
"so payments received with the address will be credited to [account].");
|
"so payments received with the address will be credited to [account].");
|
||||||
|
|
||||||
@@ -145,8 +145,10 @@ CBitcoinAddress GetAccountAddress(string strAccount, bool bForceNew=false)
|
|||||||
{
|
{
|
||||||
const CWalletTx& wtx = (*it).second;
|
const CWalletTx& wtx = (*it).second;
|
||||||
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
|
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
|
||||||
|
{
|
||||||
if (txout.scriptPubKey == scriptPubKey)
|
if (txout.scriptPubKey == scriptPubKey)
|
||||||
bKeyUsed = true;
|
bKeyUsed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +170,7 @@ Value getaccountaddress(const Array& params, bool fHelp)
|
|||||||
if (fHelp || params.size() != 1)
|
if (fHelp || params.size() != 1)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"getaccountaddress <account>\n"
|
"getaccountaddress <account>\n"
|
||||||
"Returns the current CasinoCoin address for receiving payments to this account.");
|
"Returns the current " + COIN_NAME_DISPLAY + " address for receiving payments to this account.");
|
||||||
|
|
||||||
// Parse the account first so we don't generate a key if there's an error
|
// Parse the account first so we don't generate a key if there's an error
|
||||||
string strAccount = AccountFromValue(params[0]);
|
string strAccount = AccountFromValue(params[0]);
|
||||||
@@ -186,12 +188,12 @@ Value setaccount(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
if (fHelp || params.size() < 1 || params.size() > 2)
|
if (fHelp || params.size() < 1 || params.size() > 2)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"setaccount <casinocoinaddress> <account>\n"
|
"setaccount <" + COIN_NAME + "address> <account>\n"
|
||||||
"Sets the account associated with the given address.");
|
"Sets the account associated with the given address.");
|
||||||
|
|
||||||
CBitcoinAddress address(params[0].get_str());
|
CBitcoinAddress address(params[0].get_str());
|
||||||
if (!address.IsValid())
|
if (!address.IsValid())
|
||||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid CasinoCoin address");
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid " + COIN_NAME_DISPLAY + " address");
|
||||||
|
|
||||||
|
|
||||||
string strAccount;
|
string strAccount;
|
||||||
@@ -216,12 +218,12 @@ Value getaccount(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
if (fHelp || params.size() != 1)
|
if (fHelp || params.size() != 1)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"getaccount <casinocoinaddress>\n"
|
"getaccount <" + COIN_NAME + "address>\n"
|
||||||
"Returns the account associated with the given address.");
|
"Returns the account associated with the given address.");
|
||||||
|
|
||||||
CBitcoinAddress address(params[0].get_str());
|
CBitcoinAddress address(params[0].get_str());
|
||||||
if (!address.IsValid())
|
if (!address.IsValid())
|
||||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid CasinoCoin address");
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid " + COIN_NAME_DISPLAY + " address");
|
||||||
|
|
||||||
string strAccount;
|
string strAccount;
|
||||||
map<CTxDestination, string>::iterator mi = pwalletMain->mapAddressBook.find(address.Get());
|
map<CTxDestination, string>::iterator mi = pwalletMain->mapAddressBook.find(address.Get());
|
||||||
@@ -274,13 +276,13 @@ Value sendtoaddress(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
if (fHelp || params.size() < 2 || params.size() > 4)
|
if (fHelp || params.size() < 2 || params.size() > 4)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"sendtoaddress <casinocoinaddress> <amount> [comment] [comment-to]\n"
|
"sendtoaddress <"+ COIN_NAME + "address> <amount> [comment] [comment-to]\n"
|
||||||
"<amount> is a real and is rounded to the nearest 0.00000001"
|
"<amount> is a real and is rounded to the nearest 0.00000001"
|
||||||
+ HelpRequiringPassphrase());
|
+ HelpRequiringPassphrase());
|
||||||
|
|
||||||
CBitcoinAddress address(params[0].get_str());
|
CBitcoinAddress address(params[0].get_str());
|
||||||
if (!address.IsValid())
|
if (!address.IsValid())
|
||||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid CasinoCoin address");
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid "+ COIN_NAME_DISPLAY + " address");
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
int64 nAmount = AmountFromValue(params[1]);
|
int64 nAmount = AmountFromValue(params[1]);
|
||||||
@@ -337,7 +339,7 @@ Value signmessage(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
if (fHelp || params.size() != 2)
|
if (fHelp || params.size() != 2)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"signmessage <casinocoinaddress> <message>\n"
|
"signmessage <"+ COIN_NAME + "address> <message>\n"
|
||||||
"Sign a message with the private key of an address");
|
"Sign a message with the private key of an address");
|
||||||
|
|
||||||
EnsureWalletIsUnlocked();
|
EnsureWalletIsUnlocked();
|
||||||
@@ -372,7 +374,7 @@ Value verifymessage(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
if (fHelp || params.size() != 3)
|
if (fHelp || params.size() != 3)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"verifymessage <casinocoinaddress> <signature> <message>\n"
|
"verifymessage <" + COIN_NAME + "address> <signature> <message>\n"
|
||||||
"Verify a signed message");
|
"Verify a signed message");
|
||||||
|
|
||||||
string strAddress = params[0].get_str();
|
string strAddress = params[0].get_str();
|
||||||
@@ -409,14 +411,14 @@ Value getreceivedbyaddress(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
if (fHelp || params.size() < 1 || params.size() > 2)
|
if (fHelp || params.size() < 1 || params.size() > 2)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"getreceivedbyaddress <casinocoinaddress> [minconf=1]\n"
|
"getreceivedbyaddress <" + COIN_NAME + "address> [minconf=1]\n"
|
||||||
"Returns the total amount received by <casinocoinaddress> in transactions with at least [minconf] confirmations.");
|
"Returns the total amount received by <" + COIN_NAME + "address> in transactions with at least [minconf] confirmations.");
|
||||||
|
|
||||||
// Bitcoin address
|
// Bitcoin address
|
||||||
CBitcoinAddress address = CBitcoinAddress(params[0].get_str());
|
CBitcoinAddress address = CBitcoinAddress(params[0].get_str());
|
||||||
CScript scriptPubKey;
|
CScript scriptPubKey;
|
||||||
if (!address.IsValid())
|
if (!address.IsValid())
|
||||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid CasinoCoin address");
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid " + COIN_NAME_DISPLAY + " address");
|
||||||
scriptPubKey.SetDestination(address.Get());
|
scriptPubKey.SetDestination(address.Get());
|
||||||
if (!IsMine(*pwalletMain,scriptPubKey))
|
if (!IsMine(*pwalletMain,scriptPubKey))
|
||||||
return (double)0.0;
|
return (double)0.0;
|
||||||
@@ -630,14 +632,14 @@ Value sendfrom(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
if (fHelp || params.size() < 3 || params.size() > 6)
|
if (fHelp || params.size() < 3 || params.size() > 6)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"sendfrom <fromaccount> <tocasinocoinaddress> <amount> [minconf=1] [comment] [comment-to]\n"
|
"sendfrom <fromaccount> <to"+ COIN_NAME + "address> <amount> [minconf=1] [comment] [comment-to]\n"
|
||||||
"<amount> is a real and is rounded to the nearest 0.00000001"
|
"<amount> is a real and is rounded to the nearest 0.00000001"
|
||||||
+ HelpRequiringPassphrase());
|
+ HelpRequiringPassphrase());
|
||||||
|
|
||||||
string strAccount = AccountFromValue(params[0]);
|
string strAccount = AccountFromValue(params[0]);
|
||||||
CBitcoinAddress address(params[1].get_str());
|
CBitcoinAddress address(params[1].get_str());
|
||||||
if (!address.IsValid())
|
if (!address.IsValid())
|
||||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid CasinoCoin address");
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid " + COIN_NAME_DISPLAY + " address");
|
||||||
int64 nAmount = AmountFromValue(params[2]);
|
int64 nAmount = AmountFromValue(params[2]);
|
||||||
int nMinDepth = 1;
|
int nMinDepth = 1;
|
||||||
if (params.size() > 3)
|
if (params.size() > 3)
|
||||||
@@ -693,7 +695,7 @@ Value sendmany(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
CBitcoinAddress address(s.name_);
|
CBitcoinAddress address(s.name_);
|
||||||
if (!address.IsValid())
|
if (!address.IsValid())
|
||||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid CasinoCoin address: ")+s.name_);
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid " + COIN_NAME_DISPLAY + " address: ")+s.name_);
|
||||||
|
|
||||||
if (setAddress.count(address))
|
if (setAddress.count(address))
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_);
|
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_);
|
||||||
@@ -741,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++)
|
||||||
@@ -789,7 +791,7 @@ Value addmultisigaddress(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
string msg = "addmultisigaddress <nrequired> <'[\"key\",\"key\"]'> [account]\n"
|
string msg = "addmultisigaddress <nrequired> <'[\"key\",\"key\"]'> [account]\n"
|
||||||
"Add a nrequired-to-sign multisignature address to the wallet\"\n"
|
"Add a nrequired-to-sign multisignature address to the wallet\"\n"
|
||||||
"each key is a CasinoCoin address or hex-encoded public key\n"
|
"each key is a " + COIN_NAME_DISPLAY + " address or hex-encoded public key\n"
|
||||||
"If [account] is specified, assign address to [account].";
|
"If [account] is specified, assign address to [account].";
|
||||||
throw runtime_error(msg);
|
throw runtime_error(msg);
|
||||||
}
|
}
|
||||||
@@ -814,7 +816,7 @@ Value createmultisig(const Array& params, bool fHelp)
|
|||||||
string msg = "createmultisig <nrequired> <'[\"key\",\"key\"]'>\n"
|
string msg = "createmultisig <nrequired> <'[\"key\",\"key\"]'>\n"
|
||||||
"Creates a multi-signature address and returns a json object\n"
|
"Creates a multi-signature address and returns a json object\n"
|
||||||
"with keys:\n"
|
"with keys:\n"
|
||||||
"address : casinocoin address\n"
|
"address : " + COIN_NAME + " address\n"
|
||||||
"redeemScript : hex-encoded redemption script";
|
"redeemScript : hex-encoded redemption script";
|
||||||
throw runtime_error(msg);
|
throw runtime_error(msg);
|
||||||
}
|
}
|
||||||
@@ -1469,7 +1471,7 @@ Value encryptwallet(const Array& params, bool fHelp)
|
|||||||
// slack space in .dat files; that is bad if the old data is
|
// slack space in .dat files; that is bad if the old data is
|
||||||
// unencrypted private keys. So:
|
// unencrypted private keys. So:
|
||||||
StartShutdown();
|
StartShutdown();
|
||||||
return "wallet encrypted; CasinoCoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.";
|
return "wallet encrypted; " + COIN_NAME_DISPLAY + " server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.";
|
||||||
}
|
}
|
||||||
|
|
||||||
class DescribeAddressVisitor : public boost::static_visitor<Object>
|
class DescribeAddressVisitor : public boost::static_visitor<Object>
|
||||||
@@ -1511,8 +1513,8 @@ Value validateaddress(const Array& params, bool fHelp)
|
|||||||
{
|
{
|
||||||
if (fHelp || params.size() != 1)
|
if (fHelp || params.size() != 1)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"validateaddress <casinocoinaddress>\n"
|
"validateaddress <"+ COIN_NAME + "address>\n"
|
||||||
"Return information about <casinocoinaddress>.");
|
"Return information about <"+ COIN_NAME + "address>.");
|
||||||
|
|
||||||
CBitcoinAddress address(params[0].get_str());
|
CBitcoinAddress address(params[0].get_str());
|
||||||
bool isValid = address.IsValid();
|
bool isValid = address.IsValid();
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ struct TestingSetup {
|
|||||||
fPrintToDebugger = true; // don't want to write to debug.log file
|
fPrintToDebugger = true; // don't want to write to debug.log file
|
||||||
noui_connect();
|
noui_connect();
|
||||||
bitdb.MakeMock();
|
bitdb.MakeMock();
|
||||||
pathTemp = GetTempPath() / strprintf("test_casinocoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000)));
|
pathTemp = GetTempPath() / strprintf("test_"+ COIN_NAME + "_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000)));
|
||||||
boost::filesystem::create_directories(pathTemp);
|
boost::filesystem::create_directories(pathTemp);
|
||||||
mapArgs["-datadir"] = pathTemp.string();
|
mapArgs["-datadir"] = pathTemp.string();
|
||||||
pblocktree = new CBlockTreeDB(1 << 20, true);
|
pblocktree = new CBlockTreeDB(1 << 20, true);
|
||||||
|
|||||||
25
src/util.cpp
25
src/util.cpp
@@ -51,7 +51,7 @@ namespace boost {
|
|||||||
#ifdef _WIN32_WINNT
|
#ifdef _WIN32_WINNT
|
||||||
#undef _WIN32_WINNT
|
#undef _WIN32_WINNT
|
||||||
#endif
|
#endif
|
||||||
#define _WIN32_WINNT 0x0501
|
#define _WIN32_WINNT 0x0600
|
||||||
#ifdef _WIN32_IE
|
#ifdef _WIN32_IE
|
||||||
#undef _WIN32_IE
|
#undef _WIN32_IE
|
||||||
#endif
|
#endif
|
||||||
@@ -393,7 +393,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;
|
||||||
@@ -995,7 +995,7 @@ static std::string FormatException(std::exception* pex, const char* pszThread)
|
|||||||
char pszModule[MAX_PATH] = "";
|
char pszModule[MAX_PATH] = "";
|
||||||
GetModuleFileNameA(NULL, pszModule, sizeof(pszModule));
|
GetModuleFileNameA(NULL, pszModule, sizeof(pszModule));
|
||||||
#else
|
#else
|
||||||
const char* pszModule = "casinocoin";
|
const char* pszModule = COIN_NAME.c_str();
|
||||||
#endif
|
#endif
|
||||||
if (pex)
|
if (pex)
|
||||||
return strprintf(
|
return strprintf(
|
||||||
@@ -1037,7 +1037,7 @@ boost::filesystem::path GetDefaultDataDir()
|
|||||||
// Unix: ~/.bitcoin
|
// Unix: ~/.bitcoin
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
// Windows
|
// Windows
|
||||||
return GetSpecialFolderPath(CSIDL_APPDATA) / "CasinoCoin";
|
return GetSpecialFolderPath(CSIDL_APPDATA) / COIN_NAME_DISPLAY;
|
||||||
#else
|
#else
|
||||||
fs::path pathRet;
|
fs::path pathRet;
|
||||||
char* pszHome = getenv("HOME");
|
char* pszHome = getenv("HOME");
|
||||||
@@ -1049,10 +1049,11 @@ boost::filesystem::path GetDefaultDataDir()
|
|||||||
// Mac
|
// Mac
|
||||||
pathRet /= "Library/Application Support";
|
pathRet /= "Library/Application Support";
|
||||||
fs::create_directory(pathRet);
|
fs::create_directory(pathRet);
|
||||||
return pathRet / "CasinoCoin";
|
return pathRet / COIN_NAME_DISPLAY;
|
||||||
#else
|
#else
|
||||||
// Unix
|
// Unix
|
||||||
return pathRet / ".casinocoin";
|
std::string path = "." + COIN_NAME;
|
||||||
|
return pathRet / path;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1093,7 +1094,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific)
|
|||||||
|
|
||||||
boost::filesystem::path GetConfigFile()
|
boost::filesystem::path GetConfigFile()
|
||||||
{
|
{
|
||||||
boost::filesystem::path pathConfigFile(GetArg("-conf", "casinocoin.conf"));
|
boost::filesystem::path pathConfigFile(GetArg("-conf", std::string("")+ COIN_NAME + ".conf"));
|
||||||
if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir(false) / pathConfigFile;
|
if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir(false) / pathConfigFile;
|
||||||
return pathConfigFile;
|
return pathConfigFile;
|
||||||
}
|
}
|
||||||
@@ -1127,7 +1128,7 @@ void ReadConfigFile(map<string, string>& mapSettingsRet,
|
|||||||
|
|
||||||
boost::filesystem::path GetPidFile()
|
boost::filesystem::path GetPidFile()
|
||||||
{
|
{
|
||||||
boost::filesystem::path pathPidFile(GetArg("-pid", "casinocoind.pid"));
|
boost::filesystem::path pathPidFile(GetArg("-pid", std::string("")+ COIN_NAME + "d.pid"));
|
||||||
if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile;
|
if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile;
|
||||||
return pathPidFile;
|
return pathPidFile;
|
||||||
}
|
}
|
||||||
@@ -1330,7 +1331,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();
|
||||||
@@ -1356,7 +1357,7 @@ void AddTimeData(const CNetAddr& ip, int64 nTime)
|
|||||||
if (!fMatch)
|
if (!fMatch)
|
||||||
{
|
{
|
||||||
fDone = true;
|
fDone = true;
|
||||||
string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong CasinoCoin will not work properly.");
|
string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong ")+ COIN_NAME_DISPLAY + _(" will not work properly.");
|
||||||
strMiscWarning = strMessage;
|
strMiscWarning = strMessage;
|
||||||
printf("*** %s\n", strMessage.c_str());
|
printf("*** %s\n", strMessage.c_str());
|
||||||
uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING);
|
uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING);
|
||||||
@@ -1365,10 +1366,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ void runCommand(std::string strCommand);
|
|||||||
|
|
||||||
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)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
// Name of client reported in the 'version' message. Report the same name
|
// Name of client reported in the 'version' message. Report the same name
|
||||||
// for both bitcoind and bitcoin-qt, to make it harder for attackers to
|
// for both bitcoind and bitcoin-qt, to make it harder for attackers to
|
||||||
// target servers or GUI users specifically.
|
// target servers or GUI users specifically.
|
||||||
const std::string CLIENT_NAME("digishield");
|
const std::string CLIENT_NAME("LTS-V3");
|
||||||
|
|
||||||
// Client version number
|
// Client version number
|
||||||
#define CLIENT_VERSION_SUFFIX ""
|
#define CLIENT_VERSION_SUFFIX ""
|
||||||
@@ -40,8 +40,13 @@ const std::string CLIENT_NAME("digishield");
|
|||||||
# define GIT_COMMIT_DATE ""
|
# define GIT_COMMIT_DATE ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef QT_GUI
|
||||||
#define BUILD_DESC_FROM_COMMIT(maj,min,rev,build,commit) \
|
#define BUILD_DESC_FROM_COMMIT(maj,min,rev,build,commit) \
|
||||||
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-Qt" commit
|
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-Qt" commit
|
||||||
|
#else
|
||||||
|
#define BUILD_DESC_FROM_COMMIT(maj,min,rev,build,commit) \
|
||||||
|
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) commit
|
||||||
|
#endif
|
||||||
|
|
||||||
#define BUILD_DESC_FROM_UNKNOWN(maj,min,rev,build) \
|
#define BUILD_DESC_FROM_UNKNOWN(maj,min,rev,build) \
|
||||||
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-unk"
|
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-unk"
|
||||||
|
|||||||
@@ -21,17 +21,21 @@ extern const std::string CLIENT_NAME;
|
|||||||
extern const std::string CLIENT_BUILD;
|
extern const std::string CLIENT_BUILD;
|
||||||
extern const std::string CLIENT_DATE;
|
extern const std::string CLIENT_DATE;
|
||||||
|
|
||||||
|
// Coin Name
|
||||||
|
static const std::string COIN_NAME("casinocoin");
|
||||||
|
static const std::string COIN_NAME_DISPLAY("CasinoCoin");
|
||||||
|
|
||||||
//
|
//
|
||||||
// network protocol versioning
|
// network protocol versioning
|
||||||
//
|
//
|
||||||
|
|
||||||
static const int PROTOCOL_VERSION = 70004;
|
static const int PROTOCOL_VERSION = 80001;
|
||||||
|
|
||||||
// intial proto version, to be increased after version/verack negotiation
|
// intial proto version, to be increased after version/verack negotiation
|
||||||
static const int INIT_PROTO_VERSION = 209;
|
static const int INIT_PROTO_VERSION = 209;
|
||||||
|
|
||||||
// disconnect from peers older than this proto version
|
// disconnect from peers older than this proto version
|
||||||
static const int MIN_PEER_PROTO_VERSION = 70004; // TODO: Change to 70004 before block 445000 to force new client downloading and therefore doing the actual hard fork
|
static const int MIN_PEER_PROTO_VERSION = 80001; // TODO: Change to 70004 before block 445000 to force new client downloading and therefore doing the actual hard fork
|
||||||
|
|
||||||
// nTime field added to CAddress, starting with this version;
|
// nTime field added to CAddress, starting with this version;
|
||||||
// if possible, avoid requesting addresses nodes older than this
|
// if possible, avoid requesting addresses nodes older than this
|
||||||
|
|||||||
@@ -1487,7 +1487,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");
|
||||||
@@ -1549,7 +1549,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;
|
||||||
}
|
}
|
||||||
@@ -1574,7 +1574,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;
|
||||||
@@ -1603,7 +1603,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1630,7 +1630,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)
|
||||||
@@ -1640,7 +1640,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)
|
||||||
|
|||||||
@@ -520,7 +520,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -550,11 +550,7 @@ bool BackupWallet(const CWallet& wallet, const string& strDest)
|
|||||||
pathDest /= wallet.strWalletFile;
|
pathDest /= wallet.strWalletFile;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
#if BOOST_VERSION >= 104000
|
|
||||||
filesystem::copy_file(pathSrc, pathDest, filesystem::copy_option::overwrite_if_exists);
|
filesystem::copy_file(pathSrc, pathDest, filesystem::copy_option::overwrite_if_exists);
|
||||||
#else
|
|
||||||
filesystem::copy_file(pathSrc, pathDest);
|
|
||||||
#endif
|
|
||||||
printf("copied wallet.dat to %s\n", pathDest.string().c_str());
|
printf("copied wallet.dat to %s\n", pathDest.string().c_str());
|
||||||
return true;
|
return true;
|
||||||
} catch(const filesystem::filesystem_error &e) {
|
} catch(const filesystem::filesystem_error &e) {
|
||||||
@@ -581,7 +577,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);
|
||||||
@@ -600,7 +596,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);
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
#ifndef BITCOIN_WALLETDB_H
|
#ifndef BITCOIN_WALLETDB_H
|
||||||
#define BITCOIN_WALLETDB_H
|
#define BITCOIN_WALLETDB_H
|
||||||
|
|
||||||
|
#define BOOST_NO_CXX11_SCOPED_ENUMS
|
||||||
|
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
|
|
||||||
|
|||||||
45
windows-inno-script.iss
Normal file
45
windows-inno-script.iss
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
; Script generated by the Inno Setup Script Wizard.
|
||||||
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||||
|
|
||||||
|
#define MyAppName "Casinocoin"
|
||||||
|
#define MySetupAppName "casinocoin"
|
||||||
|
#define MyAppVersion "3.0.0.0"
|
||||||
|
#define MyAppPublisher "Casinocoin Foundation"
|
||||||
|
#define MyAppURL "http://www.casinocoin.org"
|
||||||
|
#define MyAppExeName "casinocoin-qt.exe"
|
||||||
|
|
||||||
|
[Setup]
|
||||||
|
; NOTE: The value of AppId uniquely identifies this application.
|
||||||
|
; Do not use the same AppId value in installers for other applications.
|
||||||
|
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
||||||
|
AppId={{1698FEC3-9D7C-43F3-B379-9028E51F8B56}
|
||||||
|
AppName={#MyAppName}
|
||||||
|
AppVersion={#MyAppVersion}
|
||||||
|
;AppVerName={#MyAppName} {#MyAppVersion}
|
||||||
|
AppPublisher={#MyAppPublisher}
|
||||||
|
AppPublisherURL={#MyAppURL}
|
||||||
|
AppSupportURL={#MyAppURL}
|
||||||
|
AppUpdatesURL={#MyAppURL}
|
||||||
|
DefaultDirName={pf}\{#MyAppName}
|
||||||
|
DisableProgramGroupPage=yes
|
||||||
|
OutputBaseFilename={#MySetupAppName}-{#MyAppVersion}-setup
|
||||||
|
Compression=lzma
|
||||||
|
SolidCompression=yes
|
||||||
|
|
||||||
|
[Languages]
|
||||||
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
|
||||||
|
[Tasks]
|
||||||
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||||
|
|
||||||
|
[Files]
|
||||||
|
Source: "C:\Users\a.jochems\Documents\GitHub\casinocoin-development\release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
|
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||||
|
|
||||||
|
[Icons]
|
||||||
|
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
||||||
|
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
||||||
|
|
||||||
|
[Run]
|
||||||
|
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
; HM NIS Edit Wizard helper defines
|
; HM NIS Edit Wizard helper defines
|
||||||
!define PRODUCT_NAME "Casinocoin Wallet"
|
!define PRODUCT_NAME "Casinocoin Wallet"
|
||||||
!define PRODUCT_VERSION "2.0.0.0"
|
!define PRODUCT_VERSION "2.0.1.0"
|
||||||
!define PRODUCT_PUBLISHER "Casinocoin"
|
!define PRODUCT_PUBLISHER "Casinocoin"
|
||||||
!define PRODUCT_WEB_SITE "http://www.casinocoin.org"
|
!define PRODUCT_WEB_SITE "http://www.casinocoin.org"
|
||||||
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\casinocoin-qt.exe"
|
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\casinocoin-qt.exe"
|
||||||
@@ -47,7 +47,7 @@ var ICONS_GROUP
|
|||||||
; MUI end ------
|
; MUI end ------
|
||||||
|
|
||||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
||||||
OutFile "release\casinocoin-2.0.0.0-setup.exe"
|
OutFile "release\casinocoin-2.0.1.0-setup.exe"
|
||||||
InstallDir "$PROGRAMFILES\Casinocoin"
|
InstallDir "$PROGRAMFILES\Casinocoin"
|
||||||
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
|
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
|
||||||
ShowInstDetails show
|
ShowInstDetails show
|
||||||
@@ -76,6 +76,7 @@ Section "MainSection" SEC01
|
|||||||
File "release\plugins\imageformats\qwebp.dll"
|
File "release\plugins\imageformats\qwebp.dll"
|
||||||
SetOutPath "$INSTDIR\plugins\platforms"
|
SetOutPath "$INSTDIR\plugins\platforms"
|
||||||
File "release\plugins\platforms\qwindows.dll"
|
File "release\plugins\platforms\qwindows.dll"
|
||||||
|
File "release\plugins\platforms\qminimal.dll"
|
||||||
SetOutPath "$INSTDIR\qml\QtQml\Models.2"
|
SetOutPath "$INSTDIR\qml\QtQml\Models.2"
|
||||||
File "release\qml\QtQml\Models.2\modelsplugin.dll"
|
File "release\qml\QtQml\Models.2\modelsplugin.dll"
|
||||||
File "release\qml\QtQml\Models.2\plugins.qmltypes"
|
File "release\qml\QtQml\Models.2\plugins.qmltypes"
|
||||||
@@ -658,6 +659,7 @@ Section Uninstall
|
|||||||
Delete "$INSTDIR\qml\QtQml\Models.2\plugins.qmltypes"
|
Delete "$INSTDIR\qml\QtQml\Models.2\plugins.qmltypes"
|
||||||
Delete "$INSTDIR\qml\QtQml\Models.2\modelsplugin.dll"
|
Delete "$INSTDIR\qml\QtQml\Models.2\modelsplugin.dll"
|
||||||
Delete "$INSTDIR\plugins\platforms\qwindows.dll"
|
Delete "$INSTDIR\plugins\platforms\qwindows.dll"
|
||||||
|
Delete "$INSTDIR\plugins\platforms\qminimal.dll"
|
||||||
Delete "$INSTDIR\plugins\imageformats\qwebp.dll"
|
Delete "$INSTDIR\plugins\imageformats\qwebp.dll"
|
||||||
Delete "$INSTDIR\plugins\imageformats\qwbmp.dll"
|
Delete "$INSTDIR\plugins\imageformats\qwbmp.dll"
|
||||||
Delete "$INSTDIR\plugins\imageformats\qtiff.dll"
|
Delete "$INSTDIR\plugins\imageformats\qtiff.dll"
|
||||||
|
|||||||
Reference in New Issue
Block a user