Skip to content

Commit deb3cad

Browse files
authored
Merge pull request #83 from 2acoin/v7-logic
Modify logic for V7 variant
2 parents 823bde5 + 1883f94 commit deb3cad

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

extensions/bytecoin-v2/cryptonight-v7.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"parameters": {
113113
"text": [
114114
" uint32_t cn_variant = 0;",
115-
" if (m_POWCryptoNightV7BlockIndex >= block.getBlockIndex() && m_POWCryptoNightV7LastBlock <= block.getBlockIndex())",
115+
" if (m_POWCryptoNightV7BlockIndex && m_POWCryptoNightV7BlockIndex <= block.getBlockIndex() && (m_POWCryptoNightV7LastBlock == 0 || m_POWCryptoNightV7LastBlock >= block.getBlockIndex()))",
116116
" cn_variant = 1;",
117117
" return check_hash(block.getBlockLongHash(context, cn_variant), currentDifficulty);"
118118
]
@@ -124,7 +124,7 @@
124124
"parameters": {
125125
"text": [
126126
" uint32_t cn_variant = 0;",
127-
" if (m_POWCryptoNightV7BlockIndex >= cachedBlock.getBlockIndex() && m_POWCryptoNightV7LastBlock <= cachedBlock.getBlockIndex())",
127+
" if (m_POWCryptoNightV7BlockIndex && m_POWCryptoNightV7BlockIndex <= cachedBlock.getBlockIndex() && (m_POWCryptoNightV7LastBlock == 0 || m_POWCryptoNightV7LastBlock >= cachedBlock.getBlockIndex()))",
128128
" cn_variant = 1;",
129129
" if (!check_hash(cachedBlock.getBlockLongHash(context, cn_variant), currentDifficulty)) {"
130130
]
@@ -141,7 +141,7 @@
141141
"parameters": {
142142
"text": [
143143
" uint32_t cn_variant = 0;",
144-
" if (m_currency.POWCryptoNightV7BlockIndex() >= cb.getBlockIndex() && m_currency.POWCryptoNightV7LastBlock() <= cb.getBlockIndex())",
144+
" if (m_currency.POWCryptoNightV7BlockIndex() && m_currency.POWCryptoNightV7BlockIndex() <= cb.getBlockIndex() && (m_currency.POWCryptoNightV7LastBlock() == 0 || m_currency.POWCryptoNightV7LastBlock() >= cb.getBlockIndex()))",
145145
" cn_variant = 1;"
146146
]
147147
}
@@ -161,7 +161,7 @@
161161
"parameters": {
162162
"text": [
163163
" uint32_t cn_variant = 0;",
164-
"// if (m_currency.POWCryptoNightV7BlockIndex() >= cb.getBlockIndex() && m_currency.POWCryptoNightV7LastBlock() <= cb.getBlockIndex())",
164+
"// if (m_currency.POWCryptoNightV7BlockIndex() && m_currency.POWCryptoNightV7BlockIndex() <= cb.getBlockIndex() && (m_currency.POWCryptoNightV7LastBlock() == 0 || m_currency.POWCryptoNightV7LastBlock() >= cb.getBlockIndex()))",
165165
"// cn_variant = 1;"
166166
]
167167
}
@@ -172,7 +172,7 @@
172172
"parameters": {
173173
"text": [
174174
" uint32_t cn_variant = 0;",
175-
"// if (m_currency.POWCryptoNightV7BlockIndex() >= cb.getBlockIndex() && m_currency.POWCryptoNightV7LastBlock() <= cb.getBlockIndex())",
175+
"// if (m_currency.POWCryptoNightV7BlockIndex() && m_currency.POWCryptoNightV7BlockIndex() <= cb.getBlockIndex() && (m_currency.POWCryptoNightV7LastBlock() == 0 || m_currency.POWCryptoNightV7LastBlock() >= cb.getBlockIndex()))",
176176
"// cn_variant = 1;"
177177
]
178178
}

0 commit comments

Comments
 (0)