ListUnspent Max Conf Value

+2 votes

What is the value we should be passing in the max confirmation parameter. One way is to find the block height and pass it, however if my intention is to get the list of unspent from 1 to max available confirmations, what is the optimum value. As per the documentation the block starts with 1 and ends with the MAX INT 0XFFFFFFFF which is 4294967295.

However if you use MAX, it always give zero array length response.

multichain-cli pf2 listunspent 0 4294967295 '["1RPkJa2mRhYkpHf6WmyzmXAXN1iG1Pv3z7zYrd"]'
{"method":"listunspent","params":[0,4294967295,["1RPkJa2mRhYkpHf6WmyzmXAXN1iG1Pv3z7zYrd"]],"id":1,"chain_name":"pf2"}

[
]

One Less

multichain-cli pf2 listunspent 0 4294967294 '["1RPkJa2mRhYkpHf6WmyzmXAXN1iG1Pv3z7zYrd"]'
{"method":"listunspent","params":[0,4294967294,["1RPkJa2mRhYkpHf6WmyzmXAXN1iG1Pv3z7zYrd"]],"id":1,"chain_name":"pf2"}

[
]

 

But if I provide 

9999999999L

multichain-cli pf2 listunspent 0 99999999999 '["1RPkJa2mRhYkpHf6WmyzmXAXN1iG1Pv3z7zYrd"]'
{"method":"listunspent","params":[0,99999999999,["1RPkJa2mRhYkpHf6WmyzmXAXN1iG1Pv3z7zYrd"]],"id":1,"chain_name":"pf2"}

[
    {
        "txid" : "05fb4284aabed6857adfc8b6531753f77a3013bc4bab540ab1d30c470d0806ea",
        "vout" : 0,
        "address" : "1RPkJa2mRhYkpHf6WmyzmXAXN1iG1Pv3z7zYrd",
        "account" : "",
        "scriptPubKey" : "76a914b479d7d8f978c6b8a4becda26d4f0ab30747f67588ac1673706b711c00000009010000586b000000000000000075",
        "amount" : 0.00000000,

.......................................................................................

 
Was curious to know and get your feedback on the pattern.

Thanks.

 
asked Sep 2, 2016 by 7sigma

1 Answer

0 votes

Thanks. It is possibly a bug where the number is read from the parameter as signed instead of unsigned. Try using signed integer maximum of 2147483647, and we'll look into it for the next release.

answered Sep 4, 2016 by MultiChain
...