mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-20 13:44:31 +00:00
change some log , return error to user
This commit is contained in:
parent
e610298b57
commit
b172dd6d45
1 changed files with 2 additions and 4 deletions
|
|
@ -1209,10 +1209,8 @@ func (args *SendTxArgs) toTransaction() *types.Transaction {
|
|||
// submitTransaction is a helper function that submits tx to txPool and logs a message.
|
||||
func submitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (common.Hash, error) {
|
||||
if tx.To() != nil && tx.To().String() == common.BlockSigners {
|
||||
log.Debug("Dont Allow submitTransaction to BlockSigners through api ", tx.String())
|
||||
return tx.Hash(), nil
|
||||
return common.Hash{}, errors.New("Dont allow transaction sent to BlockSigners smart contract via API")
|
||||
}
|
||||
log.Debug("Allow submitTransaction through api ", tx.String())
|
||||
if err := b.SendTx(ctx, tx); err != nil {
|
||||
return common.Hash{}, err
|
||||
}
|
||||
|
|
@ -1519,4 +1517,4 @@ func (s *PublicNetAPI) PeerCount() hexutil.Uint {
|
|||
// Version returns the current ethereum protocol version.
|
||||
func (s *PublicNetAPI) Version() string {
|
||||
return fmt.Sprintf("%d", s.networkVersion)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue