diff --git a/builds/msvc-140/mvsd/mvsd.vcxproj b/builds/msvc-140/mvsd/mvsd.vcxproj index 42c5fa367..849553ae6 100644 --- a/builds/msvc-140/mvsd/mvsd.vcxproj +++ b/builds/msvc-140/mvsd/mvsd.vcxproj @@ -74,7 +74,7 @@ MaxSpeed true true - MINIUPNP_STATICLIB;_MBCS;BC_STATIC;BCB_STATIC;BCC_STATIC;BCK_STATIC;BCD_STATIC;BCX_STATIC;BCT_STATIC;BCN_STATIC;BCP_STATIC;BCS_STATIC;ZMQ_STATIC;_CRT_SUPPRESS_RESTRICT;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + NDEBUG;MINIUPNP_STATICLIB;_MBCS;BC_STATIC;BCB_STATIC;BCC_STATIC;BCK_STATIC;BCD_STATIC;BCX_STATIC;BCT_STATIC;BCN_STATIC;BCP_STATIC;BCS_STATIC;ZMQ_STATIC;_CRT_SUPPRESS_RESTRICT;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true MultiThreaded true diff --git a/builds/msvc-140/network/network.vcxproj b/builds/msvc-140/network/network.vcxproj index c8a050cbd..d8d2a795a 100644 --- a/builds/msvc-140/network/network.vcxproj +++ b/builds/msvc-140/network/network.vcxproj @@ -133,7 +133,7 @@ MaxSpeed true true - USE_UPNP;MINIUPNP_STATICLIB;NDEBUG;_LIB;BC_STATIC;BCT_STATIC;BOOST_ASIO_ENABLE_CANCELIO;_SCL_SECURE_NO_WARNINGS + NDEBUG;USE_UPNP;MINIUPNP_STATICLIB;_LIB;BC_STATIC;BCT_STATIC;BOOST_ASIO_ENABLE_CANCELIO;_SCL_SECURE_NO_WARNINGS true MultiThreaded ..\..\..\..\miniupnp;..\..\..\include;..\..\..\..\boost_1_63_0 diff --git a/src/lib/blockchain/validate_transaction.cpp b/src/lib/blockchain/validate_transaction.cpp index 2fb0ef24a..bd2a21b28 100644 --- a/src/lib/blockchain/validate_transaction.cpp +++ b/src/lib/blockchain/validate_transaction.cpp @@ -1576,8 +1576,11 @@ code validate_transaction::check_transaction_basic() const const auto is_testnet = chain.chain_settings().use_testnet_rules; if (tx.version >= transaction_version::check_output_script) { - for (auto& i : tx.outputs) { - if (i.script.pattern() == chain::script_pattern::non_standard) { + for (size_t i = 0; i < tx.outputs.size(); ++i) { + if (i == 0 && tx.is_coinstake()) { + continue; + } + if (tx.outputs[i].script.pattern() == chain::script_pattern::non_standard) { return error::script_not_standard; } } diff --git a/src/lib/consensus/miner.cpp b/src/lib/consensus/miner.cpp index ce1edb13b..0cadf40e3 100644 --- a/src/lib/consensus/miner.cpp +++ b/src/lib/consensus/miner.cpp @@ -1040,6 +1040,14 @@ miner::block_ptr miner::create_new_block_pos( log::info(LOG_HEADER) << "create a PoS block at height " << block_height << ", header hash is " << encode_hash(pblock->header.hash()); + +#ifdef MVS_DEBUG + for (auto& tx : pblock->transactions) { + log::info(LOG_HEADER) << encode_hash(tx.hash()); + log::info(LOG_HEADER) << tx.to_string(1); + } +#endif + return pblock; } @@ -1160,7 +1168,7 @@ miner::transaction_ptr miner::create_coinstake_tx( { blockchain::block_chain_impl& block_chain = node_.chain_impl(); transaction_ptr coinstake = std::make_shared(); - coinstake->version = chain::transaction_version::first; + coinstake->version = bc::relative_locktime_min_version; bool enable_collect_split = setting_.collect_split_stake; uint64_t nCredit = 0; @@ -1179,9 +1187,10 @@ miner::transaction_ptr miner::create_coinstake_tx( coinstake->outputs.clear(); nCredit = stake.data.value; + auto input_sequence = stake.data.get_lock_sequence(max_input_sequence); // generate inputs - coinstake->inputs.emplace_back(stake.point, stake.data.script, max_input_sequence); + coinstake->inputs.emplace_back(stake.point, stake.data.script, input_sequence); // generate outputs coinstake->outputs.emplace_back(0, chain::script(), ATTACH_NULL_TYPE); @@ -1209,7 +1218,9 @@ miner::transaction_ptr miner::create_coinstake_tx( break; } - coinstake->inputs.emplace_back(stake.point, stake.data.script, max_input_sequence); + auto input_sequence = stake.data.get_lock_sequence(max_input_sequence); + + coinstake->inputs.emplace_back(stake.point, stake.data.script, input_sequence); nCredit += stake.data.value; } }