Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert mint retry #85

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions bsc/bridges/stellar/api/bridge/stellar.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (w *stellarWallet) CreateAndSubmitPayment(ctx context.Context, target strin
// mint handler
type mint func(ERC20Address, *big.Int, string) error

//MonitorBridgeAccountAndMint is a blocking function that keeps monitoring
// MonitorBridgeAccountAndMint is a blocking function that keeps monitoring
// the bridge account on the Stellar network for new transactions and calls the
// mint function when a deposit is made
func (w *stellarWallet) MonitorBridgeAccountAndMint(ctx context.Context, mintFn mint, persistency *ChainPersistency) error {
Expand Down Expand Up @@ -222,17 +222,12 @@ func (w *stellarWallet) MonitorBridgeAccountAndMint(ctx context.Context, mintFn
depositedAmount := big.NewInt(int64(parsedAmount))

err = mintFn(ethAddress, depositedAmount, tx.Hash)
for err != nil {
if err != nil {
log.Error(fmt.Sprintf("Error occured while minting: %s", err.Error()))
select {
case <-ctx.Done():
return
case <-time.After(10 * time.Second):
err = mintFn(ethAddress, depositedAmount, tx.Hash)
}
return
}
log.Info("Mint succesfull, saving cursor")

log.Info("Mint succesfull, saving cursor")
// save cursor
cursor := tx.PagingToken()
err = persistency.saveStellarCursor(cursor)
Expand Down