Skip to content
Snippets Groups Projects
Commit 07adef4e 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 (cherry-picked from 1.7 branch)
parent f9102552
Branches
Tags
No related merge requests found
...@@ -653,7 +653,7 @@ export class BlockGenerator { ...@@ -653,7 +653,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 to comment