Skip to content

Commit

Permalink
Merge branch 'master' into add-jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackcoinDev committed Jul 18, 2024
2 parents ff58458 + 116d75f commit 1c32a95
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 41 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v13.2.3 (2024-05-18)
- Create V2 transactions by default
- Disconnect from peers older than version 70015
- Increased `DEFAULT_MIN_RELAY_TX_FEE` to 100000

## v13.2.2 (2024-01-24)
- Set mainnet hard fork date to April 24, 2024
- Adjusted minimum fee calculations
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ https://blackcoinmore.org
What is Blackcoin?
----------------

Blackcoin is a decentralised digital currency with near-instant transaction speeds and negligible transaction fees built upon Proof of Stake 3.0 (PoSV3, BPoS) as
Blackcoin is a decentralised digital currency with near-instant transaction speeds and negligible transaction fees built upon Proof of Stake 3.1 (PoSV3, BPoS) as
introduced by the Blackcoin development team.

For more information about Blackcoin itself, see https://blackcoin.org.
Expand Down Expand Up @@ -79,8 +79,5 @@ However, it may contain experimental features and should be used with caution.
### 13.2
The release branch for Blackcoin More 13.2.x. It is intended to contain stable and functional code that has been thoroughly tested and reviewed.

### 25.x
The release branch for Blackcoin More 25.x. Contains functional but experimental code.

### 26.x
The release branch for Blackcoin More 26.x. Contains functional but highly experimental code.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 13)
define(_CLIENT_VERSION_MINOR, 2)
define(_CLIENT_VERSION_BUILD, 2)
define(_CLIENT_VERSION_BUILD, 3)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2024)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down
4 changes: 4 additions & 0 deletions contrib/seeds/nodes_main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
[2a02:c207:2110:9259::1]
[2a10:3781:525:1::210]
[2a10:3781:525:1::201]
[2a10:3781:525:1::211]
[2a10:3781:525:1::212]
[2a10:3781:525:1::213]
[2a10:3781:525:1::215]
[2a10:3781:525:6::10]
[2a10:3781:525:6::11]
[2602:fec3:2:10::9:91]
Expand Down
7 changes: 5 additions & 2 deletions contrib/seeds/nodes_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
167.86.117.144
167.86.117.143
45.137.91.173
45.137.91.173
5.189.160.139
81.0.246.79
5.189.159.220
Expand All @@ -27,8 +26,12 @@
[2a02:c207:2110:9257::1]
[2a02:c204:2110:9258::1]
[2a02:c207:2110:9259::1]
[2a10:3781:525:1::210]
[2a10:3781:525:1::201]
[2a10:3781:525:1::210]
[2a10:3781:525:1::211]
[2a10:3781:525:1::212]
[2a10:3781:525:1::213]
[2a10:3781:525:1::215]
[2a10:3781:525:6::10]
[2a10:3781:525:6::11]

Expand Down
16 changes: 9 additions & 7 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class CMainParams : public CChainParams {
consensus.nCoinbaseMaturity = 500;

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000416ebe78f593ec11fb2"); // block 4791500
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000042bc25fcf69bab7b312"); // block 4938940

/**
* The message start string is designed to be unlikely to occur in normal data.
Expand Down Expand Up @@ -164,9 +164,10 @@ class CMainParams : public CChainParams {
(254348, uint256S("0x9bf8d9bd757d3ef23d5906d70567e5f0da93f1e0376588c8d421a95e2421838b")) // minor network split
(319002, uint256S("0x0011494d03b2cdf1ecfc8b0818f1e0ef7ee1d9e9b3d1279c10d35456bc3899ef")) // hardfork
(872456, uint256S("0xe4fd321ced1de06213d2e246b150b4bfd8c4aa0989965dce88f2a58668c64860")) // hardfork
(4232630, uint256S("0xae0c2a9bd13746e2887ca57bf1046b3c787a5ed1068fd1633a3575f08ee291fc")), // start devfund
1668631296, // * UNIX timestamp of last checkpoint block
13562393, // * total number of transactions between genesis and last checkpoint
(4232630, uint256S("0xae0c2a9bd13746e2887ca57bf1046b3c787a5ed1068fd1633a3575f08ee291fc")) // start devfund
(4908715, uint256S("0x6f8e37e21aa2fba3f8e2d6825cb825ca290e9367ed08b8c30943bc16efcba119")), // PoS v3.1 hardfork
1713938480, // * UNIX timestamp of last checkpoint block
15170003, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
3500.0 // * estimated number of transactions per day after checkpoint
};
Expand Down Expand Up @@ -220,7 +221,7 @@ class CTestNetParams : public CChainParams {
nDefaultPort = 25714;

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000478d1e3e759bd0f7e2"); // block 1720482
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000004ef99ad4b35ad0930a"); // block 1866885

nPruneAfterHeight = 1000;

Expand Down Expand Up @@ -249,10 +250,11 @@ class CTestNetParams : public CChainParams {
checkpointData = (CCheckpointData) {
boost::assign::map_list_of
( 90235, uint256S("0x567898e79184dc2f7dc3a661f794f28566e4b856d70180914f7371b1b3cc82d8")) //initial snapshot
(1320664, uint256S("0x64fa6a5414c6797629d34ef150c46486a5e1d49d2bceb87d6da14a501f838afd")) //PoS v3.1 hardfork
(1415393, uint256S("0x5d5c42500cc6057533e249ba9eeb9b5e998aff30468c904bc267ec9bccbc8b39")), //start devfund
1685643568,
70100,
2.0
280130,
3500.0
};

// A vector of p2sh addresses
Expand Down
10 changes: 9 additions & 1 deletion src/chainparamsseeds.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ static SeedSpec6 pnSeed6_main[] = {
{{0x2a,0x02,0xc2,0x07,0x21,0x10,0x92,0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 15714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10}, 15714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01}, 15714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x11}, 15714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x12}, 15714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x13}, 15714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x15}, 15714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10}, 15714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11}, 15714},
{{0x26,0x02,0xfe,0xc3,0x00,0x02,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x91}, 15714},
Expand All @@ -56,7 +60,6 @@ static SeedSpec6 pnSeed6_test[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa7,0x56,0x75,0x90}, 25714},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa7,0x56,0x75,0x8f}, 25714},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x89,0x5b,0xad}, 25714},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x89,0x5b,0xad}, 25714},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xbd,0xa0,0x8b}, 25714},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0x00,0xf6,0x4f}, 25714},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xbd,0x9f,0xdc}, 25714},
Expand All @@ -76,7 +79,12 @@ static SeedSpec6 pnSeed6_test[] = {
{{0x2a,0x02,0xc2,0x07,0x21,0x10,0x92,0x57,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 25714},
{{0x2a,0x02,0xc2,0x04,0x21,0x10,0x92,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 25714},
{{0x2a,0x02,0xc2,0x07,0x21,0x10,0x92,0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01}, 25714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01}, 25714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10}, 25714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x11}, 25714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x12}, 25714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x13}, 25714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x15}, 25714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01}, 25714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10}, 25714},
{{0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11}, 25714},
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 13
#define CLIENT_VERSION_MINOR 2
#define CLIENT_VERSION_BUILD 2
#define CLIENT_VERSION_BUILD 3

//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
20 changes: 6 additions & 14 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1226,9 +1226,9 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
return state.DoS(0, false, REJECT_INVALID, "too many dust vouts");
}

// Blackcoin: in v2 transactions use GetAdjustedTime() as TxTime
// Blackcoin: in v2 transactions use GetAdjustedTime() as nTimeTx
int64_t nTimeTx = (int64_t)tx.nTime;
if (!nTimeTx && tx.nVersion >= CTransaction::MAX_STANDARD_VERSION)
if (!nTimeTx && tx.nVersion >= 2)
nTimeTx = GetAdjustedTime();

if (!CheckTransaction(tx, state))
Expand All @@ -1242,14 +1242,6 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
if (tx.IsCoinStake())
return state.DoS(100, false, REJECT_INVALID, "coinstake");

// Don't relay version 2 transactions until CSV is active, and we can be
// sure that such transactions will be mined (unless we're on
// -testnet/-regtest).
const CChainParams& chainparams = Params();
if (fRequireStandard && tx.nVersion >= CTransaction::MAX_STANDARD_VERSION && !chainparams.GetConsensus().IsProtocolV3_1(nTimeTx)) {
return state.DoS(0, false, REJECT_NONSTANDARD, "premature-version2-tx");
}

// Rather not work on nonstandard transactions (unless -testnet/-regtest)
string reason;
if (fRequireStandard && !IsStandardTx(tx, reason))
Expand Down Expand Up @@ -1348,7 +1340,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
CAmount nFees = nValueIn-nValueOut;

// Blackcoin: Minimum fee check
if (chainparams.GetConsensus().IsProtocolV3_1(nTimeTx) && nFees < GetMinFee(tx, nTimeTx))
if (Params().GetConsensus().IsProtocolV3_1(nTimeTx) && nFees < GetMinFee(tx, nTimeTx))
return state.Invalid(false, REJECT_INSUFFICIENTFEE, "fee is below minimum");

// nModifiedFees includes any fee deltas from PrioritiseTransaction
Expand Down Expand Up @@ -2007,9 +1999,9 @@ bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoins
if (!inputs.HaveInputs(tx))
return state.Invalid(false, 0, "", "Inputs unavailable");

// Blackcoin: in v2 transactions use GetAdjustedTime() as TxTime
// Blackcoin: in v2 transactions use GetAdjustedTime() as nTimeTx
int64_t nTimeTx = tx.nTime;
if (!nTimeTx && tx.nVersion >= CTransaction::MAX_STANDARD_VERSION)
if (!nTimeTx && tx.nVersion >= 2)
nTimeTx = GetAdjustedTime();

CAmount nValueIn = 0;
Expand Down Expand Up @@ -5179,7 +5171,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
return false;
}

if (pfrom->nVersion < (chainparams.GetConsensus().IsProtocolV3_1(GetAdjustedTime()) ? PROTOCOL_VERSION : MIN_PEER_PROTO_VERSION))
if (pfrom->nVersion < MIN_PEER_PROTO_VERSION)
{
// disconnect from peers older than this proto version
LogPrintf("peer=%d using obsolete version %i; disconnecting\n", pfrom->id, pfrom->nVersion);
Expand Down
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static const unsigned int MIN_TX_FEE = 10000;
/** Minimum fee per kB */
static const unsigned int TX_FEE_PER_KB = 100000;
/** Default for -minrelaytxfee, minimum relay fee for transactions */
static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 10000;
static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 100000;
//! -maxtxfee default
static const CAmount DEFAULT_TRANSACTION_MAXFEE = 1 * COIN;
//! Discourage users to set fees higher than this amount (in satoshis) per kB
Expand Down
6 changes: 1 addition & 5 deletions src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,7 @@ CBlockTemplate* BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn, in
pblock->nVersion = GetArg("-blockversion", pblock->nVersion);

pblock->nTime = GetAdjustedTime();
const int64_t nMedianTimePast = pindexPrev->GetPastTimeLimit();

nLockTimeCutoff = (STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST)
? nMedianTimePast
: pblock->GetBlockTime();
nLockTimeCutoff = pindexPrev->GetPastTimeLimit();

addPriorityTxs(pblock->GetBlockTime(), fProofOfStake);
addPackageTxs();
Expand Down
2 changes: 1 addition & 1 deletion src/policy/policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int64_t FutureDrift(int64_t nTime)

bool IsStandardTx(const CTransaction& tx, std::string& reason)
{
if ((!Params().GetConsensus().IsProtocolV3_1(tx.nTime ? tx.nTime : GetAdjustedTime()) && (tx.nVersion > CTransaction::MAX_STANDARD_VERSION-1)) || tx.nVersion > CTransaction::MAX_STANDARD_VERSION || tx.nVersion < 1) {
if (tx.nVersion > CTransaction::MAX_STANDARD_VERSION || tx.nVersion < 1) {
reason = "version";
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/primitives/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class CTransaction

public:
// Default transaction version.
static const int32_t CURRENT_VERSION=1;
static const int32_t CURRENT_VERSION=2;

// Changing the default transaction version requires a two step process: first
// adapting relay policy by bumping MAX_STANDARD_VERSION, and then later date
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static const int CANONICAL_BLOCK_SIG_VERSION = 60016;
static const int CANONICAL_BLOCK_SIG_LOW_S_VERSION = 60018;

//! disconnect from peers older than this proto version
static const int MIN_PEER_PROTO_VERSION = 70012;
static const int MIN_PEER_PROTO_VERSION = 70015;

//! nTime field added to CAddress, starting with this version;
//! if possible, avoid requesting addresses nodes older than this
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2621,7 +2621,7 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
std::vector<COutput> vAvailableCoins;
AvailableCoins(vAvailableCoins, true, coinControl);

nFeeRet = Params().GetConsensus().IsProtocolV3_1(txNew.nTime) ? MIN_TX_FEE : 0;
nFeeRet = MIN_TX_FEE;
// Start with no fee and loop until there is enough fee
while (true)
{
Expand Down Expand Up @@ -3711,7 +3711,7 @@ std::string CWallet::GetWalletHelpString(bool showDebug)
strUsage += HelpMessageOpt("-salvagewallet", _("Attempt to recover private keys from a corrupt wallet on startup"));
strUsage += HelpMessageOpt("-spendzeroconfchange", strprintf(_("Spend unconfirmed change when sending transactions (default: %u)"), DEFAULT_SPEND_ZEROCONF_CHANGE));
strUsage += HelpMessageOpt("-txconfirmtarget=<n>", strprintf(_("If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)"), DEFAULT_TX_CONFIRM_TARGET));
strUsage += HelpMessageOpt("-txversion=<n>", _("Set default transaction version") + " " + _("(default: 1)"));
strUsage += HelpMessageOpt("-txversion=<n>", _("Set default transaction version") + " " + _("(default: 2)"));
strUsage += HelpMessageOpt("-usehd", _("Use hierarchical deterministic key generation (HD) after BIP32. Only has effect during wallet creation/first start") + " " + strprintf(_("(default: %u)"), DEFAULT_USE_HD_WALLET));
strUsage += HelpMessageOpt("-upgradewallet", _("Upgrade wallet to latest format on startup"));
strUsage += HelpMessageOpt("-wallet=<file>", _("Specify wallet file (within data directory)") + " " + strprintf(_("(default: %s)"), DEFAULT_WALLET_DAT));
Expand Down

0 comments on commit 1c32a95

Please sign in to comment.