{ "subject": "Re: JSON-RPC method idea: list transactions newer than a given txid", "content": { "format": "html", "body": "<div class=\"post\">It's not safe to use listtransactions this way.<br/><br/>I know I've been criticized for being reluctant about listtransactions. &nbsp;Let me explain my reluctance.<br/><br/>Transactions are dynamic. &nbsp;Past transactions can become unconfirmed, go away and come back, become invalid and disappear, or be replaced by a different double-spend. &nbsp;Their date can change, their order can change.<br/><br/>Programmers are naturally inclined to want to use listtransactions like this: feed me the new transactions since I last asked, and I'll keep my own tally or static record of them. &nbsp;This will seem to work in all regular use, but if you use the amounts for anything, it is highly exploitable:<br/>1) How do you know if a past transaction becomes invalid and disappears?<br/>2) When there's a block-chain reorg, it would be easy to double-count transactions when they get confirmed again.<br/>3) A transaction can be replaced by a double-spend with a different txid. &nbsp;You would count both spends.<br/><br/>The model where you assume you only need to see new transactions because you've already seen previous transactions is not true. &nbsp;Old transactions can change at any time.<br/><br/>Any time you take an action based on payment amounts received, you always need to go back to bitcoin and ask for a current balance total (or use move or sendfrom), and be ready for the possibility that it can go down.<br/><br/>Now that we have the Accounts feature making it easier to do it the right way, we're better prepared to have listtransactions.<br/></div>" }, "source": { "name": "Bitcoin Forum", "url": "https://bitcointalk.org/index.php?topic=2151.msg28228#msg28228" }, "date": "2010-12-08T20:21:49Z" }
Inscription number 18,210,072
Genesis block 799,367
File type json
File size 2 KB
Creation date