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

It should be registered instantly instead of time.sleep #306

Closed
cnlangzi opened this issue Aug 16, 2021 · 0 comments · Fixed by #305
Closed

It should be registered instantly instead of time.sleep #306

cnlangzi opened this issue Aug 16, 2021 · 0 comments · Fixed by #305
Assignees
Labels
bug Something isn't working

Comments

@cnlangzi
Copy link
Contributor

cnlangzi commented Aug 16, 2021

time.Sleep(transaction.SLEEP_FOR_TXN_CONFIRMATION * time.Second)

// Add or update blobber on blockchain
func BlobberAdd(ctx context.Context) (string, error) {
	time.Sleep(transaction.SLEEP_FOR_TXN_CONFIRMATION * time.Second)

	// initialize storage node (ie blobber)
	txn, err := transaction.NewTransactionEntity()
	if err != nil {
		return "", err
	}

}

Because it is registered only on blobber startup.

time.Sleep(transaction.SLEEP_FOR_TXN_CONFIRMATION * time.Second)

func TransactionVerify(txnHash string) (t *transaction.Transaction, err error) {
	time.Sleep(transaction.SLEEP_FOR_TXN_CONFIRMATION * time.Second) //it should be removed too.

	for i := 0; i < util.MAX_RETRIES; i++ {
		time.Sleep(transaction.SLEEP_FOR_TXN_CONFIRMATION * time.Second) //it is enough for waiting
		if t, err = transaction.VerifyTransaction(txnHash, chain.GetServerChain()); err == nil {
			return t, nil
		}
	}

	return
}
@cnlangzi cnlangzi added the bug Something isn't working label Aug 16, 2021
@cnlangzi cnlangzi self-assigned this Aug 16, 2021
@cnlangzi cnlangzi changed the title It should be registered instantly instead sleep It should be registered instantly instead of time.sleep Aug 16, 2021
@cnlangzi cnlangzi linked a pull request Aug 16, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant