minor hostdb output issues
Created by: hackneyb
BUG REPORT
Stack Trace or error message The issue is consistency of output of hostdb -v
Issue1: wrong order of heading names in Offline Host output
C:\Program Files\Sia-UI-v1.3.1-win32-x64\resources\app\Sia>date /t && time /t && siac hostdb -v | more
Sun 01/28/2018
12:33 AM
9048 Offline Hosts:
Pubkey Address Uptime Price (/ TB / Month) Download Price (/ TB) Recent Scans
9048: ed25519:b4993ac450a69575fe45d4db70c3255653fe71360fbab0b3e91f10a9834f20e7 61.180.9.227:9982 0 H 0 H 0.000 000000000000000000000000000000
9047: ed25519:8d61e3b853f9a70df7a772f24136ef5b52fde8ac6cf614d532daec3b69038fc5 super3.punked.us:9982 33 KS 7.639 SC 0.027 101011010011001100101011010100
9046: ed25519:5ab83d52f0faa03b1d02a04cbc013e8fd2a253d3d99b9eadfdfc348a56704fc6 100.69.171.69:9982 0 H 0 H 0.000 000000000000000000000000000000
9045: ed25519:3508e8ff6d76f94da6214858dbf4116009170748393d98f975bd03916e477f9c [2602:306:8b5c:5d80:b40f:d58d:ac3f:9b7c]:9982 0 H 0 H 0.000 000000000000000000000000000000
9044: ed25519:b7b0c3dfc75478423e2534a8822ec9dcb12f8e2f32961722dd7db2debd5d6f95 76.81.62.34:9982 0 H 0 H 0.000 000000000000000000000000000000
9043: ed25519:89ab49c22319e09d008769550b7655a735a0158c49ed5642c017a7cc2b8ce88a 100.114.60.226:9982 0 H 0 H 0.000 000000000000000000000000000000
9042: ed25519:add7dd410461ce4a97c9b000e261b4176a66659a67877ed4e4850d7cc33e156c [2602:306:8b1c:2dc0:d980:b143:57f7:4df5]:9982 0 H 0 H 0.000 000000000000000000000000000000
9041: ed25519:5ef413b38c2c70397b928bf31398c313189c8abc05e591c286d64dfa8d4308de sia.the-best-sia-hosting.com:9982 0 H 0 H 0.000 000000000000000000000000000000
9040: ed25519:6e773b147dce7e173a3af9f6ababa7588e7b2339a3b1138cb3a3caaad0f92fea mainshit.dynu.com:9982 0 H 0 H 0.000 000000000000000000000000000000
Issue2: wrong sorting order. Example (edited for privacy) - host3 below should be listed below host2, by score
C:\Program Files\Sia-UI-v1.3.1-win32-x64\resources\app\Sia>date /t && time /t && siac hostdb -v | findstr "host1 host2 host3 host4 Pubkey Offline Inactive Active"
Fri 01/26/2018
12:15 AM
8908 Offline Hosts:
Pubkey Address Uptime Price (/ TB / Month) Download Price (/ TB) Recent Scans
205 Inactive Hosts:
Pubkey Address Price (/ TB / Month) Download Price (/ TB) Uptime Recent Scans
801 Active Hosts:
Pubkey Address Score Price (/ TB / Month) Download Price (/TB) Uptime Recent Scans
149: ed25519: host1:9982 4940.55 50 SC 25 SC 0.932 111111111111111111111111111111
147: ed25519: host2:9982 6050.1 250 SC 0 H 0.994 111111111111111111111111111111
136: ed25519: host3:9982 5324.19 60 SC 48 SC 0.903 111111111111111111111111111111
108: ed25519: host4:9982 18788.3 50 SC 45 SC 0.974 111111111111111111111111111111
Expected Behavior
Issue1: hostdb -v output order should match headings. If data is displayed the same way as now, headings should be:
Price (/ TB / Month) Download Price (/ TB) Uptime
Issue2: Sorting order should work, ie hosts with higher score appear after hosts with lower score.
How to reproduce it (as minimally and precisely as possible)
Any hostdb -v command reproduces the column heading mismatch (Issue1) The sorting order (issue2) is intermittent, but seems to occur when decimal points listed for host Score are single digit. That is, when host score in the example was 6050.1, it was misplaced in the order. When it is double decimal digits (for example 6050.53), it will be listed in the correct order.
Environment
- Sia version: 1.3.1
- OS: Win Server 2012 R2