回复:[补丁] 实现“listtransactions”
原始发布页
打开来源页面查看 1 个交叉存档
你需要用 listtransactions 做什么?
我没有实现 listtransactions,是因为我想确保 Web 程序员不会使用它。人们很容易顺手用它来监视收到的付款。这样做并不可靠,无法确保没有任何付款从缝隙中漏掉。在我们有可靠的示例代码使用 getreceivedbyaddress 和 getreceivedbylabel,可以指给别人并说“用这个!用这个!不要用 listtransactions!”之前,我认为我们不该实现 listtransactions。
等我们实现 listtransactions 时,也许对付这种情况的一种办法是让它全部采用文本。它不应将字段拆分成诸如 comment、confirmations、credit、debit。它可以只是一条格式漂亮的字符串,比如“0/unconfirmed 0:0:0 date comment debit 4 credit 0”之类,让程序员难以用错误的方式处理它。它只用于查看服务器状态。不过我想,对于更希望将其格式化成 html 列的 Web 界面来说,这样可能有点烦人。
英文原文
展开英文原文
What are you needing to use listtransactions for?
The reason I didn't implement listtransactions is I want to make sure web programmers don't use it. It would be very easy to latch onto that for watching for received payments. There is no reliable way to do it that way and make sure nothing can slip through the cracks. Until we have solid example code using getreceivedbyaddress and getreceivedbylabel to point to and say "use this! use this! don't use listtransactions!", I don't think we should implement listtransactions.
When we do implement listtransactions, maybe one way to fight that is to make it all text. It should not break down the fields into e.g. comment, confirmations, credit, debit. It could be one pretty formatted string like "0/unconfirmed 0:0:0 date comment debit 4 credit 0" or something so it's hard for programmers to do the wrong thing and process it. It's only for viewing the status of your server. I guess that would be kinda annoying for web interfaces that would rather format it into html columns though.