Re: Proposed change to sendtoaddress API call

Figures: knightmb
Quote from: gavinandresen on August 13, 2010, 8:26:06 PM UTC
Quote from: Jeff Garzik on August 13, 2010, 8:13:30 PM UTC

What happens when we desire to return additional information, beyond tx-id?

For the sake of future compatibility, it seems like the flag should present a choice between returning (a) just the current ‘sent’, or (b) a JSON map containing tx-id, and perhaps other things.

A ‘gettransaction tx_id’ API call is on my short list.

What do other folks think; should sendtoaddress … true return just the tx_id, and you have to make another API call to get details if you need them? Or should it return an Array?

Depends on how fancy you want to be.

If you go beyond a boolean, you could just append flags for any reason or function needed. This would leave it open to more functions rather than stacking a ton of booleans on the function as it’s usefulness grows.

sendtoaddress [comment] [comment-to] -tx_id : returns the tx ID of the receiving bitcoin address -dance : returns dance high scores -moon : return current moon phase

So one would simply put in sendtoaddress -tx-_id [comment] [comment-to] instead of sendtoaddress [comment] [comment-to] true false true true false if a lot of functions were added to it later.