Skip to content

Commit

Permalink
Remove panic - 4
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya1702 committed Jan 12, 2024
1 parent 868de89 commit 7b8b60f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/soroban-rpc/internal/methods/send_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type SendTransactionRequest struct {
// LatestLedgerStore is a store which returns the latest ingested ledger.
type LatestLedgerStore interface {
// GetLatestLedger returns the latest ingested ledger.
GetLatestLedger() transactions.LedgerInfo
GetLatestLedger() (transactions.LedgerInfo, error)
}

// NewSendTransactionHandler returns a submit transaction json rpc handler
Expand All @@ -74,7 +74,11 @@ func NewSendTransactionHandler(daemon interfaces.Daemon, logger *log.Entry, stor
}
txHash := hex.EncodeToString(hash[:])

ledgerInfo := store.GetLatestLedger()
ledgerInfo, err := store.GetLatestLedger()
if err != nil {
return SendTransactionResponse{}, err
}

resp, err := submitter.SubmitTransaction(ctx, request.Transaction)
if err != nil {
logger.WithError(err).
Expand Down

0 comments on commit 7b8b60f

Please sign in to comment.