Issue with getassettransaction command output's addresses field.

+1 vote

As per the vin and vout of the following transaction obtained using the getassettransaction command, 50000 units of the asset test1 is sent from the address "1PmbQGuUfjDG4TMFVDnEuPDukm4f7dDLZvetVs" to "1YPkA7C8ARo9gduihmc7pT2cGvK8R6YhE16iL6".

Shouldn't the "addresses" field in the output contain the values -50000 & 50000 instead of 50000 & 999950000? Because that's what I notice in other transactions.

 

{
    "addresses" : {
        "1YPkA7C8ARo9gduihmc7pT2cGvK8R6YhE16iL6" : 50000.00000000,
        "1PmbQGuUfjDG4TMFVDnEuPDukm4f7dDLZvetVs" :
999950000.00000000
    },
    "items" : [
    ],
    "data" : [
    ],
    "confirmations" : 818,
    "blockhash" : "000036c7ab30a0b8da963761cec658001717ea15aa19687ae29cde747b4dd646",
    "blockindex" : 1,
    "blocktime" : 1490955431,
    "txid" : "cbae0c69540c1968a775d4649e792390bd7fee0bc69f6e9ebbda7e6c3160dbba",
    "valid" : true,
    "time" : 1490955429,
    "timereceived" : 1490955429,
    "vin" : [
        {
            "txid" : "52007eeaf3dc43b36ba40f7411a894b4bb49e5f2dcd80ae94d61b26fe1171eb3",
            "vout" : 0,
            "addresses" : [
                "1PmbQGuUfjDG4TMFVDnEuPDukm4f7dDLZvetVs"
            ],
            "type" : "pubkeyhash",
            "ismine" : true,
            "iswatchonly" : false,
            "amount" : 0.00000000,
           
"assets" : [
                {
                    "name" : "test1",
                    "assetref" : "228-267-82",
                    "qty" : 1000000000.00000000
                }
            ]

        }
    ],
    "vout" : [
        {
            "n" : 0,
            "addresses" : [
                "1YPkA7C8ARo9gduihmc7pT2cGvK8R6YhE16iL6"
            ],
            "type" : "pubkeyhash",
            "ismine" : true,
            "iswatchonly" : false,
            "amount" : 0.00000000,
           
"assets" : [
                {
                    "name" : "test1",
                    "assetref" : "228-267-82",
                    "qty" : 50000.00000000,
                    "type" : "transfer"
                }
            ]
,
            "permissions" : [
            ],
            "items" : [
            ]
        },
        {
            "n" : 1,
            "addresses" : [
                "1PmbQGuUfjDG4TMFVDnEuPDukm4f7dDLZvetVs"
            ],
            "type" : "pubkeyhash",
            "ismine" : true,
            "iswatchonly" : false,
            "amount" : 0.00000000,
           
"assets" : [
                {
                    "name" : "test1",
                    "assetref" : "228-267-82",
                    "qty" : 999950000.00000000,
                    "type" : "transfer"
                }
            ]
,
            "permissions" : [
            ],
            "items" : [
            ]
        }
    ],
    "hex" : "0100000001b31e17e16fb2614de90ad8dcf2e549bbb494a811740fa46bb343dcf3ea7e0052000000006b483045022100dbde5095d432997253eb1458ba2a753f68b38bf550390dd942b518d2cb70357e02200f9076c6d39c0be47cd50f597b4e39ea3c72e7fd7efeda86a86f314947aa061501210305c36328497680379e6a3c0e2bbfb0c376ee9a9be7099554adc3601b027a161dffffffff0200000000000000003776a914e844a2cf4e1cc8b2b483e60badc9da078b7b263f88ac1c73706b71b494a811740fa46bb343dcf3ea7e0052a0860100000000007500000000000000003776a914a8770acfad4ca4dc79a30dcedc4ee5b2c083305388ac1c73706b71b494a811740fa46bb343dcf3ea7e0052600d3477000000007500000000"
}

asked Apr 5, 2017 by Cypher

1 Answer

+1 vote
 
Best answer

Yes, this looks wrong. The most likely explanation is that you subscribed to this asset with the rescan parameter set to false, so the preceding transaction is missing from the index. Does that make sense? If so it's legitimate for this API not to show the correct values, but it should t show incorrect ones either. Please confirm then we can address this issue as appropriate.

answered Apr 5, 2017 by MultiChain
selected May 29, 2019 by Cypher
I subscribed to this asset without explicitly mentioning the rescan parameter, which means it would take "true" by default as per the instructions from the "help" command. I'm using the latest version of multichain. Does it work that way?
Ok, let me forward this on and we'll see how to proceed.
We've found the bug and fixed it internally. It's the issuance transaction output not being included in the calculation. An immediate workaround is to ignore these values for the first spend after an issuance. But let us know if you need an unofficial build which fixes this.
Thanks. An unofficial build will be helpful.
You on Linux?
Ya. The server is running on linux.
Is the unofficial build available?
Not yet - don't worry - we'll let you know!
The hotfix version (1.0 beta 1.1) is now available here:

http://www.multichain.com/download/multichain-1.0-beta-1.1.tar.gz

There is no need to reindex the chain to get the right output.
...