Jump to content
McKay Development

acceptConfirmationForObject rate limiting.


Op1x3r

Recommended Posts

After doing offer.send(), I use this function

setTimeout(confirm2FA, 5000, offer.id, 0);
function confirm2FA(offerID,tries) {
    return new Promise((resolve, reject) => {
        community.acceptConfirmationForObject(config.coinflip.identitySecret, offerID, (err) => {
            if (err)
            {
                if(tries < 2) {
                    tries++;
                    setTimeout(confirm2FA, 25000, offerID, tries);
                    reject('Offer confirmation 2FA: ' + err);
                }
                else
                {
                    console.log("couldnt confirm");
                }
            }
            else {
                console.log("confirmed");
                resolve(true);  //  Offer is confirmed by 2FA
            }
        });
    });
}

and I get rate limited (error 429) pretty often, what am I doing wrong? (It usually confirms on the 3rd time)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...