Bitcointalk

[PATCH] implement 'xlisttransactions'

中本聪 · 2010 年 7 月 30 日

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.

上下文
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-1713

阅读字号

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