Nano-node: confirmation_history response is inconsistent when the node hasn't confirmed anything yet

Created on 31 Jul 2019  路  1Comment  路  Source: nanocurrency/nano-node

If a node is still syncing or hasn't confirmed any blocks since it started and you call the confirmation_history RPC, the confirmations value is an empty string instead of an empty array.

curl -d '{"action": "confirmation_history"}' [::1]:7076
{
    "confirmation_stats": {
        "count": "0"
    },
    "confirmations": ""
}

While easy to check for, this makes the response inconsistent depending on whether the node has confirmed a block yet. The expected result for me is an empty array instead of an empty string.

bug

Most helpful comment

@meltingice I believe this is related to the JSON library being used, which #1871 is setup to help resolve. Currently targeted for V21 as we look to do a larger rework of RPC.

>All comments

@meltingice I believe this is related to the JSON library being used, which #1871 is setup to help resolve. Currently targeted for V21 as we look to do a larger rework of RPC.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

i3bitcoin picture i3bitcoin  路  4Comments

cryptocode picture cryptocode  路  4Comments

yousifa picture yousifa  路  5Comments

frankh picture frankh  路  3Comments

liuhailin picture liuhailin  路  5Comments