mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Forbid version=0 in special TXs (#2473)
This commit is contained in:
parent
85157f9a9e
commit
5ffc31bce4
@ -766,7 +766,7 @@ class DIP3Test(BitcoinTestFramework):
|
||||
|
||||
# We can't really use this one as it would result in invalid merkle roots for masternode lists
|
||||
if len(bt['coinbase_payload']) != 0:
|
||||
cbtx = FromHex(CCbTx(), bt['coinbase_payload'])
|
||||
cbtx = FromHex(CCbTx(version=1), bt['coinbase_payload'])
|
||||
if use_mnmerkleroot_from_tip:
|
||||
if 'cbTx' in tip_block:
|
||||
cbtx.merkleRootMNList = int(tip_block['cbTx']['merkleRootMNList'], 16)
|
||||
|
@ -25,7 +25,7 @@ bool CheckCbTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValidatio
|
||||
return state.DoS(100, false, REJECT_INVALID, "bad-cbtx-payload");
|
||||
}
|
||||
|
||||
if (cbTx.nVersion > CCbTx::CURRENT_VERSION) {
|
||||
if (cbTx.nVersion == 0 || cbTx.nVersion > CCbTx::CURRENT_VERSION) {
|
||||
return state.DoS(100, false, REJECT_INVALID, "bad-cbtx-version");
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ bool CheckProRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValid
|
||||
return state.DoS(100, false, REJECT_INVALID, "bad-protx-payload");
|
||||
}
|
||||
|
||||
if (ptx.nVersion > CProRegTx::CURRENT_VERSION) {
|
||||
if (ptx.nVersion == 0 || ptx.nVersion > CProRegTx::CURRENT_VERSION) {
|
||||
return state.DoS(100, false, REJECT_INVALID, "bad-protx-version");
|
||||
}
|
||||
if (ptx.nType != 0) {
|
||||
@ -214,7 +214,7 @@ bool CheckProUpServTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVa
|
||||
return state.DoS(100, false, REJECT_INVALID, "bad-protx-payload");
|
||||
}
|
||||
|
||||
if (ptx.nVersion > CProRegTx::CURRENT_VERSION) {
|
||||
if (ptx.nVersion == 0 || ptx.nVersion > CProRegTx::CURRENT_VERSION) {
|
||||
return state.DoS(100, false, REJECT_INVALID, "bad-protx-version");
|
||||
}
|
||||
|
||||
@ -267,7 +267,7 @@ bool CheckProUpRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal
|
||||
return state.DoS(100, false, REJECT_INVALID, "bad-protx-payload");
|
||||
}
|
||||
|
||||
if (ptx.nVersion > CProRegTx::CURRENT_VERSION) {
|
||||
if (ptx.nVersion == 0 || ptx.nVersion > CProRegTx::CURRENT_VERSION) {
|
||||
return state.DoS(100, false, REJECT_INVALID, "bad-protx-version");
|
||||
}
|
||||
if (ptx.nMode != 0) {
|
||||
@ -349,7 +349,7 @@ bool CheckProUpRevTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal
|
||||
return state.DoS(100, false, REJECT_INVALID, "bad-protx-payload");
|
||||
}
|
||||
|
||||
if (ptx.nVersion > CProRegTx::CURRENT_VERSION) {
|
||||
if (ptx.nVersion == 0 || ptx.nVersion > CProRegTx::CURRENT_VERSION) {
|
||||
return state.DoS(100, false, REJECT_INVALID, "bad-protx-version");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user