mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Add signblockscript argument to employ signed blocks
This commit is contained in:
parent
d8f9470fe2
commit
cb5571f1e4
5 changed files with 11 additions and 4 deletions
|
|
@ -436,9 +436,10 @@ class CCustomParams : public CRegTestParams {
|
|||
std::vector<unsigned char> man_bytes = ParseHex(gArgs.GetArg("-con_mandatorycoinbase", ""));
|
||||
consensus.mandatory_coinbase_destination = CScript(man_bytes.begin(), man_bytes.end()); // Blank script allows any coinbase destination
|
||||
|
||||
// Block signing encumberance script
|
||||
std::vector<unsigned char> sign_bytes = ParseHex(gArgs.GetArg("-signblockscript", ""));
|
||||
// Block signing encumberance script, default of 51 aka OP_TRUE
|
||||
std::vector<unsigned char> sign_bytes = ParseHex(gArgs.GetArg("-signblockscript", "51"));
|
||||
consensus.signblockscript = CScript(sign_bytes.begin(), sign_bytes.end());
|
||||
g_signed_blocks = !sign_bytes.empty();
|
||||
|
||||
// Custom chains connect coinbase outputs to db by default
|
||||
consensus.connect_genesis_outputs = gArgs.GetArg("-con_connect_coinbase", true);
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ struct Params {
|
|||
CAmount genesis_subsidy;
|
||||
bool connect_genesis_outputs;
|
||||
CScript signblockscript;
|
||||
// g_signed_blocks - Whether blocks are signed or not, get around circular dep
|
||||
};
|
||||
} // namespace Consensus
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
#include <utilstrencodings.h>
|
||||
#include <crypto/common.h>
|
||||
|
||||
bool g_signed_blocks = false;
|
||||
|
||||
std::string CProof::ToString() const
|
||||
{
|
||||
return strprintf("CProof(challenge=%s, solution=%s)",
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
#include <serialize.h>
|
||||
#include <uint256.h>
|
||||
|
||||
extern bool g_signed_blocks;
|
||||
|
||||
class CProof
|
||||
{
|
||||
public:
|
||||
|
|
@ -79,7 +81,7 @@ public:
|
|||
READWRITE(hashPrevBlock);
|
||||
READWRITE(hashMerkleRoot);
|
||||
READWRITE(nTime);
|
||||
if (false) {
|
||||
if (g_signed_blocks) {
|
||||
READWRITE(proof);
|
||||
} else {
|
||||
READWRITE(nBits);
|
||||
|
|
@ -100,7 +102,7 @@ public:
|
|||
|
||||
bool IsNull() const
|
||||
{
|
||||
if (false) {
|
||||
if (g_signed_blocks) {
|
||||
return proof.IsNull();
|
||||
} else {
|
||||
return (nBits == 0);
|
||||
|
|
|
|||
|
|
@ -307,6 +307,7 @@ def initialize_datadir(dirname, n, chain):
|
|||
f.write("printtoconsole=0\n")
|
||||
f.write("con_blocksubsidy=5000000000\n")
|
||||
f.write("con_connect_coinbase=0\n")
|
||||
f.write("signblockscript=0\n")
|
||||
os.makedirs(os.path.join(datadir, 'stderr'), exist_ok=True)
|
||||
os.makedirs(os.path.join(datadir, 'stdout'), exist_ok=True)
|
||||
return datadir
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue