CryptoPonzi icon indicating copy to clipboard operation
CryptoPonzi copied to clipboard

getAddress bug

Open dooglus opened this issue 9 years ago • 4 comments

What's this code trying to do?

    if ($vinvout == 1)
        $vinvout = 0;
    else
        $vinvout = 1;

    $address = $transactionin['vout'][!$vinvout]['scriptPubKey']['addresses'][0];
    return $address;

It results in the wrong vout being used for any vinvout > 1.

dooglus avatar Oct 27 '15 17:10 dooglus

I agree, would like to see this corrected or explained.

Seagulls avatar Nov 01 '15 11:11 Seagulls

I fixed it here:

https://github.com/ClamBaker/CryptoPonzi/pull/2

dooglus avatar Nov 02 '15 04:11 dooglus

I came up with the same solution as well, but I went even further and modified it to decode the address from the "asm" field which is more reliable as the "addresses" field is not always present.

Seagulls avatar Nov 03 '15 00:11 Seagulls

Do you have an example of a txid which has the address in the asm field but not in the addresses list?

dooglus avatar Nov 03 '15 05:11 dooglus