Skip to content

Commit 69775b1

Browse files
Merge pull request #77 from DigitalNoteXDN/v2.0.0.4-testing
V2.0.0.4 testing merge
2 parents a0fb5d7 + 45eb8cc commit 69775b1

5 files changed

Lines changed: 39 additions & 8 deletions

File tree

DigitalNote_config.pri

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
DIGITALNOTE_VERSION_MAJOR = 2
22
DIGITALNOTE_VERSION_MINOR = 0
33
DIGITALNOTE_VERSION_REVISION = 0
4-
DIGITALNOTE_VERSION_BUILD = 3
4+
DIGITALNOTE_VERSION_BUILD = 4
55

66
DIGITALNOTE_LIB_LEVELDB_DIR = $${DIGITALNOTE_PATH}/src/leveldb
77
DIGITALNOTE_LIB_LEVELDB_NEW_DIR = $${DIGITALNOTE_PATH}/src/leveldb-2.11

src/clientversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define CLIENT_VERSION_MAJOR 2
1010
#define CLIENT_VERSION_MINOR 0
1111
#define CLIENT_VERSION_REVISION 0
12-
#define CLIENT_VERSION_BUILD 3
12+
#define CLIENT_VERSION_BUILD 4
1313

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

src/ctransaction.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "util.h"
2020
#include "cautofile.h"
2121
#include "cdatastream.h"
22+
#include "checkpoints.h"
2223

2324
#include "ctransaction.h"
2425

@@ -494,7 +495,7 @@ bool CTransaction::ConnectInputs(CTxDB& txdb, MapPrevTx inputs, std::map<uint256
494495
// Skip ECDSA signature verification when connecting blocks (fBlock=true)
495496
// before the last blockchain checkpoint. This is safe because block merkle hashes are
496497
// still computed and checked, and any change will be caught at the next checkpoint.
497-
if (!(fBlock && !IsInitialBlockDownload()))
498+
if (!(fBlock && (nBestHeight < Checkpoints::GetTotalBlocksEstimate())))
498499
{
499500
// Verify signature
500501
if (!VerifySignature(txPrev, *this, i, flags, 0))

src/script.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3843,6 +3843,13 @@ bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CTrans
38433843

38443844
bool VerifySignature(const CTransaction& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType)
38453845
{
3846+
std::string _txFrom, _txTo;
3847+
3848+
_txFrom = txFrom.GetHash().ToString();
3849+
_txTo = txTo.GetHash().ToString();
3850+
3851+
LogPrintf("VerifySignature from %s to %s\n", _txFrom.c_str(), _txTo.c_str());
3852+
38463853
assert(nIn < txTo.vin.size());
38473854

38483855
const CTxIn& txin = txTo.vin[nIn];
@@ -3859,6 +3866,29 @@ bool VerifySignature(const CTransaction& txFrom, const CTransaction& txTo, unsig
38593866
return false;
38603867
}
38613868

3869+
/*
3870+
Exploit happpend on 31st Aug 2021 17:17:26
3871+
3872+
Reference:
3873+
https://xdn-explorer.com/block/00000000000371f620dba8ef1576407b558686d8b00ca275c3debbfaee6a3db8
3874+
*/
3875+
if(
3876+
(
3877+
(
3878+
_txFrom == "81140f106083298143e0e0bd044705b83a891bf2072721dfa43f7237be5931fb" ||
3879+
_txFrom == "164a0151731efc1536fd75e7d5c4a61e17ef67df1d0f4649b3689d604a41a955"
3880+
) &&
3881+
_txTo == "2a639be55df3d7789c73e05aab30edce8fc867d1aae76728e2d59dd2c19b39ab"
3882+
) ||
3883+
(
3884+
_txFrom == "2a639be55df3d7789c73e05aab30edce8fc867d1aae76728e2d59dd2c19b39ab" &&
3885+
_txTo == "adb24c4a4f50bf848ded522fad8de1546bcc16f1ae838a5b51888bcd753dd25b"
3886+
)
3887+
)
3888+
{
3889+
return true;
3890+
}
3891+
38623892
return VerifyScript(txin.scriptSig, txout.scriptPubKey, txTo, nIn, flags, nHashType);
38633893
}
38643894

src/version.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ static const int DATABASE_VERSION = 70509;
3030
//
3131
// network protocol versioning
3232
//
33-
static const int PROTOCOL_VERSION = 62051;
33+
static const int PROTOCOL_VERSION = 62052;
3434

3535
// intial proto version, to be increased after version/verack negotiation
3636
static const int INIT_PROTO_VERSION = 209;
3737

3838
// disconnect from peers older than this proto version
39-
static const int MIN_PEER_PROTO_VERSION = 62049;
39+
static const int MIN_PEER_PROTO_VERSION = 62052;
4040

4141
// minimum peer version accepted by MNenginePool
4242
static const int MIN_POOL_PEER_PROTO_VERSION = 62050;
@@ -45,16 +45,16 @@ static const int MIN_INSTANTX_PROTO_VERSION = 62050;
4545
//! minimum peer version that can receive masternode payments
4646
// V1 - Last protocol version before update
4747
// V2 - Newest protocol version
48-
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 62050;
49-
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 62050;
48+
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 62051;
49+
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 62051;
5050

5151
// nTime field added to CAddress, starting with this version;
5252
// if possible, avoid requesting addresses nodes older than this
5353
static const int CADDR_TIME_VERSION = 31402;
5454

5555
// only request blocks from nodes outside this range of versions
5656
static const int NOBLKS_VERSION_START = 0;
57-
static const int NOBLKS_VERSION_END = 62050;
57+
static const int NOBLKS_VERSION_END = 62051;
5858

5959
// hard cutoff time for legacy network connections
6060
static const int64_t HRD_LEGACY_CUTOFF = 9993058800; // OFF (NOT TOGGLED)

0 commit comments

Comments
 (0)