CityOfZion / neo-scan

Blockchain explorer for NEO
https://neoscan.io
MIT License
70 stars 65 forks source link

Inccorrect gas reported #106

Closed snowypowers closed 6 years ago

snowypowers commented 6 years ago

http://testnet-api.wallet.cityofzion.io/v2/address/claims/ALfnhLg7rUyL6Jr98bzzoxz5J7m64fbR4s

{
    "address": "ALfnhLg7rUyL6Jr98bzzoxz5J7m64fbR4s",
    "claims": [
        {
            "claim": 232522,
            "end": 867240,
            "index": 0,
            "start": 844201,
            "sysfee": 48210,
            "txid": "4536a2539babf4b4b29e308bc396dc23e407232a5ae88a5ca028d47bd80653c2",
            "value": 1
        }
    ],
    "net": "TestNet",
    "total_claim": 232522,
    "total_unspent_claim": 108267556
}

https://neoscan-testnet.io/api/test_net/v1/get_claimable/ALfnhLg7rUyL6Jr98bzzoxz5J7m64fbR4s

{
    "claimable": [
        {
            "value": 1,
            "unclaimed": 0.00232514,
            "txid": "4536a2539babf4b4b29e308bc396dc23e407232a5ae88a5ca028d47bd80653c2",
            "start_height": 844201,
            "n": 0,
            "end_height": 867240
        }
    ],
    "address": "ALfnhLg7rUyL6Jr98bzzoxz5J7m64fbR4s"
}

Note the difference in claim and unclaimed. They should have the same numbers. I believe that neoscan is wrong because the NEO node is rejecting my tx created by the neoscan data. Have not tried to claim gas with neonDB data tho. I will leave this in this state for as long as possible.

lucianoengel commented 6 years ago

this is weird... In main net I couldn't find an address with this mismatch between the API's. Did you find any on main net? Its missing exactly 0.00000008 on each wrong one..... can't understand why some are correct and others aren't.

snowypowers commented 6 years ago

thats like one block off. maybe check your block counting?

snowypowers commented 6 years ago

the newer claims (with newer starting blocks) looks to be correct now. However, the old data is still there and wrong.

lucianoengel commented 6 years ago

I've been digging the code trying to figure out what may be happening, but didn't changed anything so far. So, whatever it is, it works for most of the time. Still trying to understand why only these calls are one block off...

lucianoengel commented 6 years ago

I created an algorithm to scan the block range for missing blocks and repair. It solved the problem! There was a missing block for some reason.