@@ -1081,7 +1081,10 @@ func submitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (c
1081
1081
}
1082
1082
if tx .To () == nil {
1083
1083
signer := types .MakeSigner (b .ChainConfig (), b .CurrentBlock ().Number ())
1084
- from , _ := types .Sender (signer , tx )
1084
+ from , err := types .Sender (signer , tx )
1085
+ if err != nil {
1086
+ return common.Hash {}, err
1087
+ }
1085
1088
addr := crypto .CreateAddress (from , tx .Nonce ())
1086
1089
log .Info ("Submitted contract creation" , "fullhash" , tx .Hash ().Hex (), "contract" , addr .Hex ())
1087
1090
} else {
@@ -1129,29 +1132,12 @@ func (s *PublicTransactionPoolAPI) SendTransaction(ctx context.Context, args Sen
1129
1132
1130
1133
// SendRawTransaction will add the signed transaction to the transaction pool.
1131
1134
// The sender is responsible for signing the transaction and using the correct nonce.
1132
- func (s * PublicTransactionPoolAPI ) SendRawTransaction (ctx context.Context , encodedTx hexutil.Bytes ) (string , error ) {
1135
+ func (s * PublicTransactionPoolAPI ) SendRawTransaction (ctx context.Context , encodedTx hexutil.Bytes ) (common. Hash , error ) {
1133
1136
tx := new (types.Transaction )
1134
1137
if err := rlp .DecodeBytes (encodedTx , tx ); err != nil {
1135
- return "" , err
1136
- }
1137
-
1138
- if err := s .b .SendTx (ctx , tx ); err != nil {
1139
- return "" , err
1140
- }
1141
-
1142
- signer := types .MakeSigner (s .b .ChainConfig (), s .b .CurrentBlock ().Number ())
1143
- if tx .To () == nil {
1144
- from , err := types .Sender (signer , tx )
1145
- if err != nil {
1146
- return "" , err
1147
- }
1148
- addr := crypto .CreateAddress (from , tx .Nonce ())
1149
- log .Info ("Submitted contract creation" , "fullhash" , tx .Hash ().Hex (), "contract" , addr .Hex ())
1150
- } else {
1151
- log .Info ("Submitted transaction" , "fullhash" , tx .Hash ().Hex (), "recipient" , tx .To ())
1138
+ return common.Hash {}, err
1152
1139
}
1153
-
1154
- return tx .Hash ().Hex (), nil
1140
+ return submitTransaction (ctx , s .b , tx )
1155
1141
}
1156
1142
1157
1143
// Sign calculates an ECDSA signature for:
0 commit comments