mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
fix: Allow triggers with p2sh after DIP0024 (#4973)
This commit is contained in:
parent
8773a21b30
commit
af085cd528
@ -527,6 +527,9 @@ void CSuperblock::ParsePaymentSchedule(const std::string& strPaymentAddresses, c
|
||||
AMOUNTS = [AMOUNT1|2|3|4|5|6]
|
||||
*/
|
||||
|
||||
// TODO: script addresses limit here and cs_main lock in
|
||||
// CGovernanceManager::InitOnLoad()once DIP0024 is active
|
||||
bool fAllowScript = (VersionBitsTipState(Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0024) == ThresholdState::ACTIVE);
|
||||
for (int i = 0; i < (int)vecParsed1.size(); i++) {
|
||||
CTxDestination dest = DecodeDestination(vecParsed1[i]);
|
||||
if (!IsValidDestination(dest)) {
|
||||
@ -535,18 +538,15 @@ void CSuperblock::ParsePaymentSchedule(const std::string& strPaymentAddresses, c
|
||||
LogPrintf("%s\n", ostr.str());
|
||||
throw std::runtime_error(ostr.str());
|
||||
}
|
||||
/*
|
||||
TODO
|
||||
|
||||
- There might be an issue with multisig in the coinbase on mainnet, we will add support for it in a future release.
|
||||
- Post 12.3+ (test multisig coinbase transaction)
|
||||
*/
|
||||
const CScriptID *scriptID = boost::get<CScriptID>(&dest);
|
||||
if (scriptID) {
|
||||
std::ostringstream ostr;
|
||||
ostr << "CSuperblock::ParsePaymentSchedule -- Script addresses are not supported yet : " << vecParsed1[i];
|
||||
LogPrintf("%s\n", ostr.str());
|
||||
throw std::runtime_error(ostr.str());
|
||||
if (!fAllowScript) {
|
||||
const CScriptID *scriptID = boost::get<CScriptID>(&dest);
|
||||
if (scriptID) {
|
||||
std::ostringstream ostr;
|
||||
ostr << "CSuperblock::ParsePaymentSchedule -- Script addresses are not supported yet : " << vecParsed1[i];
|
||||
LogPrintf("%s\n", ostr.str());
|
||||
throw std::runtime_error(ostr.str());
|
||||
}
|
||||
}
|
||||
|
||||
CAmount nAmount = ParsePaymentAmount(vecParsed2[i]);
|
||||
|
@ -1098,7 +1098,9 @@ void CGovernanceManager::AddCachedTriggers()
|
||||
|
||||
void CGovernanceManager::InitOnLoad()
|
||||
{
|
||||
LOCK(cs);
|
||||
// TODO: drop cs_main here and script addresses limit in
|
||||
// CSuperblock::ParsePaymentSchedule() once DIP0024 is active
|
||||
LOCK2(cs_main, cs);
|
||||
int64_t nStart = GetTimeMillis();
|
||||
LogPrintf("Preparing masternode indexes and governance triggers...\n");
|
||||
RebuildIndexes();
|
||||
|
Loading…
Reference in New Issue
Block a user