Skip to content

Commit

Permalink
Merge pull request #71 from metalicjames/master-0.10.1.0
Browse files Browse the repository at this point in the history
v0.10.1.0 lowS signatures
  • Loading branch information
metalicjames authored Feb 21, 2017
2 parents df16eda + af200c1 commit b407ad7
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 26 deletions.
2 changes: 1 addition & 1 deletion share/setup.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SetCompressor /SOLID lzma

# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION 0.10.0.2
!define VERSION 0.10.1.0
!define COMPANY "Vertcoin project"
!define URL https://www.vertcoin.org/

Expand Down
12 changes: 6 additions & 6 deletions src/bitcoinrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,18 @@ static const CRPCCommand vRPCCommands[] =
{ "getinfo", &getinfo, true, false, false },
{ "getmininginfo", &getmininginfo, true, false, false },
{ "getnewaddress", &getnewaddress, true, false, true },
{ "getnewstealthaddress", &getnewstealthaddress, false, false, true },
//{ "getnewstealthaddress", &getnewstealthaddress, false, false, true },
{ "getaccountaddress", &getaccountaddress, true, false, true },
{ "setaccount", &setaccount, true, false, true },
{ "getaccount", &getaccount, false, false, true },
{ "getaddressesbyaccount", &getaddressesbyaccount, true, false, true },
{ "sendtoaddress", &sendtoaddress, false, false, true },
{ "sendtostealthaddress", &sendtostealthaddress, false, false, true },
// { "sendtostealthaddress", &sendtostealthaddress, false, false, true },
{ "getreceivedbyaddress", &getreceivedbyaddress, false, false, true },
{ "getreceivedbyaccount", &getreceivedbyaccount, false, false, true },
{ "listreceivedbyaddress", &listreceivedbyaddress, false, false, true },
{ "liststealthaddress", &liststealthaddress, false, false, true },
{ "resetprikeystatus", &resetprikeystatus, false, false, true },
//{ "liststealthaddress", &liststealthaddress, false, false, true },
//{ "resetprikeystatus", &resetprikeystatus, false, false, true },
{ "listreceivedbyaccount", &listreceivedbyaccount, false, false, true },
{ "backupwallet", &backupwallet, true, false, true },
{ "keypoolrefill", &keypoolrefill, true, false, true },
Expand All @@ -237,7 +237,7 @@ static const CRPCCommand vRPCCommands[] =
{ "getbalance", &getbalance, false, false, true },
{ "move", &movecmd, false, false, true },
{ "sendfrom", &sendfrom, false, false, true },
{ "sendstealthfrom", &sendstealthfrom, false, false, true },
//{ "sendstealthfrom", &sendstealthfrom, false, false, true },
{ "sendmany", &sendmany, false, false, true },
{ "addmultisigaddress", &addmultisigaddress, false, false, true },
{ "createmultisig", &createmultisig, true, true , false },
Expand All @@ -260,7 +260,7 @@ static const CRPCCommand vRPCCommands[] =
{ "dumpprivkey", &dumpprivkey, true, false, true },
{ "importprivkey", &importprivkey, false, false, true },
{ "importaddress", &importaddress, false, false, true },
{ "importstealthaddress", &importstealthaddress, false, false, true },
//{ "importstealthaddress", &importstealthaddress, false, false, true },
{ "listunspent", &listunspent, false, false, true },
{ "getrawtransaction", &getrawtransaction, false, false, false },
{ "createrawtransaction", &createrawtransaction, false, false, false },
Expand Down
9 changes: 5 additions & 4 deletions src/checkpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,20 @@ namespace Checkpoints
( 24200, uint256("0xd7ed819858011474c8b0cae4ad0b9bdbb745becc4c386bc22d1220cc5a4d1787"))
( 65000, uint256("0x9e673a69c35a423f736ab66f9a195d7c42f979847a729c0f3cef2c0b8b9d0289"))
( 84065, uint256("0xa904170a5a98109b2909379d9bc03ef97a6b44d5dafbc9084b8699b0cba5aa98"))
( 228023, uint256("0x15c94667a9e941359d2ee6527e2876db1b5e7510a5ded3885ca02e7e0f516b51"))
( 228023, uint256("0x15c94667a9e941359d2ee6527e2876db1b5e7510a5ded3885ca02e7e0f516b51"))
( 346992, uint256("0xf1714fa4c7990f4b3d472eb22132891ccd3c7ad7208e2d1ab15bde68854fb0ee"))
( 347269, uint256("0xfa1e592b7ea2aa97c5f20ccd7c40f3aaaeb31d1232c978847a79f28f83b6c22a"))
( 430000, uint256("0x2f5703cf7b6f956b84fd49948cbf49dc164cfcb5a7b55903b1c4f53bc7851611"))
( 516999, uint256("0x572ed47da461743bcae526542053e7bc532de299345e4f51d77786f2870b7b28"))
( 627610, uint256("0x6000a787f2d8bb77d4f491a423241a4cc8439d862ca6cec6851aba4c79ccfedc"))
( 667269, uint256("0x330f7d1523e855712656820207b2443ba18ffbcd05448417d437a047545aa02c"))
;
static const CCheckpointData data = {
&mapCheckpoints,
1481263875, // * UNIX timestamp of last checkpoint block
2134630, // * total number of transactions between genesis and last checkpoint
1487219226, // * UNIX timestamp of last checkpoint block
2199818, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
450.0 // * estimated number of transactions per day after checkpoint
360.0 // * estimated number of transactions per day after checkpoint
};

static MapCheckpoints mapCheckpointsTestnet =
Expand Down
6 changes: 3 additions & 3 deletions src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 10
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 2
#define CLIENT_VERSION_REVISION 1
#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 2016
#define COPYRIGHT_YEAR 2017

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
Expand Down
21 changes: 20 additions & 1 deletion src/key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,28 @@ class CECKey {
}

bool Sign(const uint256 &hash, std::vector<unsigned char>& vchSig) {
vchSig.clear();
ECDSA_SIG *sig = ECDSA_do_sign((unsigned char*)&hash, sizeof(hash), pkey);
if (sig == NULL)
return false;
BN_CTX *ctx = BN_CTX_new();
BN_CTX_start(ctx);
const EC_GROUP *group = EC_KEY_get0_group(pkey);
BIGNUM *order = BN_CTX_get(ctx);
BIGNUM *halforder = BN_CTX_get(ctx);
EC_GROUP_get_order(group, order, ctx);
BN_rshift1(halforder, order);
if (BN_cmp(sig->s, halforder) > 0) {
// enforce low S values, by negating the value (modulo the order) if above order/2.
BN_sub(sig->s, order, sig->s);
}
BN_CTX_end(ctx);
BN_CTX_free(ctx);
unsigned int nSize = ECDSA_size(pkey);
vchSig.resize(nSize); // Make sure it is big enough
assert(ECDSA_sign(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], &nSize, pkey));
unsigned char *pos = &vchSig[0];
nSize = i2d_ECDSA_SIG(sig, &pos);
ECDSA_SIG_free(sig);
vchSig.resize(nSize); // Shrink to fit actual size
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ LIBS= \

DEFS=-D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE
DEBUGFLAGS=-g
CFLAGS= -mthreads -O2 -std=c++14 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
CFLAGS= -mthreads -O2 -std=c++11 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
# enable: ASLR, DEP and large address aware
LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -static

Expand Down
2 changes: 1 addition & 1 deletion src/makefile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ 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 -std=c++14 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \
xCXXFLAGS=-O2 -std=c++11 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \
$(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)


Expand Down
12 changes: 6 additions & 6 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ void BitcoinGUI::createActions()
addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
tabGroup->addAction(addressBookAction);

stealthAddressAction = new QAction(QIcon(":/icons/stealth_addresses"), tr("&Stealth Addresses"), this);
/*stealthAddressAction = new QAction(QIcon(":/icons/stealth_addresses"), tr("&Stealth Addresses"), this);
stealthAddressAction->setStatusTip(tr("Show the list of stealth addresses for receiving payments"));
stealthAddressAction->setToolTip(stealthAddressAction->statusTip());
stealthAddressAction->setCheckable(true);
stealthAddressAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));
tabGroup->addAction(stealthAddressAction);
tabGroup->addAction(stealthAddressAction);*/

connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage()));
Expand All @@ -217,8 +217,8 @@ void BitcoinGUI::createActions()
connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage()));
connect(stealthAddressAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(stealthAddressAction, SIGNAL(triggered()), this, SLOT(gotoStealthAddressPage()));
//connect(stealthAddressAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
//connect(stealthAddressAction, SIGNAL(triggered()), this, SLOT(gotoStealthAddressPage()));

quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this);
quitAction->setStatusTip(tr("Quit application"));
Expand Down Expand Up @@ -301,7 +301,7 @@ void BitcoinGUI::createToolBars()
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(stealthAddressAction);
//toolbar->addAction(stealthAddressAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
}
Expand Down Expand Up @@ -380,7 +380,7 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled)
signMessageAction->setEnabled(enabled);
verifyMessageAction->setEnabled(enabled);
addressBookAction->setEnabled(enabled);
stealthAddressAction->setEnabled(enabled);
//stealthAddressAction->setEnabled(enabled);

}

Expand Down
3 changes: 2 additions & 1 deletion src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,8 @@ bool CWallet::CreateTransaction(const vector<pair<pair<pair<CScript, int64>, ec_
dPriority /= nBytes;

// Check that enough fee is included
bool fAllowFree = CTransaction::AllowFree(dPriority);
//bool fAllowFree = CTransaction::AllowFree(dPriority);
bool fAllowFree = false;
int64 nMinFee = wtxNew.GetMinFee(1, fAllowFree, GMF_SEND);

if (nFeeRet < nMinFee)
Expand Down
2 changes: 1 addition & 1 deletion vertcoin-qt-mingw32.static.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TEMPLATE = app
TARGET = vertcoin-qt
macx:TARGET = "Vertcoin-Qt"
VERSION = 0.10.0.2
VERSION = 0.10.1.0
INCLUDEPATH += src src/json src/qt
QT += core gui network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
Expand Down
2 changes: 1 addition & 1 deletion vertcoin-qt.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TEMPLATE = app
TARGET = vertcoin-qt
macx:TARGET = "Vertcoin-Qt"
VERSION = 0.10.0.2
VERSION = 0.10.1.0
INCLUDEPATH += src src/json src/qt
QT += core gui network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
Expand Down

0 comments on commit b407ad7

Please sign in to comment.