[补丁] 实现 'xlisttransactions'

中本聪SN-1713

你需要用 listtransactions 做什么?

What are you needing to use listtransactions for?

我当初不实现 listtransactions,就是想确保 web 程序员不会用它。人们很容易顺手拿它来盯收到的付款。走那条路没有任何可靠的办法保证什么都不漏。在我们拿出可靠的示例代码、演示 getreceivedbyaddress 和 getreceivedbylabel 的用法,并能指着代码说「用这个!用这个!别用 listtransactions!」之前,我认为不应该实现 listtransactions。

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.

真要实现的时候,也许防止这种误用的一个办法是把它做成纯文本。不要把字段拆成 comment、confirmations、credit、debit 之类。可以是一个格式化好的字符串,比如 "0/unconfirmed 0:0:0 date comment debit 4 credit 0" 什么的,让程序员难以误用它来做程序化解析。它只是用来看服务器状态的。不过我猜这对想把内容格式化成 html 表格的 web 界面来说会有点烦。

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.

上下文
译文校对、修订与纠错

当前版本尚未建立逐条校对状态记录。来源核验、历史审校与当前译文校对是不同事项。

查看历史审校与代表修订 →

译文内容版本:3b3b6db45451。用于比对文本,不代表校对等级或更新时间。

准备纠错说明

请填写对应原文、现译文、建议译法和理由。复制后通过你联系本站作者的渠道提交;此处不会自动发送。

来源
英文原标题

[PATCH] implement 'xlisttransactions'

Bitcointalk · 原始链接 ↗ 记录编号 SN-1713

阅读字号

选择适合你的字号,之后阅读会继续使用。