4343import org .tron .core .capsule .WitnessCapsule ;
4444import org .tron .core .db .AccountStore ;
4545import org .tron .core .db .Manager ;
46- import org .tron .core .exception .ContractExeException ;
47- import org .tron .core .exception .ContractValidateException ;
48- import org .tron .core .exception .DupTransactionException ;
49- import org .tron .core .exception .StoreException ;
50- import org .tron .core .exception .TaposException ;
51- import org .tron .core .exception .ValidateBandwidthException ;
52- import org .tron .core .exception .ValidateSignatureException ;
46+ import org .tron .core .exception .*;
5347import org .tron .core .net .message .TransactionMessage ;
5448import org .tron .core .net .node .NodeImpl ;
5549import org .tron .protos .Contract .AccountCreateContract ;
@@ -209,6 +203,9 @@ public boolean broadcastTransaction(Transaction signaturedTransaction) {
209203 TransactionCapsule trx = new TransactionCapsule (signaturedTransaction );
210204 try {
211205 Message message = new TransactionMessage (signaturedTransaction );
206+ if (message .getData ().length > Constant .TRANSACTION_MAX_BYTE_SIZE ) {
207+ throw new TooBigTransactionException ("too big transaction, the size is " + message .getData ().length + " bytes" );
208+ }
212209 dbManager .pushTransactions (trx );
213210 p2pNode .broadcast (message );
214211 return true ;
@@ -223,8 +220,10 @@ public boolean broadcastTransaction(Transaction signaturedTransaction) {
223220 } catch (DupTransactionException e ) {
224221 logger .error ("dup trans" , e );
225222 } catch (TaposException e ) {
226- logger .error ("tapos error" , e );
227- }catch (Exception e ){
223+ logger .debug ("tapos error" , e );
224+ } catch (TooBigTransactionException e ) {
225+ logger .debug ("transaction error" , e );
226+ } catch (Exception e ){
228227 logger .error ("exception caught" , e );
229228 }
230229 return false ;
@@ -344,12 +343,12 @@ public Block getBlockById(ByteString BlockId) {
344343 if (Objects .isNull (BlockId )) {
345344 return null ;
346345 }
347- Block blocke = null ;
346+ Block block = null ;
348347 try {
349- blocke = dbManager .getBlockStore ().get (BlockId .toByteArray ()).getInstance ();
348+ block = dbManager .getBlockStore ().get (BlockId .toByteArray ()).getInstance ();
350349 } catch (StoreException e ) {
351350 }
352- return blocke ;
351+ return block ;
353352 }
354353
355354 public BlockList getBlocksByLimitNext (long number , long limit ) {
0 commit comments