What is the best way to find out what unspent assets and how much qty amount are being locked?

+1 vote
To find all the assets and qty currently being locked, here is what I do:

- listlockunspent to get a list of {txid,vout}

- For each outpoint, getrawtransaction txid vout.

- for each raw transaction, decoderawtransaction.

- parse it to obtain the assets metadata.

Is there a shorter way?
asked Mar 16, 2017 by kakkoiiman

1 Answer

+1 vote

The shorter way is to use listlockunspent and then gettxout with the txid,vout pair.

answered Mar 16, 2017 by MultiChain
I have tried it but it returns nothing.
Here is what I have:

Step 1. listlockunspent
{"method":"listlockunspent","params":[],"id":1,"chain_name":"chain1"}
[
    {
        "txid" : "ee788bcd940959b115651ad3bb8f963837007c1b72862c251476722213c92526",
        "vout" : 0
 }]

step 2: gettxout "ee788bcd940959b115651ad3bb8f963837007c1b72862c251476722213c92526" 0
{"method":"gettxout","params":["ee788bcd940959b115651ad3bb8f963837007c1b72862c251476722213c92526",0,true],"id":1,"chain_name":"chain1"}

Its empty. Even when unconfirmed is true.
We can't reproduce the problem here, so could you please tell me which version of MultiChain you are using? If you're willing to help, we may ask you for debug files to determine why this is happening in your case.
...