mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 21:17:16 +00:00
784bc9dc85
* Fixes issue #1139 - crash when running chaindata mode * Cleaning up error messages as per feedback
20 lines
573 B
Go
20 lines
573 B
Go
package commands
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/ledgerwatch/turbo-geth/common"
|
|
"github.com/ledgerwatch/turbo-geth/common/hexutil"
|
|
)
|
|
|
|
// SendRawTransaction send a raw transaction
|
|
func (api *APIImpl) SendRawTransaction(_ context.Context, encodedTx hexutil.Bytes) (common.Hash, error) {
|
|
if api.ethBackend == nil {
|
|
// We're running in --chaindata mode or otherwise cannot get the backend
|
|
return common.Hash{}, fmt.Errorf(NotAvailableChainData, "eth_sendRawTransaction")
|
|
}
|
|
res, err := api.ethBackend.AddLocal(encodedTx)
|
|
return common.BytesToHash(res), err
|
|
}
|