CryptoPonzi
CryptoPonzi copied to clipboard
getAddress bug
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.
I agree, would like to see this corrected or explained.
I fixed it here:
https://github.com/ClamBaker/CryptoPonzi/pull/2
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.
Do you have an example of a txid which has the address in the asm field but not in the addresses list?