PhantomPhreak (OP)
Sr. Member
Offline
Activity: 476
Merit: 300
Counterparty Chief Scientist and Co-Founder
|
|
February 13, 2014, 02:36:53 PM Last edit: February 13, 2014, 03:54:19 PM by PhantomPhreak |
|
I don't think my XCP balance is correct: http://blockscan.com/address.aspx?q=1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fNCurrently both blockscan.com and my local client (v0.4.1 master branch on Ubuntu 13.10) show a balance of 1348.19 XCP. But this balance doesn't make sense just looking through transaction history: 1340.43 total earned through proof-of-burn. +1 from winning Super Bowl Bet. Sold a few XCP, other orders have all expired or been cancelled. This implies my balance should be at most ~1341. Where did the additional 7 XCP come from? My suspicion is I got credited extra XCP somehow through the order expiration process. Here are the credits and debits to and from that address (and your balance) in the DB: INSERT INTO "debits" VALUES(283702,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',100000000,'bet.parse',NULL); INSERT INTO "debits" VALUES(283702,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',0,'bet.parse',NULL); INSERT INTO "debits" VALUES(284563,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',100000000000,'order.parse','dff0ebf6a01460daa8e085fe7350940415cf255eccc9c6c711d694dd0c36b313'); INSERT INTO "debits" VALUES(284671,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',30100000000,'order.parse','9ce90757c8f8d9c0c3cffb429d01c737cac39ccfc630d783e8812b468c01e76c'); INSERT INTO "debits" VALUES(284849,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',25010000000,'order.parse','53587a17f03ea59fd559142f43d121b9cdaff846deaaee031e81b1b4c706e688'); INSERT INTO "debits" VALUES(284871,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',8200000000,'order.parse','8eb9068fe42bb39c42858fbb7e769d31a90c446444808fc3f569a409cf1884e6'); INSERT INTO "debits" VALUES(284873,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',8300000000,'order.parse','881dcd368821681f43840e0e0f941208884fc2e915d215b00ad726b1b9f88622'); INSERT INTO "credits" VALUES(279448,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',1396545455,'burn.parse','d7f83a15b2a01a18825f47e514f81bccb5fd1a43713bad720c509724f204e5cf'); INSERT INTO "credits" VALUES(279451,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',57544533454,'burn.parse','709b19c683cf6b02124ad716c5c12907ba0070a36098ed9ac90bb6a1d011f4b5'); INSERT INTO "credits" VALUES(279529,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',47218290000,'burn.parse','065259687185302f2503d83b990d1313892e490edc1a04550c4a397471845d3c'); INSERT INTO "credits" VALUES(279781,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',8632749140,'burn.parse','cf6398d3e800fb5f6043eb93703ec8c66b01cad9db7b2c2a0eb2775e64e9cbce'); INSERT INTO "credits" VALUES(280562,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',12960518338,'burn.parse','2a38b1ec751f14722516b934a358d9454bf4aa34cc94da5f33bb033ef8b85699'); INSERT INTO "credits" VALUES(281000,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',6289257296,'burn.parse','12e7ce6273a1823ad9fb4f09565e8eb3c220bf67237a07b7748bc16a98bce4b2'); INSERT INTO "credits" VALUES(283713,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',0,'bet.expire',NULL); INSERT INTO "credits" VALUES(284054,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',200000000,'broadcast.parse',NULL); INSERT INTO "credits" VALUES(284054,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',0,'broadcast.parse',NULL); INSERT INTO "credits" VALUES(284567,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',100000000000,'cancel.parse',NULL); INSERT INTO "credits" VALUES(284772,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',927272635,'order.expire','80bf54654df947a346df88a8961740159c08e2bed2834c277d1bb7d6d98e0f3c9ce90757c8f8d9c0c3cffb429d01c737cac39ccfc630d783e8812b468c01e76c'); INSERT INTO "credits" VALUES(284972,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',29949500151,'order.expire','9ce90757c8f8d9c0c3cffb429d01c737cac39ccfc630d783e8812b468c01e76c'); INSERT INTO "credits" VALUES(284972,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',1,'order.expire','8eb9068fe42bb39c42858fbb7e769d31a90c446444808fc3f569a409cf1884e6'); INSERT INTO "credits" VALUES(284972,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',8199999999,'order.expire','8eb9068fe42bb39c42858fbb7e769d31a90c446444808fc3f569a409cf1884e6bc8ac78ca1f7d8b6a2d63bcd5fee09e6ece10f7f45eb44209fc580c13d764cae'); INSERT INTO "credits" VALUES(285024,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',8300000000,'order.expire','881dcd368821681f43840e0e0f941208884fc2e915d215b00ad726b1b9f88622'); INSERT INTO "credits" VALUES(285050,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',0,'order.expire','53587a17f03ea59fd559142f43d121b9cdaff846deaaee031e81b1b4c706e688'); INSERT INTO "credits" VALUES(285050,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',24909999833,'order.expire','53587a17f03ea59fd559142f43d121b9cdaff846deaaee031e81b1b4c706e6886efab911ef0b392cced9a410f610380783356f3172b6ee724e9c5175e21e8a7d'); INSERT INTO "balances" VALUES('1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',134818666302);
. Check out the sum(expired order credits) - sum(sent order debits). It's a positive number, ~6 XCP to be precise. That number should always be <= 0. You should never receive more credits back from expired orders than the debits from sending them. The first order to sell 1000 XCP was cancelled properly with all funds credited back. Here are the rest of the orders: VALUES(284671,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',30100000000,'order.parse','9ce90757c8f8d9c0c3cffb429d01c737cac39ccfc630d783e8812b468c01e76c'); INSERT INTO "debits" VALUES(284849,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',25010000000,'order.parse','53587a17f03ea59fd559142f43d121b9cdaff846deaaee031e81b1b4c706e688'); INSERT INTO "debits" VALUES(284871,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',8200000000,'order.parse','8eb9068fe42bb39c42858fbb7e769d31a90c446444808fc3f569a409cf1884e6'); INSERT INTO "debits" VALUES(284873,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',8300000000,'order.parse','881dcd368821681f43840e0e0f941208884fc2e915d215b00ad726b1b9f88622'); Total = 716.1 XCP debited from orders to sell. Here are the order expire credits: VALUES(284772,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',927272635,'order.expire','80bf54654df947a346df88a8961740159c08e2bed2834c277d1bb7d6d98e0f3c9ce90757c8f8d9c 0c3cffb429d01c737cac39ccfc630d783e8812b468c01e76c'); INSERT INTO "credits" VALUES(284972,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',29949500151,'order.expire','9ce90757c8f8d9c0c3cffb429d01c737cac39ccfc630d783e8812b468c01e76c'); INSERT INTO "credits" VALUES(284972,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',1,'order.expire','8eb9068fe42bb39c42858fbb7e769d31a90c446444808fc3f569a409cf1884e6'); INSERT INTO "credits" VALUES(284972,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',8199999999,'order.expire','8eb9068fe42bb39c42858fbb7e769d31a90c446444808fc3f569a409cf1884e6bc8ac78ca1f7d8b 6a2d63bcd5fee09e6ece10f7f45eb44209fc580c13d764cae'); INSERT INTO "credits" VALUES(285024,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',8300000000,'order.expire','881dcd368821681f43840e0e0f941208884fc2e915d215b00ad726b1b9f88622'); INSERT INTO "credits" VALUES(285050,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',0,'order.expire','53587a17f03ea59fd559142f43d121b9cdaff846deaaee031e81b1b4c706e688'); INSERT INTO "credits" VALUES(285050,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',24909999833,'order.expire','53587a17f03ea59fd559142f43d121b9cdaff846deaaee031e81b1b4c706e6886efab911ef0b392 cced9a410f610380783356f3172b6ee724e9c5175e21e8a7d'); Total = 722.85 XCP credited. Digging a bit deeper I think I've narrowed down the issue to this order: http://blockscan.com/order.aspx?q=3390I tried to sell 301 XCP for 2 BTC. There were 2 matches: http://blockscan.com/order_match.aspx?q=3390The match for 1.5 XCP was paid. The match for 9.27 XCP was not paid. I should have received 301-1.5 = 299.5 XCP after expiration, which was received here: VALUES(284972,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',29949500151,'order.expire','9ce90757c8f8d9c0c3cffb429d01c737cac39ccfc630d783e8812b468c01e76c'); However, I also received an additional 9.27 XCP, which I should not have received: VALUES(284772,'1QBPsB2ea61vWTNA9nGUhaHqPQB4SXF4fN','XCP',927272635,'order.expire','80bf54654df947a346df88a8961740159c08e2bed2834c277d1bb7d6d98e0f3c9ce90757c8f8d9c 0c3cffb429d01c737cac39ccfc630d783e8812b468c01e76c'); So I think the bug has to do with order expirations credited the amount of all expired order amounts regardless of match. In additional matched-but-unpaid orders also credit the XCP seller. This leads to a double-credit. There might be a parallel issue with order cancels crediting back all unpaid cancelled amounts, and in addition matched-but-unpaid orders getting credited as well. I will test this after patch has been released. I think that I have fixed this issue (and the bad credit for 9.27 XCP doesn't show up anymore). Now, when an order match expires, if each underlying order is still valid, that order goes back on the books with replenished give_remaining and get_remaining, and only otherwise (if the order is expired) is its source credited immediately. Attention: balances are now slightly different in develop. (A few people were getting extra XCP with order match cancellations.) EDIT: Change also pushed to master.
|