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(
923923 throw new IllegalArgumentException ("generate block timestamp is invalid." );
924924 }
925925
926- long currentTrxSize = 0 ;
927926 long postponedTrxCount = 0 ;
928927
929928 final BlockCapsule blockCapsule =
930929 new BlockCapsule (number + 1 , preHash , when , witnessCapsule .getAddress ());
931- currentTrxSize = blockCapsule .getInstance ().getSerializedSize ();
932930 dialog .reset ();
933931 dialog .setValue (revokingStore .buildDialog ());
934932 Iterator iterator = pendingTransactions .iterator ();
@@ -939,9 +937,8 @@ public synchronized BlockCapsule generateBlock(
939937 logger .debug ("Processing transaction time exceeds the 50% producing time。" );
940938 break ;
941939 }
942- currentTrxSize += trx .getSerializedSize () + 2 ;
943940 // check the block size
944- if (currentTrxSize > ChainConstant .BLOCK_SIZE ) {
941+ if (( blockCapsule . getInstance (). getSerializedSize () + trx . getSerializedSize () + 3 ) > ChainConstant .BLOCK_SIZE ) {
945942 postponedTrxCount ++;
946943 continue ;
947944 }
You can’t perform that action at this time.
0 commit comments