diff --git a/CHANGELOG.md b/CHANGELOG.md index 378c34b629..2b5b45eb3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## v26.1.0-beta-1 (2024-05-24) +- Updated to Bitcoin Core 26.1 +- Create V2 transactions by default +- Disconnect from peers older than version 70015 +- Increased `DUST_RELAY_TX_FEE` and `DEFAULT_MIN_RELAY_TX_FEE` to 100000 +- Eliminated segfault occurring after a power outage +- Enabled V2 P2P transport by default (backport of Core's PR29347 and 29058) +- Enabled `checkkernel` RPC call +- Only delete the PID file if we created it (backport of Core's PR28946) +- Set minimum UTXO value to be used for staking to 0.1 BLK (can be overridden with `-minstakingamount` parameter) + ## v26.0.0-beta-1 (2024-02-12) - Updated to Bitcoin Core 26.0 - Fixed a bug that prevented adding more inputs in the coinstake transaction for legacy wallets @@ -37,6 +48,11 @@ ## v22.1.0-alpha-1 (2023-01-20) - Updated to Bitcoin Core 22.1 +## 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 diff --git a/README.md b/README.md index 64d0c67164..a286e1fdff 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,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 introduced by the Blackcoin development team. +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. What is Blackcoin More? ---------------- @@ -92,8 +92,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. diff --git a/contrib/seeds/nodes_main.txt b/contrib/seeds/nodes_main.txt index cbfb41801f..1b1d2c7b5b 100644 --- a/contrib/seeds/nodes_main.txt +++ b/contrib/seeds/nodes_main.txt @@ -24,7 +24,6 @@ 216.39.250.91:15714 172.99.189.198:15714 50.47.255.100:15714 -95.217.78.81:15714 # IPv6 nodes @@ -37,6 +36,12 @@ [2a02:c207:2110:9259::1]:15714 [2a10:3781:525:1::210]:15714 [2a10:3781:525:1::201]:15714 +[2a10:3781:525:1::210]:15714 +[2a10:3781:525:1::201]:15714 +[2a10:3781:525:1::211]:15714 +[2a10:3781:525:1::212]:15714 +[2a10:3781:525:1::213]:15714 +[2a10:3781:525:1::215]:15714 [2a10:3781:525:6::10]:15714 [2a10:3781:525:6::11]:15714 [2602:fec3:2:10::9:91]:15714 diff --git a/contrib/seeds/nodes_test.txt b/contrib/seeds/nodes_test.txt index 0e7608a7dd..78ef93aca5 100644 --- a/contrib/seeds/nodes_test.txt +++ b/contrib/seeds/nodes_test.txt @@ -28,6 +28,10 @@ [2a02:c207:2110:9259::1]:25714 [2a10:3781:525:1::210]:25714 [2a10:3781:525:1::201]:25714 +[2a10:3781:525:1::211]:25714 +[2a10:3781:525:1::212]:25714 +[2a10:3781:525:1::213]:25714 +[2a10:3781:525:1::215]:25714 [2a10:3781:525:6::10]:25714 [2a10:3781:525:6::11]:25714 diff --git a/doc/man/blackmore-cli.1 b/doc/man/blackmore-cli.1 index 32f76f62dc..96f09df78b 100644 --- a/doc/man/blackmore-cli.1 +++ b/doc/man/blackmore-cli.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1. -.TH BLACKMORE-CLI "1" "February 2024" "blackmore-cli v26.0.0" "User Commands" +.TH BLACKMORE-CLI "1" "April 2024" "blackmore-cli v26.1.0" "User Commands" .SH NAME -blackmore-cli \- manual page for blackmore-cli v26.0.0 +blackmore-cli \- manual page for blackmore-cli v26.1.0 .SH SYNOPSIS .B blackmore-cli [\fI\,options\/\fR] \fI\, \/\fR[\fI\,params\/\fR] \fI\,Send command to Blackcoin More\/\fR @@ -15,7 +15,7 @@ blackmore-cli \- manual page for blackmore-cli v26.0.0 .B blackmore-cli [\fI\,options\/\fR] \fI\,help Get help for a command\/\fR .SH DESCRIPTION -Blackcoin More RPC client version v26.0.0 +Blackcoin More RPC client version v26.1.0 .SH OPTIONS .HP \-? diff --git a/doc/man/blackmore-qt.1 b/doc/man/blackmore-qt.1 index 47a4911e38..e6bbd297b1 100644 --- a/doc/man/blackmore-qt.1 +++ b/doc/man/blackmore-qt.1 @@ -1,12 +1,12 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1. -.TH BLACKMORE-QT "1" "February 2024" "blackmore-qt v26.0.0" "User Commands" +.TH BLACKMORE-QT "1" "April 2024" "blackmore-qt v26.1.0" "User Commands" .SH NAME -blackmore-qt \- manual page for blackmore-qt v26.0.0 +blackmore-qt \- manual page for blackmore-qt v26.1.0 .SH SYNOPSIS .B blackmore-qt [\fI\,command-line options\/\fR] .SH DESCRIPTION -Blackcoin More version v26.0.0 +Blackcoin More version v26.1.0 .SH OPTIONS .HP \-? diff --git a/doc/man/blackmore-tx.1 b/doc/man/blackmore-tx.1 index 785a77a1e1..80ee4919cd 100644 --- a/doc/man/blackmore-tx.1 +++ b/doc/man/blackmore-tx.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1. -.TH BLACKMORE-TX "1" "February 2024" "blackmore-tx v26.0.0" "User Commands" +.TH BLACKMORE-TX "1" "April 2024" "blackmore-tx v26.1.0" "User Commands" .SH NAME -blackmore-tx \- manual page for blackmore-tx v26.0.0 +blackmore-tx \- manual page for blackmore-tx v26.1.0 .SH SYNOPSIS .B blackmore-tx [\fI\,options\/\fR] \fI\, \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded blackcoin transaction\/\fR @@ -9,7 +9,7 @@ blackmore-tx \- manual page for blackmore-tx v26.0.0 .B blackmore-tx [\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded blackcoin transaction\/\fR .SH DESCRIPTION -Blackcoin More blackmore\-tx utility version v26.0.0 +Blackcoin More blackmore\-tx utility version v26.1.0 .SH OPTIONS .HP \-? diff --git a/doc/man/blackmore-util.1 b/doc/man/blackmore-util.1 index 3d49e28ac4..3b2d1e3e36 100644 --- a/doc/man/blackmore-util.1 +++ b/doc/man/blackmore-util.1 @@ -1,12 +1,12 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1. -.TH BLACKMORE-UTIL "1" "February 2024" "blackmore-util v26.0.0" "User Commands" +.TH BLACKMORE-UTIL "1" "April 2024" "blackmore-util v26.1.0" "User Commands" .SH NAME -blackmore-util \- manual page for blackmore-util v26.0.0 +blackmore-util \- manual page for blackmore-util v26.1.0 .SH SYNOPSIS .B blackmore-util [\fI\,options\/\fR] [\fI\,commands\/\fR] \fI\,Do stuff\/\fR .SH DESCRIPTION -Blackcoin More blackmore\-util utility version v26.0.0 +Blackcoin More blackmore\-util utility version v26.1.0 .SH OPTIONS .HP \-? diff --git a/doc/man/blackmore-wallet.1 b/doc/man/blackmore-wallet.1 index 548fe7fdde..c8d3ef9a69 100644 --- a/doc/man/blackmore-wallet.1 +++ b/doc/man/blackmore-wallet.1 @@ -1,9 +1,9 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1. -.TH BLACKMORE-WALLET "1" "February 2024" "blackmore-wallet v26.0.0" "User Commands" +.TH BLACKMORE-WALLET "1" "April 2024" "blackmore-wallet v26.1.0" "User Commands" .SH NAME -blackmore-wallet \- manual page for blackmore-wallet v26.0.0 +blackmore-wallet \- manual page for blackmore-wallet v26.1.0 .SH DESCRIPTION -Blackcoin More blackmore\-wallet version v26.0.0 +Blackcoin More blackmore\-wallet version v26.1.0 .PP blackmore\-wallet is an offline tool for creating and interacting with Blackcoin More wallet files. By default blackmore\-wallet will act on wallets in the default mainnet wallet directory in the datadir. diff --git a/doc/man/blackmored.1 b/doc/man/blackmored.1 index 99175bb72b..b0c031736f 100644 --- a/doc/man/blackmored.1 +++ b/doc/man/blackmored.1 @@ -1,12 +1,12 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1. -.TH BLACKMORED "1" "February 2024" "blackmored v26.0.0" "User Commands" +.TH BLACKMORED "1" "April 2024" "blackmored v26.1.0" "User Commands" .SH NAME -blackmored \- manual page for blackmored v26.0.0 +blackmored \- manual page for blackmored v26.1.0 .SH SYNOPSIS .B blackmored [\fI\,options\/\fR] \fI\,Start Blackcoin More\/\fR .SH DESCRIPTION -Blackcoin More version v26.0.0 +Blackcoin More version v26.1.0 .SH OPTIONS .HP \-? diff --git a/src/bench/checkblock.cpp b/src/bench/checkblock.cpp index 5cf46f617b..b3622748c4 100644 --- a/src/bench/checkblock.cpp +++ b/src/bench/checkblock.cpp @@ -19,7 +19,7 @@ static void DeserializeBlockTest(benchmark::Bench& bench) { - DataStream stream(benchmark::data::block413567); + CDataStream stream(benchmark::data::block413567, SER_NETWORK); std::byte a{0}; stream.write({&a, 1}); // Prevent compaction @@ -33,7 +33,7 @@ static void DeserializeBlockTest(benchmark::Bench& bench) static void DeserializeAndCheckBlockTest(benchmark::Bench& bench) { - DataStream stream(benchmark::data::block413567); + CDataStream stream(benchmark::data::block413567, SER_NETWORK); std::byte a{0}; stream.write({&a, 1}); // Prevent compaction diff --git a/src/bench/load_external.cpp b/src/bench/load_external.cpp index fba1233901..5b33d170af 100644 --- a/src/bench/load_external.cpp +++ b/src/bench/load_external.cpp @@ -55,7 +55,7 @@ static void LoadExternalBlockFile(benchmark::Bench& bench) bench.run([&] { // "rb" is "binary, O_RDONLY", positioned to the start of the file. // The file will be closed by LoadExternalBlockFile(). - AutoFile file{fsbridge::fopen(blkfile, "rb")}; + CAutoFile file{fsbridge::fopen(blkfile, "rb")}; testing_setup->m_node.chainman->LoadExternalBlockFile(file, &pos, &blocks_with_unknown_parent); }); fs::remove(blkfile); diff --git a/src/bench/readblock.cpp b/src/bench/readblock.cpp index 0545c6b017..ab16674861 100644 --- a/src/bench/readblock.cpp +++ b/src/bench/readblock.cpp @@ -14,7 +14,7 @@ static FlatFilePos WriteBlockToDisk(ChainstateManager& chainman) { - DataStream stream{benchmark::data::block413567}; + CDataStream stream{benchmark::data::block413567, SER_NETWORK}; CBlock block; stream >> TX_WITH_WITNESS(block); diff --git a/src/bench/rpc_blockchain.cpp b/src/bench/rpc_blockchain.cpp index 713853e8c5..020e71b42d 100644 --- a/src/bench/rpc_blockchain.cpp +++ b/src/bench/rpc_blockchain.cpp @@ -23,7 +23,7 @@ struct TestBlockAndIndex { TestBlockAndIndex() { - DataStream stream{benchmark::data::block413567}; + CDataStream stream(benchmark::data::block413567, SER_NETWORK); std::byte a{0}; stream.write({&a, 1}); // Prevent compaction diff --git a/src/bench/streams_findbyte.cpp b/src/bench/streams_findbyte.cpp index 8fde939428..e2e039518d 100644 --- a/src/bench/streams_findbyte.cpp +++ b/src/bench/streams_findbyte.cpp @@ -6,7 +6,6 @@ #include #include -#include // for PROTOCOL_VERSION #include #include @@ -15,7 +14,7 @@ static void FindByte(benchmark::Bench& bench) { // Setup - AutoFile file{fsbridge::fopen("streams_tmp", "w+b")}; + CAutoFile file{fsbridge::fopen("streams_tmp", "w+b"), 0}; const size_t file_size = 200; uint8_t data[file_size] = {0}; data[file_size-1] = 1; diff --git a/src/bench/verify_script.cpp b/src/bench/verify_script.cpp index e7166a91cf..c04ebbefea 100644 --- a/src/bench/verify_script.cpp +++ b/src/bench/verify_script.cpp @@ -65,7 +65,7 @@ static void VerifyScriptBench(benchmark::Bench& bench) assert(success); #if defined(HAVE_CONSENSUS_LIB) - DataStream stream; + CDataStream stream(SER_NETWORK); stream << TX_WITH_WITNESS(txSpend); int csuccess = bitcoinconsensus_verify_script_with_amount( txCredit.vout[0].scriptPubKey.data(), diff --git a/src/bitcoin-util.cpp b/src/bitcoin-util.cpp index f3c501dc4f..e0af014874 100644 --- a/src/bitcoin-util.cpp +++ b/src/bitcoin-util.cpp @@ -142,7 +142,7 @@ static int Grind(const std::vector& args, std::string& strPrint) return EXIT_FAILURE; } - CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); + CDataStream ss(SER_NETWORK); ss << header; strPrint = HexStr(ss); return EXIT_SUCCESS; diff --git a/src/blockencodings.cpp b/src/blockencodings.cpp index 9b8ab34f20..34dc1f6bf4 100644 --- a/src/blockencodings.cpp +++ b/src/blockencodings.cpp @@ -31,7 +31,7 @@ CBlockHeaderAndShortTxIDs::CBlockHeaderAndShortTxIDs(const CBlock& block) : } void CBlockHeaderAndShortTxIDs::FillShortTxIDSelector() const { - CDataStream stream(SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(SER_NETWORK); stream << header << nonce; CSHA256 hasher; hasher.Write((unsigned char*)&(*stream.begin()), stream.end() - stream.begin()); diff --git a/src/chainparamsseeds.h b/src/chainparamsseeds.h index 8fa7885511..02788817ad 100644 --- a/src/chainparamsseeds.h +++ b/src/chainparamsseeds.h @@ -30,7 +30,6 @@ static const uint8_t chainparams_seed_main[] = { 0x01,0x04,0xd8,0x27,0xfa,0x5b,0x3d,0x62, 0x01,0x04,0xac,0x63,0xbd,0xc6,0x3d,0x62, 0x01,0x04,0x32,0x2f,0xff,0x64,0x3d,0x62, - 0x01,0x04,0x5f,0xd9,0x4e,0x51,0x3d,0x62, 0x02,0x10,0x2a,0x02,0xc2,0x07,0x20,0x41,0x38,0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x3d,0x62, 0x02,0x10,0x2a,0x02,0xc2,0x07,0x20,0x56,0x65,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x3d,0x62, 0x02,0x10,0x2a,0x02,0xc2,0x07,0x20,0x56,0x65,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x3d,0x62, @@ -40,6 +39,12 @@ static const uint8_t chainparams_seed_main[] = { 0x02,0x10,0x2a,0x02,0xc2,0x07,0x21,0x10,0x92,0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x3d,0x62, 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10,0x3d,0x62, 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x3d,0x62, + 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10,0x3d,0x62, + 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x3d,0x62, + 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x11,0x3d,0x62, + 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x12,0x3d,0x62, + 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x13,0x3d,0x62, + 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x15,0x3d,0x62, 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x3d,0x62, 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x3d,0x62, 0x02,0x10,0x26,0x02,0xfe,0xc3,0x00,0x02,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x91,0x3d,0x62, @@ -77,6 +82,10 @@ static const uint8_t chainparams_seed_test[] = { 0x02,0x10,0x2a,0x02,0xc2,0x07,0x21,0x10,0x92,0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x64,0x72, 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10,0x64,0x72, 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x64,0x72, + 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x11,0x64,0x72, + 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x12,0x64,0x72, + 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x13,0x64,0x72, + 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x15,0x64,0x72, 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x64,0x72, 0x02,0x10,0x2a,0x10,0x37,0x81,0x05,0x25,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x64,0x72, 0x04,0x20,0x9e,0x5e,0x6c,0xf4,0xe6,0xe8,0xf5,0x7b,0xa1,0xf9,0x36,0x3c,0x5a,0x58,0xea,0x15,0xe8,0xdd,0x02,0x7b,0xce,0xfe,0x11,0x77,0x6a,0xda,0xa2,0x48,0xd9,0xdc,0x19,0xec,0x64,0x72, diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp index d39cf2728b..e809f2492c 100644 --- a/src/consensus/tx_verify.cpp +++ b/src/consensus/tx_verify.cpp @@ -174,9 +174,9 @@ bool Consensus::CheckTxInputs(const CTransaction& tx, TxValidationState& state, strprintf("%s: inputs missing/spent", __func__)); } - // 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 >= TX_MAX_STANDARD_VERSION) + if (!nTimeTx && tx.nVersion >= 2) nTimeTx = GetAdjustedTimeSeconds(); CAmount nValueIn = 0; diff --git a/src/core_read.cpp b/src/core_read.cpp index f8a4c70b6b..16760bbf19 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -221,7 +221,7 @@ bool DecodeHexBlk(CBlock& block, const std::string& strHexBlk) return false; std::vector blockData(ParseHex(strHexBlk)); - DataStream ssBlock(blockData); + CDataStream ssBlock(blockData, SER_NETWORK); try { ssBlock >> TX_WITH_WITNESS(block); } diff --git a/src/core_write.cpp b/src/core_write.cpp index 9aa2430531..34c5b85da8 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -177,7 +177,7 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry // Transaction version is actually unsigned in consensus checks, just signed in memory, // so cast to unsigned before giving it to the user. entry.pushKV("version", static_cast(static_cast(tx.nVersion))); - if (tx.nTime > 0) + if (tx.nVersion < 2) entry.pushKV("time", (int64_t)tx.nTime); entry.pushKV("size", tx.GetTotalSize()); entry.pushKV("vsize", (GetTransactionWeight(tx) + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR); diff --git a/src/external_signer.cpp b/src/external_signer.cpp index 749bb5f74f..5d8cc89d83 100644 --- a/src/external_signer.cpp +++ b/src/external_signer.cpp @@ -73,7 +73,7 @@ UniValue ExternalSigner::GetDescriptors(const int account) bool ExternalSigner::SignTransaction(PartiallySignedTransaction& psbtx, std::string& error) { // Serialize the PSBT - DataStream ssTx{}; + CDataStream ssTx(SER_NETWORK); ssTx << psbtx; // parse ExternalSigner master fingerprint std::vector parsed_m_fingerprint = ParseHex(m_fingerprint); diff --git a/src/hash.h b/src/hash.h index 52babf8b1d..42b395e031 100644 --- a/src/hash.h +++ b/src/hash.h @@ -145,6 +145,24 @@ class HashWriter } }; +// Blackcoin: Keep nType +class CHashWriter : public HashWriter +{ +private: + const int nType; + +public: + CHashWriter() : nType(SER_GETHASH) {} + + int GetType() const { return nType; } + + template + CHashWriter& operator<<(const T& obj) { + ::Serialize(*this, obj); + return (*this); + } +}; + /** Reads data from an underlying stream, while hashing the read data. */ template class HashVerifier : public HashWriter diff --git a/src/index/txindex.cpp b/src/index/txindex.cpp index 4983926e68..5d37fd0d8f 100644 --- a/src/index/txindex.cpp +++ b/src/index/txindex.cpp @@ -79,7 +79,7 @@ bool TxIndex::FindTx(const uint256& tx_hash, uint256& block_hash, CTransactionRe return false; } - AutoFile file{m_chainstate->m_blockman.OpenBlockFile(postx, true)}; + CAutoFile file{m_chainstate->m_blockman.OpenBlockFile(postx, true)}; if (file.IsNull()) { return error("%s: OpenBlockFile failed", __func__); } diff --git a/src/kernel/chain.cpp b/src/kernel/chain.cpp index 1dfc44da11..9488c15923 100644 --- a/src/kernel/chain.cpp +++ b/src/kernel/chain.cpp @@ -21,7 +21,7 @@ interfaces::BlockInfo MakeBlockInfo(const CBlockIndex* index, const CBlock* data LOCK(::cs_main); info.file_number = index->nFile; info.data_pos = index->nDataPos; - info.is_pos = data->IsProofOfStake(); + info.is_pos = index->IsProofOfStake(); } info.data = data; return info; diff --git a/src/kernel/chainparams.cpp b/src/kernel/chainparams.cpp index 2e0ff49cf9..0ea7a0658a 100644 --- a/src/kernel/chainparams.cpp +++ b/src/kernel/chainparams.cpp @@ -87,7 +87,7 @@ class CMainParams : public CChainParams { consensus.signet_blocks = false; consensus.signet_challenge.clear(); consensus.nMaxReorganizationDepth = 500; - consensus.CSVHeight = std::numeric_limits::max(); // std::numeric_limits::max() + consensus.CSVHeight = 4908715; consensus.SegwitHeight = std::numeric_limits::max(); // std::numeric_limits::max() consensus.MinBIP9WarningHeight = std::numeric_limits::max(); // segwit activation height + miner confirmation window consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); @@ -126,8 +126,8 @@ class CMainParams : public CChainParams { consensus.nStakeTimestampMask = 0xf; // 15 consensus.nCoinbaseMaturity = 500; - consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000041a727e67853fa7e907"); // block 4815005 - consensus.defaultAssumeValid = uint256S("0xae0c2a9bd13746e2887ca57bf1046b3c787a5ed1068fd1633a3575f08ee291fc"); // block 4232630 + consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000042bc911cd05857a5b34"); // block 4939111 + consensus.defaultAssumeValid = uint256S("0x6f8e37e21aa2fba3f8e2d6825cb825ca290e9367ed08b8c30943bc16efcba119"); // block 4908715 /** * The message start string is designed to be unlikely to occur in normal data. @@ -178,6 +178,7 @@ class CMainParams : public CChainParams { { 319002, uint256S("0x0011494d03b2cdf1ecfc8b0818f1e0ef7ee1d9e9b3d1279c10d35456bc3899ef")}, // hardfork { 872456, uint256S("0xe4fd321ced1de06213d2e246b150b4bfd8c4aa0989965dce88f2a58668c64860")}, // hardfork {4232630, uint256S("0xae0c2a9bd13746e2887ca57bf1046b3c787a5ed1068fd1633a3575f08ee291fc")}, // Devfund + {4908715, uint256S("0x6f8e37e21aa2fba3f8e2d6825cb825ca290e9367ed08b8c30943bc16efcba119")}, // hardfork } }; @@ -186,10 +187,10 @@ class CMainParams : public CChainParams { }; chainTxData = ChainTxData{ - // Data from RPC: getchaintxstats 40500 bfcda2c7d9301e96c2d5a5c0bfdc373b3f2acf0121bda6259a50bda9a1d6d846 - .nTime = 1698137504, - .nTxCount = 14448831, - .dTxRate = 0.03011670425305156, + // Data from RPC: getchaintxstats 40500 6f8e37e21aa2fba3f8e2d6825cb825ca290e9367ed08b8c30943bc16efcba119 + .nTime = 1713938480, + .nTxCount = 15170003, + .dTxRate = 0.02990868924889543, }; // A vector of p2sh addresses @@ -207,7 +208,7 @@ class CTestNetParams : public CChainParams { consensus.signet_blocks = false; consensus.signet_challenge.clear(); consensus.nMaxReorganizationDepth = 500; - consensus.CSVHeight = std::numeric_limits::max(); // std::numeric_limits::max() + consensus.CSVHeight = 1320664; consensus.SegwitHeight = std::numeric_limits::max(); // std::numeric_limits::max() consensus.MinBIP9WarningHeight = std::numeric_limits::max(); // segwit activation height + miner confirmation window consensus.powLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); @@ -246,7 +247,7 @@ class CTestNetParams : public CChainParams { consensus.nStakeTimestampMask = 0xf; consensus.nCoinbaseMaturity = 10; - consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000487dc03a64106b281b"); // block 1743761 + consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000004efbeeda43294ccd83"); // block 1867048 consensus.defaultAssumeValid = uint256S("0x5d5c42500cc6057533e249ba9eeb9b5e998aff30468c904bc267ec9bccbc8b39"); // block 1415393 pchMessageStart[0] = 0xcd; @@ -286,7 +287,8 @@ class CTestNetParams : public CChainParams { checkpointData = { { { 90235, uint256S("0x567898e79184dc2f7dc3a661f794f28566e4b856d70180914f7371b1b3cc82d8")}, // initial checkpoint - {1415393, uint256S("0x5d5c42500cc6057533e249ba9eeb9b5e998aff30468c904bc267ec9bccbc8b39")}, // remove tx timestamp + {1320664, uint256S("0x64fa6a5414c6797629d34ef150c46486a5e1d49d2bceb87d6da14a501f838afd")}, // hardfork + {1415393, uint256S("0x5d5c42500cc6057533e249ba9eeb9b5e998aff30468c904bc267ec9bccbc8b39")}, // start devfund } }; @@ -295,10 +297,10 @@ class CTestNetParams : public CChainParams { }; chainTxData = ChainTxData{ - // Data from RPC: getchaintxstats 40500 fe0e780eafef658dda6c7b4dfab83781624fd76c702ccee7cccebecb8c77f189 - .nTime = 1698139248, - .nTxCount = 3222151, - .dTxRate = 0.02976566447700859, + // Data from RPC: getchaintxstats 40500 8f2c0be64feb3d84572ec928d8cc55416eb9cd9b811b92fa34602e3543698a0f + .nTime = 1715973760, + .nTxCount = 3752992, + .dTxRate = 0.0297410476168098, }; // A vector of p2sh addresses diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 3999a5d1ea..ef7f92a571 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -3665,7 +3665,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type, return; } - if (nVersion < (Params().GetConsensus().IsProtocolV3_1(GetAdjustedTimeSeconds()) ? OLD_VERSION : MIN_PEER_PROTO_VERSION)) { + if (nVersion < MIN_PEER_PROTO_VERSION) { // disconnect from peers older than this proto version LogPrint(BCLog::NET, "peer=%d using obsolete version %i; disconnecting\n", pfrom.GetId(), nVersion); pfrom.fDisconnect = true; @@ -5768,8 +5768,7 @@ void PeerManagerImpl::MaybeSendFeefilter(CNode& pto, Peer& peer, std::chrono::mi // transactions to us, regardless of feefilter state. if (pto.IsBlockOnlyConn()) return; - unsigned int min_fee = Params().GetConsensus().IsProtocolV3_1(GetAdjustedTimeSeconds()) ? TX_FEE_PER_KB : DEFAULT_MIN_RELAY_TX_FEE; - CAmount currentFilter = CFeeRate(min_fee).GetFeePerK(); + CAmount currentFilter = CFeeRate(TX_FEE_PER_KB).GetFeePerK(); if (m_chainman.IsInitialBlockDownload()) { // Received tx-inv messages are discarded when the active diff --git a/src/netmessagemaker.h b/src/netmessagemaker.h index 6cf1605d85..f82c5df0fc 100644 --- a/src/netmessagemaker.h +++ b/src/netmessagemaker.h @@ -16,7 +16,8 @@ namespace NetMsg { CSerializedNetMsg msg; msg.m_type = std::move(msg_type); // Blackcoin ToDo: revert after nodes upgrade to current version - int32_t serModes = nVersion <= OLD_VERSION ? SER_NETWORK : SER_NETWORK | SER_POSMARKER; + // int32_t serModes = nVersion <= OLD_VERSION ? SER_NETWORK : SER_NETWORK | SER_POSMARKER; + int32_t serModes = SER_NETWORK | SER_POSMARKER; VectorWriter{serModes, msg.data, 0, std::forward(args)...}; return msg; } diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 62ef56be78..c391573ff2 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -644,13 +644,13 @@ FlatFileSeq BlockManager::UndoFileSeq() const AutoFile BlockManager::OpenBlockFile(const FlatFilePos& pos, bool fReadOnly) const { - return AutoFile{BlockFileSeq().Open(pos, fReadOnly)}; + return CAutoFile{BlockFileSeq().Open(pos, fReadOnly)}; } /** Open an undo file (rev?????.dat) */ AutoFile BlockManager::OpenUndoFile(const FlatFilePos& pos, bool fReadOnly) const { - return AutoFile{UndoFileSeq().Open(pos, fReadOnly)}; + return CAutoFile{UndoFileSeq().Open(pos, fReadOnly)}; } fs::path BlockManager::GetBlockPosFilename(const FlatFilePos& pos) const @@ -771,7 +771,7 @@ bool BlockManager::FindUndoPos(BlockValidationState& state, int nFile, FlatFileP bool BlockManager::WriteBlockToDisk(const CBlock& block, FlatFilePos& pos) const { // Open history file to append - AutoFile fileout{OpenBlockFile(pos)}; + CAutoFile fileout{OpenBlockFile(pos)}; if (fileout.IsNull()) { return error("WriteBlockToDisk: OpenBlockFile failed"); } @@ -999,7 +999,7 @@ void ImportBlocks(ChainstateManager& chainman, std::vector vImportFile // -loadblock= for (const fs::path& path : vImportFiles) { - AutoFile file{fsbridge::fopen(path, "rb")}; + CAutoFile file{fsbridge::fopen(path, "rb")}; if (!file.IsNull()) { LogPrintf("Importing blocks file %s...\n", fs::PathToString(path)); chainman.LoadExternalBlockFile(file); diff --git a/src/node/protocol_version.h b/src/node/protocol_version.h index b1977f18f8..d380b3701c 100644 --- a/src/node/protocol_version.h +++ b/src/node/protocol_version.h @@ -18,7 +18,7 @@ static const int OLD_VERSION = 70015; static const int INIT_PROTO_VERSION = 209; //! disconnect from peers older than this proto version -static const int MIN_PEER_PROTO_VERSION = 70012; +static const int MIN_PEER_PROTO_VERSION = 70015; //! BIP 0031, pong message, is enabled for all versions AFTER this one static const int BIP0031_VERSION = 60000; @@ -38,4 +38,4 @@ static const int INVALID_CB_NO_BAN_VERSION = 70015; //! "wtxidrelay" command for wtxid-based relay starts with this version static const int WTXID_RELAY_VERSION = 70017; -#endif // BITCOIN_NODE_PROTOCOL_VERSION_H +#endif // BITCOIN_VERSION_H diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index 3b8dd8eab9..17adc8a143 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -19,7 +19,6 @@ #include