Jump to content
McKay Development

Recommended Posts

Posted (edited)

Hey, short performance / logic question.

 

First off:  

 

- Node is updated to the newest version

 

- All used modules are freshly loaded from npm

 

- Pollinterval is -1 (disabled)

 

I am using this setup here to accept trades from a specific tradepartner:  

manager.on('newOffer', function(offer) {
console.log("New offer!")
    offer.getUserDetails(function(error, me, them) {
            if (error) {
             console.log("Error loading user details: " + error)
            } else {
                if(adminId.indexOf(offer.partner + '') != -1){
                 console.log("Accepting...");
                 offer.accept(function(err) {
                     if (err) {     
                         console.log("Error: " + err);
                     } else {
                         console.log("Successfully accepted!");
                         community.acceptConfirmationForObject(config.identitysecret, offer.id, function(err){
                             if(err){
                                 logError("Confirmation failed: " + err);
                             } else {
                                 logSuccess("Confirmed!");
                             }       
                         });
                     }
                 });
                }
            }
    });
});

Yes, it basically works, but:  

 

- Accepting incoming trades works super fast, but the confirmation sometimes takes really long (10-15 seconds). Now I am wondering, does my "acceptConfirmationForObject" really work well or does it use the confirmationChecker which is set to 10 seconds?  

 

- Does it make sense to call acceptConfirmationForObject() directly after accepting the trade or should I put it inside a really short timeout so the trade is "ready" to be confirmed? Does it make sense to call it more than once with a short delay in between?  

 

- If I am confirming all offers through this method, could I just disable the confirmationChecker? If both, pollinterval and confirmationChecker are disabled, shouldn't I be able to run multiple bots from one IP adress without being rate limited?  

 

 

Thanks a lot in advance! Looking to make this thing a little faster and smoother to use. :)

Edited by Mr. Inka
Posted

It's not a bad idea to add a short delay.

 

acceptConfirmationForObject has nothing to do with the confirmation checker. It operates immediately. If you're using it, you probably don't necessarily need the confirmation checker.

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...