Skip to content
Snippets Groups Projects
Commit eab7974d authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] #1332 A full block can be generated with exactly 500 lines while the...

[fix] #1332 A full block can be generated with exactly 500 lines while the network accept at most 499
parent 234946b9
Branches
Tags
No related merge requests found
...@@ -644,7 +644,7 @@ export class BlockGenerator { ...@@ -644,7 +644,7 @@ export class BlockGenerator {
transactions.forEach((tx:any) => { transactions.forEach((tx:any) => {
const txDTO = TransactionDTO.fromJSONObject(tx) const txDTO = TransactionDTO.fromJSONObject(tx)
const txLen = txDTO.getLen() const txLen = txDTO.getLen()
if (txLen <= CommonConstants.MAXIMUM_LEN_OF_COMPACT_TX && blockLen + txLen <= maxLenOfBlock && tx.version == CommonConstants.TRANSACTION_VERSION) { if (txLen <= CommonConstants.MAXIMUM_LEN_OF_COMPACT_TX && blockLen + txLen < maxLenOfBlock && tx.version == CommonConstants.TRANSACTION_VERSION) {
block.transactions.push(txDTO); block.transactions.push(txDTO);
} }
blockLen += txLen; blockLen += txLen;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment