listassettransactions only displaying issuances on other nodes

+7 votes

On Node A I'm running:

multichain-util create my_chain

Then I'm going into ~/.multichain/my_chain/params.dat and setting `anyone-can-connect`,`anyone-can-send`,`anyone-can-receive` to `true`

Then I'm running:

multichaind my_chain -autosubscribe=assets,streams -daemon
multichain-cli my_chain getnewaddress (returns my_first_address)
multichain-cli my_chain issue my_first_address my_asset 100
multichain-cli my_chain getnewaddress` (returns my_second_address)
multichain-cli my_chain sendassetfrom my_first_address my_second_address my_asset 10
multichain-cli my_chain listassettransactions my_asset

Example output:

{"method":"listassettransactions","params":["my_asset"],"id":1,"chain_name":"my_chain"}

[
    {
        "addresses" : {
            "my_first_address" : 100.00000000
        },
        "items" : [
        ],
        "data" : [
        ],
        "confirmations" : 74,
        "blockhash" : "00305922c480879d0b717c718aa6864263fc185d889d88047a11df9a56cef63b",
        "blockindex" : 2,
        "blocktime" : 1501181580,
        "txid" : "735abecf0968e03f628d54a5af6dd4aa0a947fe04ebff1d801ed48ae448069c0",
        "valid" : true,
        "time" : 1501181578,
        "timereceived" : 1501181578
    },
    {
        "addresses" : {
            "my_first_address" : -10.00000000,
            "my_second_address" : 10.00000000
        },
        "items" : [
        ],
        "data" : [
        ],
        "confirmations" : 72,
        "blockhash" : "0091df49257c9c1cb95004612a7050341d86c7d5112fb9d4d7f98e7c74e30d86",
        "blockindex" : 1,
        "blocktime" : 1501181614,
        "txid" : "3022686165213d821670cc711857a85b17bd49e0b9e02b99d1fd51c3a1adfd82",
        "valid" : true,
        "time" : 1501181607,
        "timereceived" : 1501181607
    }

]`

Perfect, just what I want.

Then, on Node B I run:

multichaind my_chain@node1host:node1port -autosubscribe=assets,streams -daemon
multichain-cli my_chain importaddress my_first_address
multichain-cli my_chain listassettransactions my_asset


{"method":"listassettransactions","params":["my_asset"],"id":1,"chain_name":"my_chain"}

[
    {
        "addresses" : {
            "my_first_address" : 100.00000000
        },
        "items" : [
        ],
        "data" : [
        ],
        "confirmations" : 74,
        "blockhash" : "00305922c480879d0b717c718aa6864263fc185d889d88047a11df9a5                                     6cef63b",
        "blockindex" : 2,
        "blocktime" : 1501181580,
        "txid" : "735abecf0968e03f628d54a5af6dd4aa0a947fe04ebff1d801ed48ae448069                                     c0",
        "valid" : true,
        "time" : 1501181580,
        "timereceived" : 1501182972
    }
]

Everything works if I remove the importaddress line, but if I run that (because I want to access watch only addresses from a function in my app) the listassettransactions command changes it's behavior. I'm not entirely sure what's happening.

asked Jul 27, 2017 by dash
edited Jul 27, 2017 by dash
Thanks for asking about this. Can you please show the output for listassets on Node B, to see whether it is subscribed to this asset or not? I'm guessing it is not (since autosubscribe only handles new asset/stream creation events) but would like to check. If not, once you subscribe to the asset on Node B, is the problem resolved?
Before importaddress (on Node B):

{"method":"listassets","params":[],"id":1,"chain_name":"my_chain"}

[
    {
        "name" : "my_asset",
        "issuetxid" : "c8a165cf2ce4816ca4ecab0f97d367c1d5db6ca19b7997c117a34bc7e7afd2f7",
        "assetref" : "6-264-41416",
        "multiple" : 1,
        "units" : 1.00000000,
        "open" : false,
        "details" : {
        },
        "issueqty" : 100.00000000,
        "issueraw" : 100,
        "subscribed" : true,
        "synchronized" : true,
        "transactions" : 2,
        "confirmed" : 2
    }
]

After importaddress my_first_address:

{"method":"listassets","params":[],"id":1,"chain_name":"my_chain"}

[
    {
        "name" : "my_asset",
        "issuetxid" : "c8a165cf2ce4816ca4ecab0f97d367c1d5db6ca19b7997c117a34bc7e7afd2f7",
        "assetref" : "6-264-41416",
        "multiple" : 1,
        "units" : 1.00000000,
        "open" : false,
        "details" : {
        },
        "issueqty" : 100.00000000,
        "issueraw" : 100,
        "subscribed" : true,
        "synchronized" : true,
        "transactions" : 2,
        "confirmed" : 2
    }
]

Running:

subscribe my_asset

after (or before) importaddress doesn't fix the result of listassettransactions

2 Answers

+3 votes

Thanks for your comments above. This sounds like a straightforwards bug in listassettransactions, where the presence of a read-only address in your case is causing it to generate the wrong output.

It would be helpful if you could stop Node B, zip up the blockchain directory, and send it to multichain dot debug at gmail dot com so we can fix this quickly.

answered Jul 28, 2017 by MultiChain
Thanks - we received the file and will take a look.
Thank you for reporting this.

We will fix this in the upcoming product release soon.
+3 votes

Thanks again. We've identified the problem and resolved it. It was a conflict between autosubscribe and importaddress. The fix will be rolled into the final 1.0 release of MultiChain.

answered Jul 30, 2017 by MultiChain
Do you have any guesses on when the final 1.0 will be released?
Expect it this week.
...