Skip to content

Commit

Permalink
Merge pull request #73 from zcoinofficial/dev
Browse files Browse the repository at this point in the history
Merge Dev
  • Loading branch information
nopslide authored Feb 19, 2017
2 parents 81a6678 + a614887 commit ca0bb3c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 8
#define CLIENT_VERSION_REVISION 7
#define CLIENT_VERSION_BUILD 6
#define CLIENT_VERSION_BUILD 7

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
33 changes: 23 additions & 10 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ bool CTransaction::CheckTransaction(CValidationState &state, uint256 hashTx, boo
// CHECK PUBCOIN ID
int pubcoinId = txin.nSequence;
//printf("====================== pubcoinId = %d\n", pubcoinId);
if (pubcoinId < 1 && pubcoinId == INT_MAX) { // IT BEGINS WITH 1
if (pubcoinId < 1 || pubcoinId >= INT_MAX) { // IT BEGINS WITH 1
return state.DoS(100, error("CTransaction::CheckTransaction() : Error: nSequence is not correct format"));
}

Expand Down Expand Up @@ -960,7 +960,9 @@ bool CTransaction::CheckTransaction(CValidationState &state, uint256 hashTx, boo
zccoinSpend.hashTx = hashTx;
zccoinSpend.pubCoin = 0;
zccoinSpend.id = pubcoinId;
zccoinSpend.denomination == libzerocoin::ZQ_LOVELACE;
if(nHeight > 22000 && nHeight < INT_MAX){
zccoinSpend.denomination = libzerocoin::ZQ_LOVELACE;
}
walletdb.WriteCoinSpendSerialEntry(zccoinSpend);
}
}
Expand Down Expand Up @@ -1004,7 +1006,7 @@ bool CTransaction::CheckTransaction(CValidationState &state, uint256 hashTx, boo

// CHECK PUBCOIN ID
unsigned int pubcoinId = txin.nSequence;
if (pubcoinId < 1) { // IT BEGINS WITH 1
if (pubcoinId < 1 || pubcoinId >= INT_MAX) { // IT BEGINS WITH 1
return state.DoS(100, error("CTransaction::CheckTransaction() : Error: nSequence is not correct format"));
}

Expand Down Expand Up @@ -1131,7 +1133,9 @@ bool CTransaction::CheckTransaction(CValidationState &state, uint256 hashTx, boo
zccoinSpend.hashTx = hashTx;
zccoinSpend.pubCoin = 0;
zccoinSpend.id = pubcoinId;
zccoinSpend.denomination == libzerocoin::ZQ_GOLDWASSER;
if(nHeight > 22000 && nHeight < INT_MAX){
zccoinSpend.denomination = libzerocoin::ZQ_GOLDWASSER;
}
walletdb.WriteCoinSpendSerialEntry(zccoinSpend);
}
}
Expand Down Expand Up @@ -1174,7 +1178,7 @@ bool CTransaction::CheckTransaction(CValidationState &state, uint256 hashTx, boo

// CHECK PUBCOIN ID
unsigned int pubcoinId = txin.nSequence;
if (pubcoinId < 1) { // IT BEGINS WITH 1
if (pubcoinId < 1 || pubcoinId >= INT_MAX) { // IT BEGINS WITH 1
return state.DoS(100, error("CTransaction::CheckTransaction() : Error: nSequence is not correct format"));
}

Expand Down Expand Up @@ -1300,7 +1304,9 @@ bool CTransaction::CheckTransaction(CValidationState &state, uint256 hashTx, boo
zccoinSpend.hashTx = hashTx;
zccoinSpend.pubCoin = 0;
zccoinSpend.id = pubcoinId;
zccoinSpend.denomination == libzerocoin::ZQ_RACKOFF;
if(nHeight > 22000 && nHeight < INT_MAX){
zccoinSpend.denomination = libzerocoin::ZQ_RACKOFF;
}
walletdb.WriteCoinSpendSerialEntry(zccoinSpend);
}
}
Expand Down Expand Up @@ -1343,7 +1349,7 @@ bool CTransaction::CheckTransaction(CValidationState &state, uint256 hashTx, boo

// CHECK PUBCOIN ID
unsigned int pubcoinId = txin.nSequence;
if (pubcoinId < 1) { // IT BEGINS WITH 1
if (pubcoinId < 1 || pubcoinId >= INT_MAX) { // IT BEGINS WITH 1
return state.DoS(100, error("CTransaction::CheckTransaction() : Error: nSequence is not correct format"));
}

Expand Down Expand Up @@ -1469,7 +1475,9 @@ bool CTransaction::CheckTransaction(CValidationState &state, uint256 hashTx, boo
zccoinSpend.hashTx = hashTx;
zccoinSpend.pubCoin = 0;
zccoinSpend.id = pubcoinId;
zccoinSpend.denomination == libzerocoin::ZQ_PEDERSEN;
if(nHeight > 22000 && nHeight < INT_MAX){
zccoinSpend.denomination = libzerocoin::ZQ_PEDERSEN;
}
walletdb.WriteCoinSpendSerialEntry(zccoinSpend);
}
}
Expand Down Expand Up @@ -1512,7 +1520,7 @@ bool CTransaction::CheckTransaction(CValidationState &state, uint256 hashTx, boo

// CHECK PUBCOIN ID
unsigned int pubcoinId = txin.nSequence;
if (pubcoinId < 1) { // IT BEGINS WITH 1
if (pubcoinId < 1 || pubcoinId >= INT_MAX) { // IT BEGINS WITH 1
return state.DoS(100, error("CTransaction::CheckTransaction() : Error: nSequence is not correct format"));
}

Expand Down Expand Up @@ -1639,7 +1647,9 @@ bool CTransaction::CheckTransaction(CValidationState &state, uint256 hashTx, boo
zccoinSpend.hashTx = hashTx;
zccoinSpend.pubCoin = 0;
zccoinSpend.id = pubcoinId;
zccoinSpend.denomination == libzerocoin::ZQ_WILLIAMSON;
if(nHeight > 22000 && nHeight < INT_MAX){
zccoinSpend.denomination = libzerocoin::ZQ_WILLIAMSON;
}
walletdb.WriteCoinSpendSerialEntry(zccoinSpend);
}
}
Expand Down Expand Up @@ -5914,6 +5924,9 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)

unsigned int COUNT_SPEND_ZC_TX = 0;
unsigned int MAX_SPEND_ZC_TX_PER_BLOCK = 0;
if(pindexBest->nHeight + 1 > 22000){
MAX_SPEND_ZC_TX_PER_BLOCK = 1;
}

// Collect memory pool transactions into the block
int64 nFees = 0;
Expand Down
3 changes: 3 additions & 0 deletions src/rpcmining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,9 @@ Value getblocktemplate(const Array& params, bool fHelp)
int i = 0;
unsigned int COUNT_SPEND_ZC_TX = 0;
unsigned int MAX_SPEND_ZC_TX_PER_BLOCK = 0;
if(pindexBest->nHeight + 1 > 22000){
MAX_SPEND_ZC_TX_PER_BLOCK = 1;
}
BOOST_FOREACH (CTransaction& tx, pblock->vtx)
{
uint256 txHash = tx.GetHash();
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern const std::string CLIENT_DATE;
// network protocol versioning
//

static const int PROTOCOL_VERSION = 90020;
static const int PROTOCOL_VERSION = 90021;

// intial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 90013;
Expand Down

0 comments on commit ca0bb3c

Please sign in to comment.