SpartanCoin Project - Fossil Code Repository

Check-in [7a5192ff08]
Login
Overview
Comment:UPGRADE: rename xjail and some fix
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | master | trunk
Files: files | file ages | folders
SHA3-256:7a5192ff084c9dda188b045657f06522cb6a4080ce69fff2509edce47dd00dac
User & Date: fasxmut 2019-06-30 15:28:39
Context
2019-06-30
15:28
UPGRADE: rename xjail and some fix Leaf check-in: 7a5192ff08 user: fasxmut tags: master, trunk
2019-03-28
01:48
Upgrade SpartanCoin Logo, Upgrade to SpartanCoin-1.2 check-in: b656f4bb68 user: xjail tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to COPYING.

1
2
3
4
5
6
7
8
9
10
Copyright (c) 2009-2013 Bitcoin Developers
Copyright (c) 2014 Spartancoin Developers
Copyright (c) 2017-2019 SpartanCoin Xjail Developers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:


|







1
2
3
4
5
6
7
8
9
10
Copyright (c) 2009-2013 Bitcoin Developers
Copyright (c) 2014 Spartancoin Developers
Copyright (c) 2017-2019 New SpartanCoin Developers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

Changes to README.md.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Spartancoin integration/staging tree
================================

https://www.spartancoin.tiv.cc

Copyright (c) 2009-2013 Bitcoin Developers
Copyright (c) 2011-2013 Litecoin Developers
Copyright (c) 2014 Spartancoin Developers
Copyright (c) 2017-2019 SpartanCoin Xjail Developers

What is Spartancoin?
----------------

Spartancoin is a version os Litecoin using scrypt as a proof-of-work algorithm.
 - 2 minute block targets
 - subsidy halves in 400,000 blocks



|




|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Spartancoin integration/staging tree
================================

https://spartancoin.ooo

Copyright (c) 2009-2013 Bitcoin Developers
Copyright (c) 2011-2013 Litecoin Developers
Copyright (c) 2014 Spartancoin Developers
Copyright (c) 2017-2019 New SpartanCoin Developers

What is Spartancoin?
----------------

Spartancoin is a version os Litecoin using scrypt as a proof-of-work algorithm.
 - 2 minute block targets
 - subsidy halves in 400,000 blocks

Changes to spartancoin-qt.pro.

382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
    src/qt/notificator.cpp \
    src/qt/paymentserver.cpp \
    src/qt/rpcconsole.cpp \
    src/scrypt.cpp \
    src/noui.cpp \
    src/leveldb.cpp \
    src/txdb.cpp \
    src/xjail_spn_util.cpp \
    src/qt/splashscreen.cpp

RESOURCES += src/qt/bitcoin.qrc

FORMS += src/qt/forms/sendcoinsdialog.ui \
    src/qt/forms/coincontroldialog.ui \
    src/qt/forms/addressbookpage.ui \







|







382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
    src/qt/notificator.cpp \
    src/qt/paymentserver.cpp \
    src/qt/rpcconsole.cpp \
    src/scrypt.cpp \
    src/noui.cpp \
    src/leveldb.cpp \
    src/txdb.cpp \
    src/spn_util.cpp \
    src/qt/splashscreen.cpp

RESOURCES += src/qt/bitcoin.qrc

FORMS += src/qt/forms/sendcoinsdialog.ui \
    src/qt/forms/coincontroldialog.ui \
    src/qt/forms/addressbookpage.ui \

Changes to src/alert.cpp.

1
2
3
4
5
6
7
8
9
// Copyright (c) 2009-2012 Bitcoin Developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
//
// Alert system
//

#include <algorithm>

|







1
2
3
4
5
6
7
8
9
// Copyright (c) 2009-2012 Bitcoin Developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
//
// Alert system
//

#include <algorithm>

Changes to src/base58.h.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin Developers
// Copyright (c) 2019 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.


//
// Why base-58 instead of standard base-64 encoding?
// - Don't want 0OIl characters that look the same in some fonts and


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin Developers
// Copyright (c) 2019 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.


//
// Why base-58 instead of standard base-64 encoding?
// - Don't want 0OIl characters that look the same in some fonts and

Changes to src/bignum.h.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2019 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_BIGNUM_H
#define BITCOIN_BIGNUM_H

#include <stdexcept>
#include <vector>


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2019 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_BIGNUM_H
#define BITCOIN_BIGNUM_H

#include <stdexcept>
#include <vector>

Changes to src/bitcoinrpc.cpp.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2019 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "init.h"
#include "util.h"
#include "sync.h"
#include "ui_interface.h"
#include "base58.h"
#include "bitcoinrpc.h"
#include "db.h"

#include "xjail_spn_util.h"

#include <boost/asio.hpp>
#include <boost/asio/ip/v6_only.hpp>
#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
................................................................................
        if (str.empty() || str == "\r")
            break;
        string::size_type nColon = str.find(":");
        if (nColon != string::npos)
        {
            string strHeader = str.substr(0, nColon);
            boost::trim(strHeader);
	    xjail::toLower(strHeader);
            string strValue = str.substr(nColon+1);
            boost::trim(strValue);
            mapHeadersRet[strHeader] = strValue;
            if (strHeader == "content-length")
                nLen = atoi(strValue.c_str());
        }
    }


|











|







 







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2019 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "init.h"
#include "util.h"
#include "sync.h"
#include "ui_interface.h"
#include "base58.h"
#include "bitcoinrpc.h"
#include "db.h"

#include "spn_util.h"

#include <boost/asio.hpp>
#include <boost/asio/ip/v6_only.hpp>
#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
................................................................................
        if (str.empty() || str == "\r")
            break;
        string::size_type nColon = str.find(":");
        if (nColon != string::npos)
        {
            string strHeader = str.substr(0, nColon);
            boost::trim(strHeader);
	    spn::toLower(strHeader);
            string strValue = str.substr(nColon+1);
            boost::trim(strValue);
            mapHeadersRet[strHeader] = strValue;
            if (strHeader == "content-length")
                nLen = atoi(strValue.c_str());
        }
    }

Changes to src/bloom.cpp.

1
2
3
4
5
6
7
8
9
// Copyright (c) 2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <math.h>
#include <stdlib.h>

#include "bloom.h"
#include "main.h"

|







1
2
3
4
5
6
7
8
9
// Copyright (c) 2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <math.h>
#include <stdlib.h>

#include "bloom.h"
#include "main.h"

Changes to src/checkqueue.h.

1
2
3
4
5
6
7
8
9
// Copyright (c) 2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef CHECKQUEUE_H
#define CHECKQUEUE_H

#include <boost/thread/mutex.hpp>
#include <boost/thread/locks.hpp>

|







1
2
3
4
5
6
7
8
9
// Copyright (c) 2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef CHECKQUEUE_H
#define CHECKQUEUE_H

#include <boost/thread/mutex.hpp>
#include <boost/thread/locks.hpp>

Changes to src/clientversion.h.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// client versioning and copyright year
//

// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR       1
#define CLIENT_VERSION_MINOR       2
#define CLIENT_VERSION_REVISION    0
#define CLIENT_VERSION_BUILD       0

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE  true

// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2014







|







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// client versioning and copyright year
//

// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR       1
#define CLIENT_VERSION_MINOR       2
#define CLIENT_VERSION_REVISION    0
#define CLIENT_VERSION_BUILD       3

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE  true

// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2014

Changes to src/crypter.cpp.

1
2
3
4
5
6
7
8
9
// Copyright (c) 2009-2012 The Bitcoin Developers
// Copyright (c) 2019 SpartanCoin Xjail Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <openssl/aes.h>
#include <openssl/evp.h>
#include <vector>
#include <string>

|







1
2
3
4
5
6
7
8
9
// Copyright (c) 2009-2012 The Bitcoin Developers
// Copyright (c) 2019 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <openssl/aes.h>
#include <openssl/evp.h>
#include <vector>
#include <string>

Changes to src/init.cpp.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "txdb.h"
#include "walletdb.h"
#include "bitcoinrpc.h"
#include "net.h"
#include "init.h"
#include "util.h"
#include "ui_interface.h"
#include "xjail_spn_util.h"

#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/convenience.hpp>
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <openssl/crypto.h>
................................................................................
        if (!boost::filesystem::is_directory(GetDataDir(false)))
        {
            fprintf(stderr, "Error: Specified directory does not exist\n");
            Shutdown();
        }
        ReadConfigFile(mapArgs, mapMultiArgs);
	// XjailRemovable
	xjail::addStaticNodes(mapArgs, mapMultiArgs);

        if (mapArgs.count("-?") || mapArgs.count("--help"))
        {
            // First part of help message is specific to bitcoind / RPC client
            std::string strUsage = _("Spartancoin version") + " " + FormatFullVersion() + "\n\n" +
                _("Usage:") + "\n" +
                  "  spartancoind [options]                     " + "\n" +


|










|







 







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "txdb.h"
#include "walletdb.h"
#include "bitcoinrpc.h"
#include "net.h"
#include "init.h"
#include "util.h"
#include "ui_interface.h"
#include "spn_util.h"

#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/convenience.hpp>
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <openssl/crypto.h>
................................................................................
        if (!boost::filesystem::is_directory(GetDataDir(false)))
        {
            fprintf(stderr, "Error: Specified directory does not exist\n");
            Shutdown();
        }
        ReadConfigFile(mapArgs, mapMultiArgs);
	// XjailRemovable
	spn::addStaticNodes(mapArgs, mapMultiArgs);

        if (mapArgs.count("-?") || mapArgs.count("--help"))
        {
            // First part of help message is specific to bitcoind / RPC client
            std::string strUsage = _("Spartancoin version") + " " + FormatFullVersion() + "\n\n" +
                _("Usage:") + "\n" +
                  "  spartancoind [options]                     " + "\n" +

Changes to src/key.cpp.

1
2
3
4
5
6
7
8
9
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2019 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <openssl/ecdsa.h>
#include <openssl/rand.h>
#include <openssl/obj_mac.h>


|







1
2
3
4
5
6
7
8
9
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2019 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <openssl/ecdsa.h>
#include <openssl/rand.h>
#include <openssl/obj_mac.h>

Changes to src/keystore.cpp.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "keystore.h"
#include "script.h"

bool CKeyStore::GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "keystore.h"
#include "script.h"

bool CKeyStore::GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const

Changes to src/leveldb.cpp.

1
2
3
4
5
6
7
8
9
// Copyright (c) 2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "leveldb.h"
#include "util.h"

#include <leveldb/env.h>

|







1
2
3
4
5
6
7
8
9
// Copyright (c) 2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "leveldb.h"
#include "util.h"

#include <leveldb/env.h>

Changes to src/leveldb.h.

1
2
3
4
5
6
7
8
9
// Copyright (c) 2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_LEVELDB_H
#define BITCOIN_LEVELDB_H

#include "serialize.h"


|







1
2
3
4
5
6
7
8
9
// Copyright (c) 2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_LEVELDB_H
#define BITCOIN_LEVELDB_H

#include "serialize.h"

Changes to src/main.cpp.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "alert.h"
#include "checkpoints.h"
#include "db.h"
#include "txdb.h"


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "alert.h"
#include "checkpoints.h"
#include "db.h"
#include "txdb.h"

Changes to src/main.h.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_MAIN_H
#define BITCOIN_MAIN_H

#include "bignum.h"
#include "sync.h"


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_MAIN_H
#define BITCOIN_MAIN_H

#include "bignum.h"
#include "sync.h"

Changes to src/makefile-static.unix.

157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
    obj/wallet.o \
    obj/walletdb.o \
    obj/hash.o \
    obj/bloom.o \
    obj/noui.o \
    obj/leveldb.o \
    obj/txdb.o \
    obj/xjail_spn_util.o


ifdef USE_SSE2
DEFS += -DUSE_SSE2
OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif







|







157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
    obj/wallet.o \
    obj/walletdb.o \
    obj/hash.o \
    obj/bloom.o \
    obj/noui.o \
    obj/leveldb.o \
    obj/txdb.o \
    obj/spn_util.o


ifdef USE_SSE2
DEFS += -DUSE_SSE2
OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif

Changes to src/makefile.freebsd.

1
2
3
4
5
6
7
8
9
...
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Copyright (c) 2017-2018 SpartanCoin Xjail developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

# :=0 --> UPnP support turned off by default at runtime
# :=1 --> UPnP support turned on by default at runtime
# :=- --> No UPnP support - miniupnp not required
USE_UPNP:=0
................................................................................
    obj/wallet.o \
    obj/walletdb.o \
    obj/hash.o \
    obj/bloom.o \
    obj/noui.o \
    obj/leveldb.o \
    obj/txdb.o \
    obj/xjail_spn_util.o


ifdef USE_SSE2
DEFS += -DUSE_SSE2
OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif

|







 







|







1
2
3
4
5
6
7
8
9
...
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Copyright (c) 2017-2018 New SpartanCoin Developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

# :=0 --> UPnP support turned off by default at runtime
# :=1 --> UPnP support turned on by default at runtime
# :=- --> No UPnP support - miniupnp not required
USE_UPNP:=0
................................................................................
    obj/wallet.o \
    obj/walletdb.o \
    obj/hash.o \
    obj/bloom.o \
    obj/noui.o \
    obj/leveldb.o \
    obj/txdb.o \
    obj/spn_util.o


ifdef USE_SSE2
DEFS += -DUSE_SSE2
OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif

Added src/makefile.linux.



































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Copyright (c) 2017-2018 New SpartanCoin Developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

# :=0 --> UPnP support turned off by default at runtime
# :=1 --> UPnP support turned on by default at runtime
# :=- --> No UPnP support - miniupnp not required
USE_UPNP:=0

# :=1 --> Enable IPv6 support
# :=0 --> Disable IPv6 support
USE_IPV6:=1

LINK:=$(CXX)

DEFS=-DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64

ifdef BOOST_LIB_SUFFIX

else
  #BOOST_LIB_SUFFIX=-mt
endif

DEFS += $(addprefix -I,$(CURDIR) $(CURDIR)/obj $(BOOST_INCLUDE_PATH) $(BDB_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH))
LIBS = $(addprefix -L,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH))

TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)

LMODE = dynamic
LMODE2 = dynamic

ifdef STATIC
	LMODE = static
	ifeq (${STATIC}, all)
		LMODE2 = static
	endif
else
	TESTDEFS += -DBOOST_TEST_DYN_LINK
endif

# for boost 1.37, add -mt to the boost libraries
LIBS += \
 -Wl,-B$(LMODE) \
   -l boost_system$(BOOST_LIB_SUFFIX) \
   -l boost_filesystem$(BOOST_LIB_SUFFIX) \
   -l boost_program_options$(BOOST_LIB_SUFFIX) \
   -l boost_thread$(BOOST_LIB_SUFFIX) \
   -l db_cxx$(BDB_LIB_SUFFIX) \
   -l ssl \
   -l crypto

TESTLIBS += \
 -Wl,-B$(LMODE) \
   -l boost_unit_test_framework$(BOOST_LIB_SUFFIX)

ifndef USE_UPNP
	override USE_UPNP = -
endif
ifneq (${USE_UPNP}, -)
	LIBS += -l miniupnpc
	DEFS += -DUSE_UPNP=$(USE_UPNP)
endif

ifneq (${USE_IPV6}, -)
	DEFS += -DUSE_IPV6=$(USE_IPV6)
endif

LIBS+= \
 -Wl,-B$(LMODE2) \
   -l z \
   -l dl

# Hardening
# Make some classes of vulnerabilities unexploitable in case one is discovered.
#
    # This is a workaround for Ubuntu bug #691722, the default -fstack-protector causes
    # -fstack-protector-all to be ignored unless -fno-stack-protector is used first.
    # see: https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/691722
    HARDENING=-fno-stack-protector

    # Stack Canaries
    # Put numbers at the beginning of each stack frame and check that they are the same.
    # If a stack buffer if overflowed, it writes over the canary number and then on return
    # when that number is checked, it won't be the same and the program will exit with
    # a "Stack smashing detected" error instead of being exploited.
    HARDENING+=-fstack-protector-all -Wstack-protector

    # Make some important things such as the global offset table read only as soon as
    # the dynamic linker is finished building it. This will prevent overwriting of addresses
    # which would later be jumped to.
    LDHARDENING+=-Wl,-z,relro -Wl,-z,now

    # Build position independent code to take advantage of Address Space Layout Randomization
    # offered by some kernels.
    # see doc/build-unix.txt for more information.
    ifdef PIE
        HARDENING+=-fPIE
        LDHARDENING+=-pie
    endif

    # -D_FORTIFY_SOURCE=2 does some checking for potentially exploitable code patterns in
    # the source such overflowing a statically defined buffer.
    HARDENING+=-D_FORTIFY_SOURCE=2
#


DEBUGFLAGS=-g

# 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.
xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \
    $(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)
xCXXFLAGS += -std=c++17

# LDFLAGS can be specified on the make command line, so we use xLDFLAGS that only
# adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work.
xLDFLAGS=$(LDHARDENING) $(LDFLAGS)
xLDFLAGS += -pthread -lboost_chrono

OBJS= \
    leveldb/libleveldb.a \
    obj/alert.o \
    obj/version.o \
    obj/checkpoints.o \
    obj/netbase.o \
    obj/addrman.o \
    obj/crypter.o \
    obj/key.o \
    obj/db.o \
    obj/init.o \
    obj/keystore.o \
    obj/main.o \
    obj/net.o \
    obj/protocol.o \
    obj/bitcoinrpc.o \
    obj/rpcdump.o \
    obj/rpcnet.o \
    obj/rpcmining.o \
    obj/rpcwallet.o \
    obj/rpcblockchain.o \
    obj/rpcrawtransaction.o \
    obj/script.o \
    obj/scrypt.o \
    obj/sync.o \
    obj/util.o \
    obj/wallet.o \
    obj/walletdb.o \
    obj/hash.o \
    obj/bloom.o \
    obj/noui.o \
    obj/leveldb.o \
    obj/txdb.o \
    obj/spn_util.o


ifdef USE_SSE2
DEFS += -DUSE_SSE2
OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif

all: spartancoind

test check: test_spartancoin FORCE
	./test_spartancoin

#
# LevelDB support
#
MAKEOVERRIDES =
LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
leveldb/libleveldb.a:
	@echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd ..

# auto-generated dependencies:
-include obj/*.P
-include obj-test/*.P

obj/build.h: FORCE
	/bin/sh ../share/genbuild.sh obj/build.h
version.cpp: obj/build.h
DEFS += -DHAVE_BUILD_INFO

obj/%-sse2.o: %-sse2.cpp
	$(CXX) -c $(xCXXFLAGS) -msse2 -MMD -MF $(@:%.o=%.d) -o $@ $<
	@cp $(@:%.o=%.d) $(@:%.o=%.P); \
	  sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
	      -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
	  rm -f $(@:%.o=%.d)

obj/%.o: %.cpp
	$(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
	@cp $(@:%.o=%.d) $(@:%.o=%.P); \
	  sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
	      -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
	  rm -f $(@:%.o=%.d)

spartancoind: $(OBJS:obj/%=obj/%)
	$(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)

TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))

obj-test/%.o: test/%.cpp
	$(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
	@cp $(@:%.o=%.d) $(@:%.o=%.P); \
	  sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
	      -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
	  rm -f $(@:%.o=%.d)

test_spartancoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
	$(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS)

clean:
	-rm -f spartancoind test_spartancoin
	-rm -f obj/*.o
	-rm -f obj-test/*.o
	-rm -f obj/*.P
	-rm -f obj-test/*.P
	-rm -f obj/build.h
	-cd leveldb && $(MAKE) clean || true

FORCE:

Changes to src/makefile.linux-mingw.

85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
    obj/wallet.o \
    obj/walletdb.o \
    obj/noui.o \
    obj/hash.o \
    obj/bloom.o \
    obj/leveldb.o \
    obj/txdb.o \
    obj/xjail_spn_util.o

ifdef USE_SSE2
DEFS += -DUSE_SSE2
OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif








|







85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
    obj/wallet.o \
    obj/walletdb.o \
    obj/noui.o \
    obj/hash.o \
    obj/bloom.o \
    obj/leveldb.o \
    obj/txdb.o \
    obj/spn_util.o

ifdef USE_SSE2
DEFS += -DUSE_SSE2
OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif

Changes to src/makefile.mingw.

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
    obj/wallet.o \
    obj/walletdb.o \
    obj/hash.o \
    obj/bloom.o \
    obj/noui.o \
    obj/leveldb.o \
    obj/txdb.o \
    obj/xjail_spn_util.o

ifdef USE_SSE2
DEFS += -DUSE_SSE2
OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif








|







101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
    obj/wallet.o \
    obj/walletdb.o \
    obj/hash.o \
    obj/bloom.o \
    obj/noui.o \
    obj/leveldb.o \
    obj/txdb.o \
    obj/spn_util.o

ifdef USE_SSE2
DEFS += -DUSE_SSE2
OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif

Changes to src/makefile.osx.

103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
    obj/wallet.o \
    obj/walletdb.o \
    obj/hash.o \
    obj/bloom.o \
    obj/noui.o \
    obj/leveldb.o \
    obj/txdb.o \
    obj/xjail_spn_util.o

ifdef USE_SSE2
DEFS += -DUSE_SSE2
OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif








|







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
    obj/wallet.o \
    obj/walletdb.o \
    obj/hash.o \
    obj/bloom.o \
    obj/noui.o \
    obj/leveldb.o \
    obj/txdb.o \
    obj/spn_util.o

ifdef USE_SSE2
DEFS += -DUSE_SSE2
OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif

Changes to src/makefile.unix.

1
2
3
4
5
6
7
8
9
...
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Copyright (c) 2017-2018 SpartanCoin Xjail developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

# :=0 --> UPnP support turned off by default at runtime
# :=1 --> UPnP support turned on by default at runtime
# :=- --> No UPnP support - miniupnp not required
USE_UPNP:=0
................................................................................
    obj/wallet.o \
    obj/walletdb.o \
    obj/hash.o \
    obj/bloom.o \
    obj/noui.o \
    obj/leveldb.o \
    obj/txdb.o \
    obj/xjail_spn_util.o


ifdef USE_SSE2
DEFS += -DUSE_SSE2
OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif

|







 







|







1
2
3
4
5
6
7
8
9
...
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Copyright (c) 2017-2018 New SpartanCoin Developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

# :=0 --> UPnP support turned off by default at runtime
# :=1 --> UPnP support turned on by default at runtime
# :=- --> No UPnP support - miniupnp not required
USE_UPNP:=0
................................................................................
    obj/wallet.o \
    obj/walletdb.o \
    obj/hash.o \
    obj/bloom.o \
    obj/noui.o \
    obj/leveldb.o \
    obj/txdb.o \
    obj/spn_util.o


ifdef USE_SSE2
DEFS += -DUSE_SSE2
OBJS_SSE2= obj/scrypt-sse2.o
OBJS += $(OBJS_SSE2)
endif

Changes to src/net.cpp.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "db.h"
#include "net.h"
#include "init.h"
#include "addrman.h"


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "db.h"
#include "net.h"
#include "init.h"
#include "addrman.h"

Changes to src/net.h.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_NET_H
#define BITCOIN_NET_H

#include <deque>
#include <boost/array.hpp>


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_NET_H
#define BITCOIN_NET_H

#include <deque>
#include <boost/array.hpp>

Changes to src/netbase.cpp.

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
..
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "netbase.h"
#include "util.h"
#include "sync.h"
#include "hash.h"

#include "xjail_spn_util.h"

#ifndef WIN32
#include <sys/fcntl.h>
#endif

#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()

................................................................................
static CCriticalSection cs_proxyInfos;
int nConnectTimeout = 5000;
bool fNameLookup = false;

static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff };

enum Network ParseNetwork(std::string net) {
    xjail::toLower(net);
    if (net == "ipv4") return NET_IPV4;
    if (net == "ipv6") return NET_IPV6;
    if (net == "tor")  return NET_TOR;
    return NET_UNROUTABLE;
}

void SplitHostPort(std::string in, int &portOut, std::string &hostOut) {







|







 







|







4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
..
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "netbase.h"
#include "util.h"
#include "sync.h"
#include "hash.h"

#include "spn_util.h"

#ifndef WIN32
#include <sys/fcntl.h>
#endif

#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()

................................................................................
static CCriticalSection cs_proxyInfos;
int nConnectTimeout = 5000;
bool fNameLookup = false;

static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff };

enum Network ParseNetwork(std::string net) {
    spn::toLower(net);
    if (net == "ipv4") return NET_IPV4;
    if (net == "ipv6") return NET_IPV6;
    if (net == "tor")  return NET_TOR;
    return NET_UNROUTABLE;
}

void SplitHostPort(std::string in, int &portOut, std::string &hostOut) {

Deleted src/notes.log.

1
2
3
4
Found Bugs (Unsolved):
	Switch mutex, lock and condition_variable from boost to std causes deadlock, as non-interruptible

	Switch from boot::this_thread::sleep_for to std::this_thread::sleep_for causes deadlock, as non-interruptible.
<
<
<
<








Changes to src/qt/bitcoin.cpp.

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#include "guiutil.h"
#include "guiconstants.h"
#include "init.h"
#include "util.h"
#include "ui_interface.h"
#include "paymentserver.h"
#include "splashscreen.h"
#include "xjail_spn_util.h"

#include <QMessageBox>
#if QT_VERSION < 0x050000
#include <QTextCodec>
#endif
#include <QLocale>
#include <QTimer>
................................................................................
        // (which not yet possible because lang=XX can be overridden in bitcoin.conf in the data directory)
        QMessageBox::critical(0, "Spartancoin",
                              QString("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"])));
        return 1;
    }
    ReadConfigFile(mapArgs, mapMultiArgs);
	// XjailRemovable
	xjail::addStaticNodes(mapArgs, mapMultiArgs);

    // Application identification (must be set before OptionsModel is initialized,
    // as it is used to locate QSettings)
    QApplication::setOrganizationName("Spartancoin");
    QApplication::setOrganizationDomain("spartancoin.com");
    if(GetBoolArg("-testnet")) // Separate UI settings for testnet
        QApplication::setApplicationName("Spartancoin-Qt-testnet");







|







 







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#include "guiutil.h"
#include "guiconstants.h"
#include "init.h"
#include "util.h"
#include "ui_interface.h"
#include "paymentserver.h"
#include "splashscreen.h"
#include "spn_util.h"

#include <QMessageBox>
#if QT_VERSION < 0x050000
#include <QTextCodec>
#endif
#include <QLocale>
#include <QTimer>
................................................................................
        // (which not yet possible because lang=XX can be overridden in bitcoin.conf in the data directory)
        QMessageBox::critical(0, "Spartancoin",
                              QString("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"])));
        return 1;
    }
    ReadConfigFile(mapArgs, mapMultiArgs);
	// XjailRemovable
	spn::addStaticNodes(mapArgs, mapMultiArgs);

    // Application identification (must be set before OptionsModel is initialized,
    // as it is used to locate QSettings)
    QApplication::setOrganizationName("Spartancoin");
    QApplication::setOrganizationDomain("spartancoin.com");
    if(GetBoolArg("-testnet")) // Separate UI settings for testnet
        QApplication::setApplicationName("Spartancoin-Qt-testnet");

Changes to src/rpcblockchain.cpp.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "main.h"
#include "bitcoinrpc.h"

using namespace json_spirit;


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "main.h"
#include "bitcoinrpc.h"

using namespace json_spirit;

Changes to src/rpcmining.cpp.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "main.h"
#include "db.h"
#include "init.h"
#include "bitcoinrpc.h"


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "main.h"
#include "db.h"
#include "init.h"
#include "bitcoinrpc.h"

Changes to src/rpcnet.cpp.

1
2
3
4
5
6
7
8
9
// Copyright (c) 2009-2012 Bitcoin Developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "net.h"
#include "bitcoinrpc.h"

using namespace json_spirit;

|







1
2
3
4
5
6
7
8
9
// Copyright (c) 2009-2012 Bitcoin Developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "net.h"
#include "bitcoinrpc.h"

using namespace json_spirit;

Changes to src/rpcrawtransaction.cpp.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <boost/assign/list_of.hpp>

#include "base58.h"
#include "bitcoinrpc.h"


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <boost/assign/list_of.hpp>

#include "base58.h"
#include "bitcoinrpc.h"

Changes to src/rpcwallet.cpp.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <boost/assign/list_of.hpp>

#include "wallet.h"
#include "walletdb.h"


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <boost/assign/list_of.hpp>

#include "wallet.h"
#include "walletdb.h"

Changes to src/script.cpp.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <boost/tuple/tuple.hpp>

using namespace std;
using namespace boost;


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <boost/tuple/tuple.hpp>

using namespace std;
using namespace boost;

Changes to src/script.h.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef H_BITCOIN_SCRIPT
#define H_BITCOIN_SCRIPT

#include <string>
#include <vector>


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef H_BITCOIN_SCRIPT
#define H_BITCOIN_SCRIPT

#include <string>
#include <vector>

Changes to src/scrypt-sse2.cpp.

1
2

3
4
5
6
7
8
9
/*
 * Copyright 2009 Colin Percival, 2011 ArtForz, 2012-2013 pooler, 2017 xjail

 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.

|
>







1
2
3
4
5
6
7
8
9
10
/*
 * Copyright 2009 Colin Percival, 2011 ArtForz, 2012-2013 pooler, 
 * 2017 New SpartanCoin Developers
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.

Changes to src/scrypt.cpp.

1
2

3
4
5
6
7
8
9
/*
 * Copyright 2009 Colin Percival, 2011 ArtForz, 2012-2013 pooler, 2017 xjail

 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.

|
>







1
2
3
4
5
6
7
8
9
10
/*
 * Copyright 2009 Colin Percival, 2011 ArtForz, 2012-2013 pooler, 
 * 2017 New SpartanCoin Developers
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.

Added src/spn_util.cpp.



























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "spn_util.h"
#include <map>
#include <vector>
#include <string>
#include <functional>

void spn::addStaticNodes(
	std::map<std::string, std::string> & mapArgs_node, 
	std::map<std::string, std::vector<std::string>> & mapMultiArgs_node
) {
	const std::string key = "-addnode";
	const std::vector<std::string> addrs {
		"node-a.spartancoin.ooo",
		"45.63.15.197", 
		"2001:19f0:5:c8c:5400:ff:fe79:637e", 

		"node-b.spartancoin.ooo", 
		"104.207.144.147", 
		"2001:19f0:9002:2ef:5400:ff:fe79:3d75" 
	};
	for (std::size_t i=0; i<addrs.size(); i++) {
		mapArgs_node[key] = addrs[i];
		mapMultiArgs_node[key].push_back(addrs[i]);
	}
}

char spn::lower(char ch) {
	if ((ch >= 'A' && ch <= 'Z') || (ch >= 'Z' && ch <= 'A'))
		return ch - ('A' - 'a');
	return ch;
}

char spn::upper(char ch) {
	if ((ch >= 'a' && ch <= 'z') || (ch >= 'z' && ch <= 'a'))
		return ch + ('A' - 'a');
	return ch;
}

std::string & spn::toLower(std::string && str) {
	std::transform(str.begin(), str.end(), str.begin(), spn::lower);
	return str;
}

std::string & spn::toLower(std::string & str) {
	std::transform(str.begin(), str.end(), str.begin(), spn::lower);
	return str;
}

std::string & spn::toUpper(std::string && str) {
	std::transform(str.begin(), str.end(), str.begin(), spn::upper);
	return str;
}

std::string & spn::toUpper(std::string & str) {
	std::transform(str.begin(), str.end(), str.begin(), spn::upper);
	return str;
}

Added src/spn_util.h.





























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef __spn_util_h__
#define __spn_util_h__

#include <map>
#include <vector>
#include <string>

using namespace std::string_literals;

namespace spn {

void addStaticNodes(
	std::map<std::string, std::string> & mapArgs_node, 
	std::map<std::string, std::vector<std::string>> & mapMultiArgs_node
);

char lower(char ch);
char upper(char ch);
std::string & toLower(std::string && str);
std::string & toLower(std::string & str);
std::string & toUpper(std::string && str);
std::string & toUpper(std::string & str);

} // namespace spn

#endif	// __spn_util_h__

Changes to src/sync.cpp.

1
2
3
4
5
6
7
8
9
// Copyright (c) 2011-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "sync.h"
#include "util.h"

#ifdef DEBUG_LOCKCONTENTION

|







1
2
3
4
5
6
7
8
9
// Copyright (c) 2011-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "sync.h"
#include "util.h"

#ifdef DEBUG_LOCKCONTENTION

Changes to src/util.cpp.

1
2
3
4
5
6
7
8
9
10
..
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
...
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef WIN32
// for posix_fallocate
#ifdef __linux__
#define _POSIX_C_SOURCE 200112L
................................................................................
#endif

#include "util.h"
#include "sync.h"
#include "version.h"
#include "ui_interface.h"

#include "xjail_spn_util.h"

#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()

#include <iomanip>
#include <sstream>

................................................................................
        size_t is_index = str.find('=');
        if (is_index != std::string::npos)
        {
            strValue = str.substr(is_index+1);
            str = str.substr(0, is_index);
        }
#ifdef WIN32
	xjail::toLower(str);
        if (boost::algorithm::starts_with(str, "/"))
            str = "-" + str.substr(1);
#endif
        if (str[0] != '-')
            break;

        mapArgs[str] = strValue;


|







 







|







 







|







1
2
3
4
5
6
7
8
9
10
..
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
...
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef WIN32
// for posix_fallocate
#ifdef __linux__
#define _POSIX_C_SOURCE 200112L
................................................................................
#endif

#include "util.h"
#include "sync.h"
#include "version.h"
#include "ui_interface.h"

#include "spn_util.h"

#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()

#include <iomanip>
#include <sstream>

................................................................................
        size_t is_index = str.find('=');
        if (is_index != std::string::npos)
        {
            strValue = str.substr(is_index+1);
            str = str.substr(0, is_index);
        }
#ifdef WIN32
	spn::toLower(str);
        if (boost::algorithm::starts_with(str, "/"))
            str = "-" + str.substr(1);
#endif
        if (str[0] != '-')
            break;

        mapArgs[str] = strValue;

Changes to src/util.h.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_UTIL_H
#define BITCOIN_UTIL_H

#include "uint256.h"



|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_UTIL_H
#define BITCOIN_UTIL_H

#include "uint256.h"

Changes to src/wallet.cpp.

1
2
3
4
5
6
7
8
9
10
....
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
....
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "wallet.h"
#include "walletdb.h"
#include "crypter.h"
#include "ui_interface.h"
#include "base58.h"
................................................................................
// ====> Temporary Code <====
// Custom Random Shuffle. The std::random_shuffle was removed
// in c++17. This random_shuffle is a modification of 
// std::random_shuffle in LLVM c++/v1/algorithm from 
// FreeBSD System Headers.
// The best solution is using std::shuffle, which will be 
// implemented in the future to write a custom URBG class.
// Copyright (c) SpartanCoin Xjail developers.
namespace xjail {
	template <typename RandomIter, typename RandomFunc>
	void random_shuffle(RandomIter first, RandomIter last, 
					RandomFunc && rand_fn) {
		using DiffType = typename std::iterator_traits<RandomIter>
						::difference_type;
		DiffType max_setting = last - first;
		if (max_setting > 1) {
................................................................................
    // List of values less than target
    pair<int64, pair<const CWalletTx*,unsigned int> > coinLowestLarger;
    coinLowestLarger.first = std::numeric_limits<int64>::max();
    coinLowestLarger.second.first = NULL;
    vector<pair<int64, pair<const CWalletTx*,unsigned int> > > vValue;
    int64 nTotalLower = 0;

	// std::random_shuffle => xjail::random_shuffle
	// xjail::random_shuffle was defined above.
    xjail::random_shuffle(vCoins.begin(), vCoins.end(), GetRandInt);

    for(COutput output: vCoins)
    {
        const CWalletTx *pcoin = output.tx;

        if (output.nDepth < (pcoin->IsFromMe() ? nConfMine : nConfTheirs))
            continue;


|







 







|
|







 







|
|
|







1
2
3
4
5
6
7
8
9
10
....
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
....
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "wallet.h"
#include "walletdb.h"
#include "crypter.h"
#include "ui_interface.h"
#include "base58.h"
................................................................................
// ====> Temporary Code <====
// Custom Random Shuffle. The std::random_shuffle was removed
// in c++17. This random_shuffle is a modification of 
// std::random_shuffle in LLVM c++/v1/algorithm from 
// FreeBSD System Headers.
// The best solution is using std::shuffle, which will be 
// implemented in the future to write a custom URBG class.
// Copyright (c) New SpartanCoin Developers.
namespace spn {
	template <typename RandomIter, typename RandomFunc>
	void random_shuffle(RandomIter first, RandomIter last, 
					RandomFunc && rand_fn) {
		using DiffType = typename std::iterator_traits<RandomIter>
						::difference_type;
		DiffType max_setting = last - first;
		if (max_setting > 1) {
................................................................................
    // List of values less than target
    pair<int64, pair<const CWalletTx*,unsigned int> > coinLowestLarger;
    coinLowestLarger.first = std::numeric_limits<int64>::max();
    coinLowestLarger.second.first = NULL;
    vector<pair<int64, pair<const CWalletTx*,unsigned int> > > vValue;
    int64 nTotalLower = 0;

	// std::random_shuffle => spn::random_shuffle
	// spn::random_shuffle was defined above.
    spn::random_shuffle(vCoins.begin(), vCoins.end(), GetRandInt);

    for(COutput output: vCoins)
    {
        const CWalletTx *pcoin = output.tx;

        if (output.nDepth < (pcoin->IsFromMe() ? nConfMine : nConfTheirs))
            continue;

Changes to src/wallet.h.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_WALLET_H
#define BITCOIN_WALLET_H

#include <string>
#include <vector>


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_WALLET_H
#define BITCOIN_WALLET_H

#include <string>
#include <vector>

Changes to src/walletdb.cpp.

1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "walletdb.h"
#include "wallet.h"
#include <boost/version.hpp>
#include <boost/filesystem.hpp>


|







1
2
3
4
5
6
7
8
9
10
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2017-2018 New SpartanCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "walletdb.h"
#include "wallet.h"
#include <boost/version.hpp>
#include <boost/filesystem.hpp>

Deleted src/xjail_spn_util.cpp.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "xjail_spn_util.h"
#include <map>
#include <vector>
#include <string>
#include <functional>

void xjail::addStaticNodes(
	std::map<std::string, std::string> & mapArgs_node, 
	std::map<std::string, std::vector<std::string>> & mapMultiArgs_node
) {
	const std::string & key = "-addnode";
	const std::vector<std::string> & addrs {
		"spn-node39.xjail.tiv.cc", 
		"45.63.15.197", 
		"2001:19f0:5:c8c:5400:ff:fe79:637e", 

		"spn-node71.xjail.tiv.cc", 
		"104.207.144.147", 
		"2001:19f0:9002:2ef:5400:ff:fe79:3d75" 
	};
	for (std::size_t i=0; i<addrs.size(); i++) {
		mapArgs_node[key] = addrs[i];
		mapMultiArgs_node[key].push_back(addrs[i]);
	}
}

char xjail::lower(char ch) {
	if ((ch >= 'A' && ch <= 'Z') || (ch >= 'Z' && ch <= 'A'))
		return ch - ('A' - 'a');
	return ch;
}

char xjail::upper(char ch) {
	if ((ch >= 'a' && ch <= 'z') || (ch >= 'z' && ch <= 'a'))
		return ch + ('A' - 'a');
	return ch;
}

std::string & xjail::toLower(std::string && str) {
	std::transform(str.begin(), str.end(), str.begin(), xjail::lower);
	return str;
}

std::string & xjail::toLower(std::string & str) {
	std::transform(str.begin(), str.end(), str.begin(), xjail::lower);
	return str;
}

std::string & xjail::toUpper(std::string && str) {
	std::transform(str.begin(), str.end(), str.begin(), xjail::upper);
	return str;
}

std::string & xjail::toUpper(std::string & str) {
	std::transform(str.begin(), str.end(), str.begin(), xjail::upper);
	return str;
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


























































































































Deleted src/xjail_spn_util.h.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2017-2018 SpartanCoin Xjail developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef __xjail_spn_util_h__
#define __xjail_spn_util_h__

#include <map>
#include <vector>
#include <string>

using namespace std::string_literals;

namespace xjail {

void addStaticNodes(
	std::map<std::string, std::string> & mapArgs_node, 
	std::map<std::string, std::vector<std::string>> & mapMultiArgs_node
);

char lower(char ch);
char upper(char ch);
std::string & toLower(std::string && str);
std::string & toLower(std::string & str);
std::string & toUpper(std::string && str);
std::string & toUpper(std::string & str);

} // namespace xjail

#endif
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<