steppsr / getxchtxPS

XCH Transaction Exporter : getxchtxPS [Powershell Edition]
Apache License 2.0
4 stars 0 forks source link

chia get_transactions does not return all change transactions, so tx_removals doesn't sum up correctly. #11

Open bobsixtyfour opened 1 year ago

bobsixtyfour commented 1 year ago

Not sure this project is active anymore but I'm leaving this message as a FYI I've noticed an issue with chia get_transactions, it doesn't return all the additions/removals. So the script might say you have a transaction with 1.75 xch instead of 8.

Not sure what the purpose of manually adding the individual additions/removals, but commenting out the loop that counted those fixed it for me.

steppsr commented 1 year ago

I haven't heard about Chia CLI not returning all the removals properly. Admittedly, I haven't tested it recently.

But for the summing the removals, it is necessary on Outgoing transactions to account for the 'change' back from the transaction. The amount alone can't be used because it includes the change back coins.

For example, if you went to a store and your total was $12, but all you had was two $10 bills, you'd give two $10s to the store and they'd give you back one $5 bill and three $1 bills. If you don't account for the "20" going out, your total would be 4 (12 out minus the 8 change back... which isn't correct. I'm not sure why Chia reports it this way). You might check some of your Outgoing Transactions to make sure this scenario is accounted for properly.