Bitcoin Forum
December 03, 2026, 03:26:19 AM *
News: Latest Bitcoin Core release: 32.1 [Torrent]
 
   Home   Help Search Login Register More  

Warning: Moderators do not remove likely scams. You must use your own brain: caveat emptor. Watch out for Ponzi schemes. Do not invest more than you can afford to lose.

Pages: « 1 ... 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 [80] 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 ... 139 »
  Print  
Author Topic: [BTC-TC] Virtual Community Exchange [CLOSED]  (Read 317402 times)
pascal257
Sr. Member
****
Offline

Activity: 493
Merit: 262


View Profile
August 05, 2013, 01:06:40 PM
 #1581

I have 2 feature requests for the API:

1. Return Order ID in the response of submitting bid/ask
2. When excessive wait occurs, set status to fail and not success
Rannasha
Hero Member
*****
Offline

Activity: 728
Merit: 504


View Profile
August 05, 2013, 01:10:25 PM
 #1582

I have 2 feature requests for the API:

1. Return Order ID in the response of submitting bid/ask
2. When excessive wait occurs, set status to fail and not success

To add to point 2, I believe an order placed while there is insufficient funds also returns a success, but with a response-message that contains the error.

Basically, as long as your request is well-formed and the security exists, a submit request will return a success, even though the order may not have been placed.
VolanicEruptor
Sr. Member
****
Offline

Activity: 392
Merit: 250



View Profile
August 05, 2013, 09:50:48 PM
 #1583

"Access temporarily denied" Huh
burnside
Legendary
*
Offline

Activity: 1106
Merit: 1006


Lead Blockchain Developer


View Profile WWW
August 05, 2013, 10:10:35 PM
 #1584

I have 2 feature requests for the API:

1. Return Order ID in the response of submitting bid/ask
2. When excessive wait occurs, set status to fail and not success

To add to point 2, I believe an order placed while there is insufficient funds also returns a success, but with a response-message that contains the error.

Basically, as long as your request is well-formed and the security exists, a submit request will return a success, even though the order may not have been placed.

I've fixed both of these in the API response as best I could in a quick manner.  The order # is in the response string.  (sorry, the method that processes the requests only currently returns a string, so it's the only way I could get it in.)  The fail/success I have plugged in a regexp to detect one way or the other.  This is as good as it gets until I can reformat the underlying method call to return an array rather than just the single string.

Can someone please test it at https://btct.co/oauth/trade_new ?  If it passes a few test runs, I'll move it into place.

Cheers.

"Access temporarily denied" Huh

5-10 minute block for too many accesses too fast.  We're very aggressive with our DDoS protections.  We're more lenient if you are logged in.

Cheers.
dexX7
Legendary
*
Offline

Activity: 1106
Merit: 1050



View Profile WWW
August 05, 2013, 11:00:45 PM
 #1585

Can someone please test it at https://btct.co/oauth/trade_new ?  If it passes a few test runs, I'll move it into place.

Quote
[00:47:39] 1 BID ACTIVEMINING @ 0,000120:
{"status":"error","error_message":"Received Bid Order: 1 of ACTIVEMINING @ 0.00012. Received Bid Order Request:  1 @ 0.00012 BTC<br>\nPlaced Purchase Order 1 @ 0.00012 BTC.<br\/><br\/>\n"} << Bid placed though.


[00:48:47] 1 BID ACTIVEMINING @ 0,120000:
{"status":"error","error_message":"Received Ask Order: 1 of ACTIVEMINING @ 0.12. Received Ask Order Request: 1 @ 0.12 BTC<br>\nPlaced Sale Order 1 @ 0.12 BTC.<br\/><br\/>\n"} << Ask placed though.


[00:49:12] 1 BID NOTAVAILABLE @ 0,150000:
Error:

Invalid Ticker.


[00:50:27] 1 BID LABCOIN @ 1200,000000
{"status":"error","error_message":"Received Bid Order: 1 of LABCOIN @ 1200. Received Bid Order Request:  1 @ 1200 BTC<br>\nOrder failed.  This order would cost 1202.40000000.  Your balance is X.<br\/><br\/>\n"}


[00:53:27] 1 BID LABCOIN @ 0,001600
{"status":"error","error_message":"Received Bid Order: 1 of LABCOIN @ 0.0016. Received Bid Order Request:  1 @ 0.0016 BTC<br>\nExcessive wait trying to get lock on LABCOIN."}


[00:54:18] 1 ASK DMS.SELLING @ 16,000000
{"status":"error","error_message":"Received Ask Order: 1 of DMS.SELLING @ 16. Received Ask Order Request: 1 @ 16 BTC<br>\nYou do not own any DMS.SELLING.<br\/><br\/>\n"}

Edit:

Can't buy or sell right now. Either gets excessiv  lock or an empty result.

burnside
Legendary
*
Offline

Activity: 1106
Merit: 1006


Lead Blockchain Developer


View Profile WWW
August 05, 2013, 11:06:59 PM
 #1586

Can someone please test it at https://btct.co/oauth/trade_new ?  If it passes a few test runs, I'll move it into place.

Code:
[00:47:39] 1 BID ACTIVEMINING @ 0.00012:
{"status":"error","error_message":"Received Bid Order: 1 of ACTIVEMINING @ 0.00012. Received Bid Order Request:  1 @ 0.00012 BTC<br>\nPlaced Purchase Order 1 @ 0.00012 BTC.<br\/><br\/>\n"} << Bid placed though.


[00:48:47] 1 BID ACTIVEMINING @ 0.12:
{"status":"error","error_message":"Received Ask Order: 1 of ACTIVEMINING @ 0.12. Received Ask Order Request: 1 @ 0.12 BTC<br>\nPlaced Sale Order 1 @ 0.12 BTC.<br\/><br\/>\n"} << Ask placed though.


[00:49:12] 1 BID NOTAVAILABLE @ 0.15:
Error:

Invalid Ticker.


[00:50:27] 1 BID LABCOIN @ 1200,000000
{"status":"error","error_message":"Received Bid Order: 1 of LABCOIN @ 1200. Received Bid Order Request:  1 @ 1200 BTC<br>\nOrder failed.  This order would cost 1202.40000000.  Your balance is X.<br\/><br\/>\n"}


[00:53:27] 1 BID LABCOIN @ 0,001600
{"status":"error","error_message":"Received Bid Order: 1 of LABCOIN @ 0.0016. Received Bid Order Request:  1 @ 0.0016 BTC<br>\nExcessive wait trying to get lock on LABCOIN."}


[00:54:18] 1 ASK DMS.SELLING @ 16,000000
{"status":"error","error_message":"Received Ask Order: 1 of DMS.SELLING @ 16. Received Ask Order Request: 1 @ 16 BTC<br>\nYou do not own any DMS.SELLING.<br\/><br\/>\n"}

Edit:

Can't buy or sell right now. Either gets extensive lock or an empty result.


Thank you.  I adjusted the regex on the "Placed" orders.  Round #2?

The excessive waits I'm still working on... I know they suck.  Sad

dexX7
Legendary
*
Offline

Activity: 1106
Merit: 1050



View Profile WWW
August 05, 2013, 11:32:37 PM
 #1587

Well, I would.. I think it's essential to get the lock error resolved. Smiley

Quote
[01:31:02] 1 ASK ACTIVEMINING @ 0,01
{"status":"error","error_message":"Received Ask Order: 1 of ACTIVEMINING @ 0.01. Received Ask Order Request: 1 @ 0.01 BTC<br>\nExcessive wait trying to get lock on ACTIVEMINING."}

[01:30:10] 1 BID ACTIVEMINING @ 0,1


[01:30:02] 1 ASK ACTIVEMINING @ 0,1
{"status":"error","error_message":"Received Ask Order: 1 of ACTIVEMINING @ 0.1. Received Ask Order Request: 1 @ 0.1 BTC<br>\nPlaced Sale Order #957742: 1 @ 0.1 BTC.<br\/><br\/>\n"}

[01:29:50] 1 BID ACTIVEMINING @ 0,0001
{"status":"error","error_message":"Received Bid Order: 1 of ACTIVEMINING @ 0.0001. Received Bid Order Request:  1 @ 0.0001 BTC<br>\nPlaced Purchase Order #957724: 1 @ 0.0001 BTC.<br\/><br\/>\n"}

But order ids show up. That's really a good thing. Wink

pascal257
Sr. Member
****
Offline

Activity: 493
Merit: 262


View Profile
August 05, 2013, 11:40:26 PM
 #1588

The order # is in the response string.
Thanks, haven't noticed that. Should be fine for now.
burnside
Legendary
*
Offline

Activity: 1106
Merit: 1006


Lead Blockchain Developer


View Profile WWW
August 05, 2013, 11:59:00 PM
 #1589

Well, I would.. I think it's essential to get the lock error resolved. Smiley

Quote
[01:31:02] 1 ASK ACTIVEMINING @ 0,01
{"status":"error","error_message":"Received Ask Order: 1 of ACTIVEMINING @ 0.01. Received Ask Order Request: 1 @ 0.01 BTC<br>\nExcessive wait trying to get lock on ACTIVEMINING."}

[01:30:10] 1 BID ACTIVEMINING @ 0,1


[01:30:02] 1 ASK ACTIVEMINING @ 0,1
{"status":"error","error_message":"Received Ask Order: 1 of ACTIVEMINING @ 0.1. Received Ask Order Request: 1 @ 0.1 BTC<br>\nPlaced Sale Order #957742: 1 @ 0.1 BTC.<br\/><br\/>\n"}

[01:29:50] 1 BID ACTIVEMINING @ 0,0001
{"status":"error","error_message":"Received Bid Order: 1 of ACTIVEMINING @ 0.0001. Received Bid Order Request:  1 @ 0.0001 BTC<br>\nPlaced Purchase Order #957724: 1 @ 0.0001 BTC.<br\/><br\/>\n"}

But order ids show up. That's really a good thing. Wink

Ok, I think I figured it out.  Round #3?

BTW.  Thanks a bunch for helping like this.  Wink Wink
dexX7
Legendary
*
Offline

Activity: 1106
Merit: 1050



View Profile WWW
August 06, 2013, 12:12:15 AM
 #1590

Bingo! Wink

Quote
[02:11:28] 1 ASK ACTIVEMINING @ 0,1
{"status":"success","response":"Received Ask Order: 1 of ACTIVEMINING @ 0.1 BTC: Placed Sale Order #959414: 1 @ 0.1 BTC. <br><br>"}

[02:11:16] 1 BID ACTIVEMINING @ 0,0001
{"status":"success","response":"Received Bid Order: 1 of ACTIVEMINING @ 0.0001 BTC: Placed Purchase Order #959404: 1 @ 0.0001 BTC. <br><br>"}

burnside
Legendary
*
Offline

Activity: 1106
Merit: 1006


Lead Blockchain Developer


View Profile WWW
August 06, 2013, 12:24:48 AM
 #1591

Bingo! Wink

Quote
[02:11:28] 1 ASK ACTIVEMINING @ 0,1
{"status":"success","response":"Received Ask Order: 1 of ACTIVEMINING @ 0.1 BTC: Placed Sale Order #959414: 1 @ 0.1 BTC. <br><br>"}

[02:11:16] 1 BID ACTIVEMINING @ 0,0001
{"status":"success","response":"Received Bid Order: 1 of ACTIVEMINING @ 0.0001 BTC: Placed Purchase Order #959404: 1 @ 0.0001 BTC. <br><br>"}

Sweet.  Moved it from oauth/trade_new to oauth/trade.  Thanks again!
burnside
Legendary
*
Offline

Activity: 1106
Merit: 1006


Lead Blockchain Developer


View Profile WWW
August 06, 2013, 04:04:07 AM
 #1592

@burnside: why not str_replace("&nbsp;", " ", $news_text); ?

because...:


I'm not sure how exactly to filter that... in the db interface it looks like this:

We�have�received�our�sample-PCB�and�it�is�being�tested�in�every�aspect.�

Really strange.
matt4054
Legendary
*
Offline

Activity: 1946
Merit: 1038



View Profile
August 06, 2013, 04:42:06 AM
 #1593

@burnside: why not str_replace("&nbsp;", " ", $news_text); ?

because...:


I'm not sure how exactly to filter that... in the db interface it looks like this:

We�have�received�our�sample-PCB�and�it�is�being�tested�in�every�aspect.�

Really strange.

I think the real technical issue behind this is could be a headache to back trace.

As far as I have experienced, � appears as a sign of a stream decoding error while parsing (supposedly broken or corrupted) Unicode, especially through a database with certain settings. I believe it may be related to a special CJK whitespace character that is rendered as a non-breaking space, but it is not the HTML entity. And it probably appears as � in your DB backend.

Best real world solution IMO: copy and paste in a Unicode supporting text editor, and search & replace the offending whitespace with the standard U+0020

Cheers

EDIT: In TextWrangler, there is this wonderful command called "Zap Gremlins", which does exactly what we want here, i.e. convert every strange thing into plain old regular straight ASCII Grin

You may want to used the sanitized quote:

Quote
We have received our sample-PCB and it is being tested in every aspect. Everything s running well so far. ( Mass production of PCBs will start later and can be finished within one week in Shenzhen)

We also dealed with an acquaintances packaging factory to shorten the Package period from 10days to 3days. I.E. we will get our chips in hand only 3-4 days later after out of  Fab.

We will hold a meeting next weekend in Beijing to discuz our future plans incl.: 2nd gen chips, deployment plans for 1st gen chips, application of analog circuit  in our project , a lot of experts both on R and D have been invited.
Lohoris
Hero Member
*****
Offline

Activity: 630
Merit: 500


Bitgoblin


View Profile
August 06, 2013, 07:29:22 AM
 #1594

I'm not sure how exactly to filter that... in the db interface it looks like this:

We�have�received�our�sample-PCB�and�it�is�being�tested�in�every�aspect.�

Really strange.
Keep the database in unicode, and use CSS property `overflow-x:hidden;`

1LohorisJie8bGGG7X4dCS9MAVsTEbzrhu
DefaultTrust is very BAD.
DrGregMulhauser
Sr. Member
****
Offline

Activity: 330
Merit: 255



View Profile
August 06, 2013, 02:58:04 PM
 #1595

Depending on whether there are some special characters which you do actually want to preserve, or whether you'd like to knock everything down to a safe least common denominator, these kind of gremlins often succumb to judicious use of utf8_decode()/utf8_encode or if necessary iconv().

Tips: 1GTvfygTCnA5LdE2dX31AtcHho6s6X9H9b
BTC Growth
pascal257
Sr. Member
****
Offline

Activity: 493
Merit: 262


View Profile
August 06, 2013, 03:45:23 PM
 #1596

Bingo! Wink

Quote
[02:11:28] 1 ASK ACTIVEMINING @ 0,1
{"status":"success","response":"Received Ask Order: 1 of ACTIVEMINING @ 0.1 BTC: Placed Sale Order #959414: 1 @ 0.1 BTC. <br><br>"}

[02:11:16] 1 BID ACTIVEMINING @ 0,0001
{"status":"success","response":"Received Bid Order: 1 of ACTIVEMINING @ 0.0001 BTC: Placed Purchase Order #959404: 1 @ 0.0001 BTC. <br><br>"}

Sweet.  Moved it from oauth/trade_new to oauth/trade.  Thanks again!
Just wanted to thank you for the fast fix. Great job!
And thanks dexX7 for helping, great its working properly now.
VolanicEruptor
Sr. Member
****
Offline

Activity: 392
Merit: 250



View Profile
August 06, 2013, 10:59:30 PM
 #1597

please do manual transfers tonight or I'm going to be fucked saddened  Shocked
pascal257
Sr. Member
****
Offline

Activity: 493
Merit: 262


View Profile
August 07, 2013, 12:23:34 AM
 #1598

Just found another bug, every time you try to fill an order (at least bid) directly via OAuth you get an error

Example:
OAuth ->fetch ('https://btct.co/oauth/trade', array('act' => 'ask_submit', 'ticker' => 'S.MPOE-PT', 'ask_quantity' => '1', 'ask_price' => '0.0008607'), 'POST')

Response:
Invalid auth/bad request (got a 500, expected HTTP/1.1 20X or a redirect)

Its also possible that it creates a deadlock. It seems that the system does not release the lock after this. (Just guessing) On second try I get:

Array ( [status] => error [error_message] => Received Ask Order: 1 of S.MPOE-PT @ 0.0008607 BTC: Excessive wait trying to get lock on S.MPOE-PT. )
burnside
Legendary
*
Offline

Activity: 1106
Merit: 1006


Lead Blockchain Developer


View Profile WWW
August 07, 2013, 08:30:36 AM
 #1599

Depending on whether there are some special characters which you do actually want to preserve, or whether you'd like to knock everything down to a safe least common denominator, these kind of gremlins often succumb to judicious use of utf8_decode()/utf8_encode or if necessary iconv().

iconv in newer php versions is a little bugged.

I ended up with:

Code:
preg_replace( '/[^[:print:]]/', ' ',$content);

Thanks for the input all.  It definitely threw me for a loop. 

burnside
Legendary
*
Offline

Activity: 1106
Merit: 1006


Lead Blockchain Developer


View Profile WWW
August 07, 2013, 09:21:19 AM
 #1600

Just found another bug, every time you try to fill an order (at least bid) directly via OAuth you get an error

Example:
OAuth ->fetch ('https://btct.co/oauth/trade', array('act' => 'ask_submit', 'ticker' => 'S.MPOE-PT', 'ask_quantity' => '1', 'ask_price' => '0.0008607'), 'POST')

Response:
Invalid auth/bad request (got a 500, expected HTTP/1.1 20X or a redirect)

Its also possible that it creates a deadlock. It seems that the system does not release the lock after this. (Just guessing) On second try I get:

Array ( [status] => error [error_message] => Received Ask Order: 1 of S.MPOE-PT @ 0.0008607 BTC: Excessive wait trying to get lock on S.MPOE-PT. )

Thank you.  I have found two potential points of exit from the code where the security lock was not being released prior to exiting:

  - One related to backend bitcoind failure, which I do not think was the cause here because there's logging that would have been seen if this were the case.
  - Another which may be the smoking gun was a DDoS prevention piece that was intended to run once at init, but was being called twice because of a double layer of validation in the bid/ask processing methods.  I've fixed it to only do the DDoS test the first call per run.

Hopefully it ends up being taken care of now, but I've also added more logging/debugging code a bunch of places to help out if this doesn't end up taking care of it.

Cheers.
Pages: « 1 ... 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 [80] 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 ... 139 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!