File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed
src/main/java/org/tron/core/db Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -923,12 +923,10 @@ public synchronized BlockCapsule generateBlock(
923
923
throw new IllegalArgumentException ("generate block timestamp is invalid." );
924
924
}
925
925
926
- long currentTrxSize = 0 ;
927
926
long postponedTrxCount = 0 ;
928
927
929
928
final BlockCapsule blockCapsule =
930
929
new BlockCapsule (number + 1 , preHash , when , witnessCapsule .getAddress ());
931
- currentTrxSize = blockCapsule .getInstance ().getSerializedSize ();
932
930
dialog .reset ();
933
931
dialog .setValue (revokingStore .buildDialog ());
934
932
Iterator iterator = pendingTransactions .iterator ();
@@ -939,9 +937,8 @@ public synchronized BlockCapsule generateBlock(
939
937
logger .debug ("Processing transaction time exceeds the 50% producing time。" );
940
938
break ;
941
939
}
942
- currentTrxSize += trx .getSerializedSize () + 2 ;
943
940
// check the block size
944
- if (currentTrxSize > ChainConstant .BLOCK_SIZE ) {
941
+ if (( blockCapsule . getInstance (). getSerializedSize () + trx . getSerializedSize () + 3 ) > ChainConstant .BLOCK_SIZE ) {
945
942
postponedTrxCount ++;
946
943
continue ;
947
944
}
You can’t perform that action at this time.
0 commit comments