Skip to content

Commit e0140be

Browse files
authored
Merge pull request #45 from DeckerSU/static-dev
0.7.2-beta3: static-dev -> static
2 parents 6005e16 + cdb5293 commit e0140be

File tree

187 files changed

+6968
-15989
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+6968
-15989
lines changed

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AC_PREREQ([2.60])
33
define(_CLIENT_VERSION_MAJOR, 0)
44
define(_CLIENT_VERSION_MINOR, 7)
55
define(_CLIENT_VERSION_REVISION, 2)
6-
define(_CLIENT_VERSION_BUILD, 1)
6+
define(_CLIENT_VERSION_BUILD, 2)
77
define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50)))
88
define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1)))
99
define(_CLIENT_VERSION_IS_RELEASE, true)
@@ -944,7 +944,7 @@ CXXFLAGS="${save_CXXFLAGS}"
944944
# platforms, so we use older autoconf detection mechanisms:
945945
if test x$TARGET_OS = xdarwin; then
946946
AC_CHECK_HEADER([gmp.h],,AC_MSG_ERROR(libgmp headers missing))
947-
AC_CHECK_LIB([gmp],[[__gmpn_sub_n]],GMP_LIBS=-lgmp, [AC_MSG_ERROR(libgmp missing)])
947+
AC_CHECK_LIB([gmp],[__gmpn_sub_n],GMP_LIBS=-lgmp, [AC_MSG_ERROR(libgmp missing)])
948948

949949
AC_CHECK_HEADER([gmpxx.h],,AC_MSG_ERROR(libgmpxx headers missing))
950950
AC_CHECK_LIB([gmpxx],[main],GMPXX_LIBS=-lgmpxx, [AC_MSG_ERROR(libgmpxx missing)])

depends/packages/libgmp.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $(package)_download_path=https://ftp.gnu.org/gnu/gmp
2222
$(package)_file_name=gmp-$($(package)_version).tar.bz2
2323
$(package)_sha256_hash=a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6
2424
$(package)_dependencies=
25-
$(package)_config_opts=--enable-cxx --disable-shared
25+
$(package)_config_opts=--enable-cxx --disable-shared --with-pic
2626
endif
2727

2828
define $(package)_config_cmds

depends/packages/qt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PACKAGE=qt
22
$(package)_version=5.12.11
3-
$(package)_download_path=https://download.qt.io/official_releases/qt/5.12/$($(package)_version)/submodules
3+
$(package)_download_path=https://download.qt.io/archive/qt/5.12/$($(package)_version)/submodules
44
$(package)_suffix=everywhere-src-$($(package)_version).tar.xz
55
$(package)_file_name=qtbase-$($(package)_suffix)
66
$(package)_sha256_hash=1c1b4e33137ca77881074c140d54c3c9747e845a31338cfe8680f171f0bc3a39

src/Makefile.am

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,6 @@ libbitcoin_server_a_SOURCES = \
293293
cc/fsm.cpp \
294294
cc/heir.cpp \
295295
cc/oracles.cpp \
296-
cc/prices.cpp \
297-
cc/pegs.cpp \
298296
cc/payments.cpp \
299297
cc/gateways.cpp \
300298
cc/channels.cpp \
@@ -304,7 +302,6 @@ libbitcoin_server_a_SOURCES = \
304302
checkpoints.cpp \
305303
fs.cpp \
306304
crosschain.cpp \
307-
crosschain_authority.cpp \
308305
deprecation.cpp \
309306
httprpc.cpp \
310307
httpserver.cpp \
@@ -465,11 +462,10 @@ libbitcoin_common_a_SOURCES = \
465462
komodo_events.cpp \
466463
komodo_gateway.cpp \
467464
komodo_globals.cpp \
465+
komodo_hardfork.cpp \
468466
komodo_interest.cpp \
469-
komodo_jumblr.cpp \
470467
komodo_kv.cpp \
471468
komodo_notary.cpp \
472-
komodo_pax.cpp \
473469
komodo_utils.cpp \
474470
netbase.cpp \
475471
metrics.cpp \

src/Makefile.ktest.include

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ komodo_test_SOURCES = \
1919
test-komodo/test_netbase_tests.cpp \
2020
test-komodo/test_events.cpp \
2121
test-komodo/test_hex.cpp \
22-
test-komodo/test_haraka_removal.cpp
22+
test-komodo/test_haraka_removal.cpp \
23+
test-komodo/test_oldhash_removal.cpp \
24+
test-komodo/test_kmd_feat.cpp
2325

2426
komodo_test_CPPFLAGS = $(komodod_CPPFLAGS)
2527

src/Makefile.qt.include

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ KOMODO_MM = qt/macdockiconhandler.mm
179179
# qt/macnotificationhandler.mm
180180

181181
QT_MOC = \
182-
qt/komodo.moc \
182+
qt/komodoapp.moc \
183183
qt/komodoamountfield.moc \
184184
qt/callback.moc \
185185
qt/intro.moc \
@@ -438,7 +438,7 @@ qt_komodo_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(KOMODO_QT_INCLUDES)
438438
$(QT_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)
439439
qt_komodo_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
440440

441-
qt_komodo_qt_SOURCES = qt/komodo.cpp
441+
qt_komodo_qt_SOURCES = qt/komodoapp.cpp
442442
if TARGET_DARWIN
443443
qt_komodo_qt_SOURCES += $(KOMODO_MM)
444444
endif
@@ -526,7 +526,7 @@ $(srcdir)/qt/komodostrings.cpp: $(libkomodo_server_a_SOURCES) $(libkomodo_wallet
526526
@test -n $(XGETTEXT) || echo "xgettext is required for updating translations"
527527
$(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) PACKAGE_NAME="$(PACKAGE_NAME)" COPYRIGHT_HOLDERS="$(COPYRIGHT_HOLDERS)" COPYRIGHT_HOLDERS_SUBSTITUTION="$(COPYRIGHT_HOLDERS_SUBSTITUTION)" $(PYTHON) ../share/qt/extract_strings_qt.py $^
528528

529-
translate: $(srcdir)/qt/komodostrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(KOMODO_QT_BASE_CPP) qt/komodo.cpp $(KOMODO_QT_WINDOWS_CPP) $(KOMODO_QT_WALLET_CPP) $(KOMODO_QT_H) $(KOMODO_MM)
529+
translate: $(srcdir)/qt/komodostrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(KOMODO_QT_BASE_CPP) qt/komodoapp.cpp $(KOMODO_QT_WINDOWS_CPP) $(KOMODO_QT_WALLET_CPP) $(KOMODO_QT_H) $(KOMODO_MM)
530530
@test -n $(LUPDATE) || echo "lupdate is required for updating translations"
531531
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts $(srcdir)/qt/locale/komodo_en.ts
532532

src/addrman.h

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,33 @@ friend class CAddrManTest;
258258
//! Wraps GetRandInt to allow tests to override RandomInt and make it deterministic.
259259
virtual int RandomInt(int nMax);
260260

261+
/***
262+
* @brief Clears the internal collections and fills them again
263+
* @note the mutex should be held before this method is called
264+
* @note the constructor calls this directly with no lock
265+
*/
266+
void Clear_()
267+
{
268+
std::vector<int>().swap(vRandom);
269+
nKey = GetRandHash();
270+
for (size_t bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; bucket++) {
271+
for (size_t entry = 0; entry < ADDRMAN_BUCKET_SIZE; entry++) {
272+
vvNew[bucket][entry] = -1;
273+
}
274+
}
275+
for (size_t bucket = 0; bucket < ADDRMAN_TRIED_BUCKET_COUNT; bucket++) {
276+
for (size_t entry = 0; entry < ADDRMAN_BUCKET_SIZE; entry++) {
277+
vvTried[bucket][entry] = -1;
278+
}
279+
}
280+
281+
nIdCount = 0;
282+
nTried = 0;
283+
nNew = 0;
284+
mapInfo.clear();
285+
mapAddr.clear();
286+
}
287+
261288
#ifdef DEBUG_ADDRMAN
262289
//! Perform consistency check. Returns an error code or zero.
263290
int Check_();
@@ -502,29 +529,12 @@ friend class CAddrManTest;
502529
void Clear()
503530
{
504531
LOCK(cs);
505-
std::vector<int>().swap(vRandom);
506-
nKey = GetRandHash();
507-
for (size_t bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; bucket++) {
508-
for (size_t entry = 0; entry < ADDRMAN_BUCKET_SIZE; entry++) {
509-
vvNew[bucket][entry] = -1;
510-
}
511-
}
512-
for (size_t bucket = 0; bucket < ADDRMAN_TRIED_BUCKET_COUNT; bucket++) {
513-
for (size_t entry = 0; entry < ADDRMAN_BUCKET_SIZE; entry++) {
514-
vvTried[bucket][entry] = -1;
515-
}
516-
}
517-
518-
nIdCount = 0;
519-
nTried = 0;
520-
nNew = 0;
521-
mapInfo.clear();
522-
mapAddr.clear();
532+
Clear_();
523533
}
524534

525535
CAddrMan()
526536
{
527-
Clear();
537+
Clear_();
528538
}
529539

530540
~CAddrMan()

src/alert.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@ bool CAlert::ProcessAlert(const std::vector<unsigned char>& alertKey, bool fThre
261261
return true;
262262
}
263263

264-
void
265-
CAlert::Notify(const std::string& strMessage, bool fThread)
264+
void CAlert::Notify(const std::string& strMessage, bool fThread)
266265
{
267266
std::string strCmd = GetArg("-alertnotify", "");
268267
if (strCmd.empty()) return;

src/alert.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
#include <stdint.h>
3030
#include <string>
3131

32-
class CAlert;
33-
class CNode;
34-
class uint256;
35-
36-
extern std::map<uint256, CAlert> mapAlerts;
3732
extern CCriticalSection cs_mapAlerts;
3833

3934
/** Alerts are for notifying old versions if they become too obsolete and
@@ -86,6 +81,9 @@ class CUnsignedAlert
8681
std::string ToString() const;
8782
};
8883

84+
class CNode;
85+
class uint256;
86+
8987
/** An alert is a combination of a serialized CUnsignedAlert and a signature. */
9088
class CAlert : public CUnsignedAlert
9189
{
@@ -124,4 +122,6 @@ class CAlert : public CUnsignedAlert
124122
static CAlert getAlertByHash(const uint256 &hash);
125123
};
126124

125+
extern std::map<uint256, CAlert> mapAlerts;
126+
127127
#endif // BITCOIN_ALERT_H

src/amount.h

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,18 @@
2121
#ifndef BITCOIN_AMOUNT_H
2222
#define BITCOIN_AMOUNT_H
2323

24-
#include "serialize.h"
2524

25+
#include "serialize.h"
2626
#include <stdlib.h>
2727
#include <string>
28+
#include <cstdint>
2829

2930
typedef int64_t CAmount;
3031

3132
static const CAmount COIN = 100000000;
3233
static const CAmount CENT = 1000000;
3334

3435
extern const std::string CURRENCY_UNIT;
35-
36-
/** No amount larger than this (in satoshi) is valid.
37-
*
38-
* Note that this constant is *not* the total money supply, which in Bitcoin
39-
* currently happens to be less than 21,000,000 BTC for various reasons, but
40-
* rather a sanity check. As this sanity check is used by consensus-critical
41-
* validation code, the exact value of the MAX_MONEY constant is consensus
42-
* critical; in unusual circumstances like a(nother) overflow bug that allowed
43-
* for the creation of coins out of thin air modification could lead to a fork.
44-
* */
45-
//static const CAmount MAX_MONEY = 21000000 * COIN;
4636
extern int64_t MAX_MONEY;
4737

4838
inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
/******************************************************************************
23
* Copyright © 2014-2019 The SuperNET Developers. *
34
* *
@@ -12,25 +13,42 @@
1213
* Removal or modification of this copyright notice is prohibited. *
1314
* *
1415
******************************************************************************/
16+
#include <string>
1517

18+
class assetchain
19+
{
20+
public:
21+
assetchain() : symbol_("") {}
22+
assetchain(const std::string& symbol) : symbol_(symbol)
23+
{
24+
if (symbol_.size() > 64)
25+
symbol_ = symbol_.substr(0, 64);
26+
}
27+
/*****
28+
* @returns true if the chain is Komodo
29+
*/
30+
bool isKMD() { return symbol_.empty(); }
31+
/****
32+
* @param in the symbol to compare
33+
* @returns true if this chain's symbol matches
34+
*/
35+
bool isSymbol(const std::string& in) { return in == symbol_; }
36+
/****
37+
* @returns this chain's symbol (will be empty for KMD)
38+
*/
39+
std::string symbol() { return symbol_; }
40+
/****
41+
* @returns this chain's symbol, "KMD" in the case of Komodo
42+
*/
43+
std::string ToString()
44+
{
45+
if (symbol_.empty())
46+
return "KMD";
47+
return symbol_;
48+
}
49+
bool SymbolStartsWith(const std::string& in) { return symbol_.find(in) == 0; }
50+
private:
51+
std::string symbol_;
52+
};
1653

17-
#ifndef CC_PEGS_H
18-
#define CC_PEGS_H
19-
20-
#include "CCinclude.h"
21-
22-
bool PegsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn);
23-
24-
// CCcustom
25-
UniValue PegsCreate(const CPubKey& pk,uint64_t txfee,int64_t amount,std::vector<uint256> bindtxids);
26-
UniValue PegsFund(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid, int64_t amount);
27-
UniValue PegsGet(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid, int64_t amount);
28-
UniValue PegsRedeem(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid);
29-
UniValue PegsLiquidate(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid, uint256 liquidatetxid);
30-
UniValue PegsExchange(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid, int64_t amount);
31-
UniValue PegsAccountHistory(const CPubKey& pk,uint256 pegstxid);
32-
UniValue PegsAccountInfo(const CPubKey& pk,uint256 pegstxid);
33-
UniValue PegsWorstAccounts(uint256 pegstxid);
34-
UniValue PegsInfo(uint256 pegstxid);
35-
36-
#endif
54+
extern assetchain chainName;

src/bitcoin-cli.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@
3131
#include <event2/buffer.h>
3232
#include <event2/keyvalq_struct.h>
3333
#include "support/events.h"
34+
#include "assetchain.h"
35+
3436
uint16_t BITCOIND_RPCPORT = 7771;
35-
char ASSETCHAINS_SYMBOL[65];
37+
assetchain chainName;
3638

3739
#include <univalue.h>
3840

@@ -95,10 +97,9 @@ static int AppInitRPC(int argc, char* argv[])
9597
// Parameters
9698
//
9799
ParseParameters(argc, argv);
98-
std:string name;
99-
name = GetArg("-ac_name","");
100+
std::string name = GetArg("-ac_name","");
100101
if ( !name.empty() )
101-
strncpy(ASSETCHAINS_SYMBOL,name.c_str(),sizeof(ASSETCHAINS_SYMBOL)-1);
102+
chainName = assetchain(name);
102103

103104
if (argc<2 || mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version")) {
104105
std::string strUsage = _("Komodo RPC client version") + " " + FormatFullVersion() + "\n" + PrivacyInfo();

0 commit comments

Comments
 (0)