forked from Qortal/qortal
Remove Block.orphan() forced repository debugging
This commit is contained in:
parent
3afbd7aa51
commit
db73afaf88
@ -1450,39 +1450,34 @@ public class Block {
|
|||||||
public void orphan() throws DataException {
|
public void orphan() throws DataException {
|
||||||
LOGGER.trace(() -> String.format("Orphaning block %d", this.blockData.getHeight()));
|
LOGGER.trace(() -> String.format("Orphaning block %d", this.blockData.getHeight()));
|
||||||
|
|
||||||
this.repository.setDebug(true);
|
// Return AT fees and delete AT states from repository
|
||||||
try {
|
orphanAtFeesAndStates();
|
||||||
// Return AT fees and delete AT states from repository
|
|
||||||
orphanAtFeesAndStates();
|
|
||||||
|
|
||||||
// Orphan, and unlink, transactions from this block
|
// Orphan, and unlink, transactions from this block
|
||||||
orphanTransactionsFromBlock();
|
orphanTransactionsFromBlock();
|
||||||
|
|
||||||
// Undo any group-approval decisions that happen at this block
|
// Undo any group-approval decisions that happen at this block
|
||||||
orphanGroupApprovalTransactions();
|
orphanGroupApprovalTransactions();
|
||||||
|
|
||||||
if (this.blockData.getHeight() > 1) {
|
if (this.blockData.getHeight() > 1) {
|
||||||
// Invalidate expandedAccounts as they may have changed due to orphaning TRANSFER_PRIVS transactions, etc.
|
// Invalidate expandedAccounts as they may have changed due to orphaning TRANSFER_PRIVS transactions, etc.
|
||||||
this.cachedExpandedAccounts = null;
|
this.cachedExpandedAccounts = null;
|
||||||
|
|
||||||
// Deduct any transaction fees from minter/reward-share account(s)
|
// Deduct any transaction fees from minter/reward-share account(s)
|
||||||
deductTransactionFees();
|
deductTransactionFees();
|
||||||
|
|
||||||
// Block rewards removed after transactions undone
|
// Block rewards removed after transactions undone
|
||||||
orphanBlockRewards();
|
orphanBlockRewards();
|
||||||
|
|
||||||
// Decrease account levels
|
// Decrease account levels
|
||||||
decreaseAccountLevels();
|
decreaseAccountLevels();
|
||||||
}
|
|
||||||
|
|
||||||
// Delete block from blockchain
|
|
||||||
this.repository.getBlockRepository().delete(this.blockData);
|
|
||||||
this.blockData.setHeight(null);
|
|
||||||
|
|
||||||
postBlockTidy();
|
|
||||||
} finally {
|
|
||||||
this.repository.setDebug(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete block from blockchain
|
||||||
|
this.repository.getBlockRepository().delete(this.blockData);
|
||||||
|
this.blockData.setHeight(null);
|
||||||
|
|
||||||
|
postBlockTidy();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void orphanTransactionsFromBlock() throws DataException {
|
protected void orphanTransactionsFromBlock() throws DataException {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user