Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAddress bug #13

Open
dooglus opened this issue Oct 27, 2015 · 4 comments
Open

getAddress bug #13

dooglus opened this issue Oct 27, 2015 · 4 comments

Comments

@dooglus
Copy link

dooglus commented Oct 27, 2015

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.

@Seagulls
Copy link

Seagulls commented Nov 1, 2015

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

@dooglus
Copy link
Author

dooglus commented Nov 2, 2015

I fixed it here:

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

@Seagulls
Copy link

Seagulls commented Nov 3, 2015

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.

@dooglus
Copy link
Author

dooglus commented Nov 3, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants