forked from Qortal/qortal
Merge pull request #58 from QuickMythril/536140-fix
Block 536140 fix (same situation as block 535658)
This commit is contained in:
commit
6d1f7b36a7
@ -1100,6 +1100,10 @@ public class Block {
|
|||||||
// Apply fix for block 535658 but fix will be rolled back before we exit method
|
// Apply fix for block 535658 but fix will be rolled back before we exit method
|
||||||
Block535658.processFix(this);
|
Block535658.processFix(this);
|
||||||
}
|
}
|
||||||
|
else if (this.blockData.getHeight() == 536140) {
|
||||||
|
// Apply fix for block 536140 but fix will be rolled back before we exit method
|
||||||
|
Block536140.processFix(this);
|
||||||
|
}
|
||||||
|
|
||||||
for (Transaction transaction : this.getTransactions()) {
|
for (Transaction transaction : this.getTransactions()) {
|
||||||
TransactionData transactionData = transaction.getTransactionData();
|
TransactionData transactionData = transaction.getTransactionData();
|
||||||
|
21
src/main/java/org/qortal/block/Block536140.java
Normal file
21
src/main/java/org/qortal/block/Block536140.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package org.qortal.block;
|
||||||
|
|
||||||
|
import org.qortal.naming.Name;
|
||||||
|
import org.qortal.repository.DataException;
|
||||||
|
|
||||||
|
public final class Block536140 {
|
||||||
|
|
||||||
|
private Block536140() {
|
||||||
|
/* Do not instantiate */
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void processFix(Block block) throws DataException {
|
||||||
|
// Unregister the existing name record if it exists
|
||||||
|
// This ensures that the duplicate name is considered valid, and therefore
|
||||||
|
// the second (i.e. duplicate) REGISTER_NAME transaction data is applied.
|
||||||
|
// Both were issued by the same user account, so there is no conflict.
|
||||||
|
Name name = new Name(block.repository, "Qweb");
|
||||||
|
name.unregister();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user