forked from Qortal/qortal
Merge branch 'Qortal:master' into master
This commit is contained in:
commit
e7901a391f
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.qortal</groupId>
|
<groupId>org.qortal</groupId>
|
||||||
<artifactId>qortal</artifactId>
|
<artifactId>qortal</artifactId>
|
||||||
<version>4.2.1</version>
|
<version>4.2.2</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<properties>
|
<properties>
|
||||||
<skipTests>true</skipTests>
|
<skipTests>true</skipTests>
|
||||||
|
@ -380,9 +380,13 @@ public class BlockMinter extends Thread {
|
|||||||
parentSignatureForLastLowWeightBlock = null;
|
parentSignatureForLastLowWeightBlock = null;
|
||||||
timeOfLastLowWeightBlock = null;
|
timeOfLastLowWeightBlock = null;
|
||||||
|
|
||||||
|
Long unconfirmedStartTime = NTP.getTime();
|
||||||
|
|
||||||
// Add unconfirmed transactions
|
// Add unconfirmed transactions
|
||||||
addUnconfirmedTransactions(repository, newBlock);
|
addUnconfirmedTransactions(repository, newBlock);
|
||||||
|
|
||||||
|
LOGGER.info(String.format("Adding %d unconfirmed transactions took %d ms", newBlock.getTransactions().size(), (NTP.getTime()-unconfirmedStartTime)));
|
||||||
|
|
||||||
// Sign to create block's signature
|
// Sign to create block's signature
|
||||||
newBlock.sign();
|
newBlock.sign();
|
||||||
|
|
||||||
@ -484,6 +488,9 @@ public class BlockMinter extends Thread {
|
|||||||
// Sign to create block's signature, needed by Block.isValid()
|
// Sign to create block's signature, needed by Block.isValid()
|
||||||
newBlock.sign();
|
newBlock.sign();
|
||||||
|
|
||||||
|
// User-defined limit per block
|
||||||
|
int limit = Settings.getInstance().getMaxTransactionsPerBlock();
|
||||||
|
|
||||||
// Attempt to add transactions until block is full, or we run out
|
// Attempt to add transactions until block is full, or we run out
|
||||||
// If a transaction makes the block invalid then skip it and it'll either expire or be in next block.
|
// If a transaction makes the block invalid then skip it and it'll either expire or be in next block.
|
||||||
for (TransactionData transactionData : unconfirmedTransactions) {
|
for (TransactionData transactionData : unconfirmedTransactions) {
|
||||||
@ -496,6 +503,12 @@ public class BlockMinter extends Thread {
|
|||||||
LOGGER.debug(() -> String.format("Skipping invalid transaction %s during block minting", Base58.encode(transactionData.getSignature())));
|
LOGGER.debug(() -> String.format("Skipping invalid transaction %s during block minting", Base58.encode(transactionData.getSignature())));
|
||||||
newBlock.deleteTransaction(transactionData);
|
newBlock.deleteTransaction(transactionData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// User-defined limit per block
|
||||||
|
List<Transaction> transactions = newBlock.getTransactions();
|
||||||
|
if (transactions != null && transactions.size() >= limit) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -641,8 +641,7 @@ public abstract class Transaction {
|
|||||||
BlockData latestBlockData = repository.getBlockRepository().getLastBlock();
|
BlockData latestBlockData = repository.getBlockRepository().getLastBlock();
|
||||||
|
|
||||||
EnumSet<TransactionType> excludedTxTypes = EnumSet.of(TransactionType.CHAT, TransactionType.PRESENCE);
|
EnumSet<TransactionType> excludedTxTypes = EnumSet.of(TransactionType.CHAT, TransactionType.PRESENCE);
|
||||||
int limit = Settings.getInstance().getMaxTransactionsPerBlock();
|
List<TransactionData> unconfirmedTransactions = repository.getTransactionRepository().getUnconfirmedTransactions(excludedTxTypes, null);
|
||||||
List<TransactionData> unconfirmedTransactions = repository.getTransactionRepository().getUnconfirmedTransactions(excludedTxTypes, limit);
|
|
||||||
|
|
||||||
unconfirmedTransactions.sort(getDataComparator());
|
unconfirmedTransactions.sort(getDataComparator());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user