Mr. Inka Posted July 11, 2017 Report Posted July 11, 2017 (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 July 11, 2017 by Mr. Inka Quote
Dr. McKay Posted July 12, 2017 Report Posted July 12, 2017 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. Quote
Recommended Posts
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.