Welcome to the Dash Forum!

Please sign up to discuss the most innovative cryptocurrency!

dash-qt: Coin Selection window not sorting correctly by Amount

Discussion in 'Development Tech Discussion' started by jimbursch, Sep 7, 2017.

  1. jimbursch

    jimbursch Active Member

    Joined:
    Mar 5, 2017
    Messages:
    837
    Likes Received:
    499
    Trophy Points:
    133
    In Dash-QT when I open up the Coin Selection window (Send: Inputs: Coin Selection) and sort the inputs by Amount, it does not sort correctly. Is this a known issue?

    ping @UdjinM6
     
  2. AjM

    AjM Well-known Member
    Foundation Member

    Joined:
    Jun 23, 2014
    Messages:
    1,332
    Likes Received:
    570
    Trophy Points:
    283
    Works ok for me, win7x64.
     
  3. jimbursch

    jimbursch Active Member

    Joined:
    Mar 5, 2017
    Messages:
    837
    Likes Received:
    499
    Trophy Points:
    133
    I'm using Ubuntu; here is a screen capture:

    upload_2017-9-7_9-11-36.png
     
  4. doodlefax

    doodlefax New Member

    Joined:
    Jun 15, 2017
    Messages:
    36
    Likes Received:
    8
    Trophy Points:
    8
    This is Dash Core version v0.12.1.5 (64-bit) download?

    Dogecoin has a similar issue, though in their case the wrong sort order is lexicographic and the comments suggest that locale setting may be the cause.
    https://github.com/dogecoin/dogecoin/issues/1289

    Sorting is handled by QT. In dash-qt, an extra column is added just for the purpose of sorting
    (containing the column text padded to the left to a fixed width so that lexicographic order is numerical order).

    The QT documentation is vague about sorting. This QT forum link gives some more useful information.
    https://forum.qt.io/topic/61239/how-does-qtreewidgetitem-sortchildren-sort/2

    (Bitcoin-qt wallet uses setData and UserRole on the items, as suggested in that link, rather than using an extra column.)
    (Sorting by the 'model' data itself may be a more correct approach, though our data is grouped by address.)

    This is probably a 'red-herring' - in your screenshot the (trailing) rows with PS rounds are sorted while the (leading) rows with PS rounds n/a are sorted if the group with the same 'Received with address' are represented by the first group item.