I'm using bitcoind. Now I would like to access the transactions list of a particular account using the bitcoin-cli.
I am using the listtransactions accountname
command to get the transactions of a particular account.
Example:
listtransactions karthiktest
Result:
[
{
"account": "karthiktest",
"address": "mnXEfvmLFWz7Exn9oGaEeTN8Ayu7Le5CCz",
"category": "receive",
"amount": 0.30000000,
"label": "karthiktest",
"vout": 1,
"confirmations": 18,
"blockhash": "000000009d17b7b32567f9730b50f2b7e8623ae6c9d20f84d4c414914e214283",
"blockindex": 86,
"blocktime": 1507963431,
"txid": "c94307bef9ece4afe41384e2cd453f183aa7a438899723906e8967e624bc7d6f",
"walletconflicts": [
],
"time": 1507962288,
"timereceived": 1507962288,
"bip125-replaceable": "no",
"comment": "hello karthik",
"to": "from arun"
},
{
"account": "karthiktest",
"address": "miDMgiqduYevZMsRxX4qrY9BD5eXYFmEzg",
"category": "send",
"amount": -0.10000000,
"label": "mahesh123",
"vout": 0,
"fee": -0.00000765,
"confirmations": 17,
"blockhash": "0000000079c79a5d21af138c80544b307d4ac764b4ed343b84752114c77fc893",
"blockindex": 76,
"blocktime": 1507964632,
"txid": "516c64595c8b7be12419199dd81ae5edd3f4281aa3e52f88c7e3561b901bf881",
"walletconflicts": [
],
"time": 1507964172,
"timereceived": 1507964172,
"bip125-replaceable": "no",
"comment": "hello mahesh",
"to": "from karthik",
"abandoned": false
}
]
Here in the JSON, it is showing two transactions 1 receive
and 1 send
.
Now, My requirement is: for receive
transaction, I need to get the sender address and for send
transaction, I need to get the receiver address(this can be done using the account field). But I'm confused to get it with receive transaction.
Can anyone help me on this?