mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 05:23:01 +01:00
Put OP_EVAL string in coinbase of generated blocks
This commit is contained in:
parent
e679ec969c
commit
d7062ef1bd
10
src/base58.h
10
src/base58.h
@ -270,7 +270,7 @@ public:
|
|||||||
|
|
||||||
bool SetScriptHash160(const uint160& hash160)
|
bool SetScriptHash160(const uint160& hash160)
|
||||||
{
|
{
|
||||||
SetData(fTestNet ? 112 : 1, &hash160, 20);
|
SetData(fTestNet ? 111^2 : 2, &hash160, 20);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ public:
|
|||||||
nExpectedSize = 20; // Hash of public key
|
nExpectedSize = 20; // Hash of public key
|
||||||
fExpectTestNet = false;
|
fExpectTestNet = false;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 2:
|
||||||
nExpectedSize = 20; // OP_EVAL, hash of CScript
|
nExpectedSize = 20; // OP_EVAL, hash of CScript
|
||||||
fExpectTestNet = false;
|
fExpectTestNet = false;
|
||||||
break;
|
break;
|
||||||
@ -293,7 +293,7 @@ public:
|
|||||||
nExpectedSize = 20;
|
nExpectedSize = 20;
|
||||||
fExpectTestNet = true;
|
fExpectTestNet = true;
|
||||||
break;
|
break;
|
||||||
case 112:
|
case 111^2:
|
||||||
nExpectedSize = 20;
|
nExpectedSize = 20;
|
||||||
fExpectTestNet = true;
|
fExpectTestNet = true;
|
||||||
break;
|
break;
|
||||||
@ -308,8 +308,8 @@ public:
|
|||||||
if (!IsValid())
|
if (!IsValid())
|
||||||
return false;
|
return false;
|
||||||
if (fTestNet)
|
if (fTestNet)
|
||||||
return nVersion == 112;
|
return nVersion == 111^2;
|
||||||
return nVersion == 1;
|
return nVersion == 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CBitcoinAddress()
|
CBitcoinAddress()
|
||||||
|
@ -2999,6 +2999,13 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int&
|
|||||||
}
|
}
|
||||||
++nExtraNonce;
|
++nExtraNonce;
|
||||||
pblock->vtx[0].vin[0].scriptSig = CScript() << pblock->nTime << CBigNum(nExtraNonce);
|
pblock->vtx[0].vin[0].scriptSig = CScript() << pblock->nTime << CBigNum(nExtraNonce);
|
||||||
|
|
||||||
|
// Put "OP_EVAL" in the coinbase so everybody can tell when
|
||||||
|
// a majority of miners support it
|
||||||
|
const char* pOpEvalName = GetOpName(OP_EVAL);
|
||||||
|
pblock->vtx[0].vin[0].scriptSig += CScript() << std::vector<unsigned char>(pOpEvalName, pOpEvalName+strlen(pOpEvalName));
|
||||||
|
assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100);
|
||||||
|
|
||||||
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
|
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user