File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/main/java/org/tron/core/net/message Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 88public class TransactionMessage extends TronMessage {
99
1010 private Transaction trx ;
11+ private TransactionCapsule transactionCapsule ;
1112
1213 public TransactionMessage (byte [] data ) throws Exception {
1314 this .type = MessageTypes .TRX .asByte ();
1415 this .data = data ;
1516 this .trx = Protocol .Transaction .parseFrom (data );
17+ this .transactionCapsule = new TransactionCapsule (this .trx );
1618 }
1719
1820 public TransactionMessage (Transaction trx ) {
1921 this .trx = trx ;
22+ this .transactionCapsule = new TransactionCapsule (this .trx );
2023 this .type = MessageTypes .TRX .asByte ();
2124 this .data = trx .toByteArray ();
2225 }
2326
24- @ Override
25- public Sha256Hash getMessageId () {
26- return getTransactionCapsule ().getTransactionId ();
27- }
28-
2927 @ Override
3028 public String toString () {
3129 return new StringBuilder ().append (super .toString ())
3230 .append ("messageId: " ).append (super .getMessageId ()).toString ();
3331 }
3432
33+ @ Override
34+ public Sha256Hash getMessageId () {
35+ return this .transactionCapsule .getTransactionId ();
36+ }
37+
3538 @ Override
3639 public Class <?> getAnswerMessage () {
3740 return null ;
@@ -42,7 +45,7 @@ public Transaction getTransaction() {
4245 }
4346
4447 public TransactionCapsule getTransactionCapsule () {
45- return new TransactionCapsule ( getTransaction ()) ;
48+ return this . transactionCapsule ;
4649 }
4750
4851}
You can’t perform that action at this time.
0 commit comments