I've not been able to figure out why I can't relaiably get the senders address using bitcoind 8.1 on the json API with php.
foreach ($bitcoin->listtransactions() as $transaction) {
if ($transaction['category'] == 'receive') {
$info['account'] = $transaction['account'];
$info['address'] = $transaction['address'];
$info['amount'] = $transaction['amount'];
$info['confirmations'] = $transaction['confirmations'];
$info['time'] = $transaction['timereceived'];
$info['txid'] = $transaction['txid'];
$txdetails = $bitcoin->getrawtransaction($transaction['txid'],(int)1);
foreach ($txdetails['vout'] as $vout) {
if ($vout['value'] $info['amount']) {
$info['sender'] = $vout['scriptPubKey']['addresses']['0'];
}
}
}
The result I get is
Array
(
[account] => Pool
[address] => n3YgVTznqBCTb5ghWwNUoSmn5z37vfg4VK
[amount] => 2
[confirmations] => 7
[time] => 1368107164
[txid] => 94a25aac9e26b19cbf3c0afd4e7689047e33f9adbea4bbe9d5bd198cdc918717
[sender] => mvoiUMUyR5QvX1Z2SYBAqT9eK6rjuQGVCF
)
But the address I get in the [address] does not receive anything I send back to it.
What am I missing?