1
I'm working my way through Mastering Bitcoin. The author made a transaction to send 0.05 BTC from one address to another (http://chainquery.com/bitcoin-api/getrawtransaction/ae74538baa914f3799081ba78429d5d84f36a0127438e9f721dff584ac17b346/1)
In the book, he runs the following command to get the transaction details:
bitcoin-cli gettransaction ae74538baa914f3799081ba78429d5d84f36a0127438e9f721dff584ac17b346
The JSONRPC returns the following object:
{
"details":[
{
"account":"",
"address":"1LnfTndy3qzXGN19Jwscj1T8LR3MVe3JDb",
"category":"send",
"amount":-0.02500000,
"fee":-0.00050000
},
{
"account":"",
"address":"1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL",
"category":"send",
"amount":-0.02450000,
"fee":-0.00050000
},
{
"account":"",
"address":"1LnfTndy3qzXGN19Jwscj1T8LR3MVe3JDb",
"category":"receive",
"amount":0.02500000
},
{
"account":"",
"address":"1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL",
"category":"receive",
"amount":0.02450000
}
]
}
Why is there an object with the receiving address (1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL) with the category "send"?
Shouldn't there only be 3 objects nested under "details" (i.e. 1 input and 2 outputs)?
I had someone else look at it as well and he told me it might be how bitcoin handles the transaction on the accounting side? I'll have to look into this some more – Huy – 2018-10-13T16:59:09.687