mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-23 13:24:18 +00:00
Add RequireStandard chain parameter
This commit is contained in:
parent
21913a9ac9
commit
cfeb8235fd
@ -226,6 +226,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual bool AllowMinDifficultyBlocks() const { return true; }
|
virtual bool AllowMinDifficultyBlocks() const { return true; }
|
||||||
|
virtual bool RequireStandard() const { return false; }
|
||||||
virtual Network NetworkID() const { return CChainParams::TESTNET; }
|
virtual Network NetworkID() const { return CChainParams::TESTNET; }
|
||||||
};
|
};
|
||||||
static CTestNetParams testNetParams;
|
static CTestNetParams testNetParams;
|
||||||
@ -262,6 +263,7 @@ public:
|
|||||||
virtual bool MiningRequiresPeers() const { return false; }
|
virtual bool MiningRequiresPeers() const { return false; }
|
||||||
virtual bool MineBlocksOnDemand() const { return true; }
|
virtual bool MineBlocksOnDemand() const { return true; }
|
||||||
virtual bool DefaultCheckMemPool() const { return true; }
|
virtual bool DefaultCheckMemPool() const { return true; }
|
||||||
|
virtual bool RequireStandard() const { return false; }
|
||||||
virtual Network NetworkID() const { return CChainParams::REGTEST; }
|
virtual Network NetworkID() const { return CChainParams::REGTEST; }
|
||||||
};
|
};
|
||||||
static CRegTestParams regTestParams;
|
static CRegTestParams regTestParams;
|
||||||
|
@ -72,6 +72,8 @@ public:
|
|||||||
virtual bool DefaultCheckMemPool() const { return false; }
|
virtual bool DefaultCheckMemPool() const { return false; }
|
||||||
/* Allow mining of a min-difficulty block */
|
/* Allow mining of a min-difficulty block */
|
||||||
virtual bool AllowMinDifficultyBlocks() const { return false; }
|
virtual bool AllowMinDifficultyBlocks() const { return false; }
|
||||||
|
/* Make standard checks */
|
||||||
|
virtual bool RequireStandard() const { return true; }
|
||||||
const string& DataDir() const { return strDataDir; }
|
const string& DataDir() const { return strDataDir; }
|
||||||
/* Make miner stop after a block is found. In RPC, don't return
|
/* Make miner stop after a block is found. In RPC, don't return
|
||||||
* until nGenProcLimit blocks are generated */
|
* until nGenProcLimit blocks are generated */
|
||||||
|
@ -833,7 +833,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
|||||||
|
|
||||||
// Rather not work on nonstandard transactions (unless -testnet/-regtest)
|
// Rather not work on nonstandard transactions (unless -testnet/-regtest)
|
||||||
string reason;
|
string reason;
|
||||||
if (Params().NetworkID() == CChainParams::MAIN && !IsStandardTx(tx, reason))
|
if (Params().RequireStandard() && !IsStandardTx(tx, reason))
|
||||||
return state.DoS(0,
|
return state.DoS(0,
|
||||||
error("AcceptToMemoryPool : nonstandard transaction: %s", reason),
|
error("AcceptToMemoryPool : nonstandard transaction: %s", reason),
|
||||||
REJECT_NONSTANDARD, reason);
|
REJECT_NONSTANDARD, reason);
|
||||||
@ -894,7 +894,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for non-standard pay-to-script-hash in inputs
|
// Check for non-standard pay-to-script-hash in inputs
|
||||||
if (Params().NetworkID() == CChainParams::MAIN && !AreInputsStandard(tx, view))
|
if (Params().RequireStandard() && !AreInputsStandard(tx, view))
|
||||||
return error("AcceptToMemoryPool: : nonstandard transaction input");
|
return error("AcceptToMemoryPool: : nonstandard transaction input");
|
||||||
|
|
||||||
// Note: if you modify this code to accept non-standard transactions, then
|
// Note: if you modify this code to accept non-standard transactions, then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user