11
2
I'm using JSON-RPC to send commands to my bitcoind, and it works fine.
Now I want to encrypt my wallet. When I've done that, I will need to send the passphrase when calling SendToAddress. How do I do that?
Right now I send these parameters:
- address
- amount
- comment
- commentTo
which are put into an array in the order above.
Will the passphrase be another parameter that I append as the last element in that array?
Thanks, David, it's working for me. One problem is that the timeout does not seem to work - so I always do "walletlock". This however creates the necessity to do walletpassphrase-sendtoaddress-walletlock inside a critical section, otherwise there would be a race condition. Also - "walletpassphrase" returns an error when called the second time, without having called "walletlock" in between... Do you know if this is by design? It would make life easier if "walletpassphrase" was idempotent. – bitboy9999 – 2011-10-27T11:32:37.640
You can treat error -15 (wallet already unlocked) as a form of success. Unfortunately, it seems this RPC is kind of in a sad state (or there's some 'right' way to use it neither of us know). I would suggest modifying 'sendtoaddress' to take a passphrase. – David Schwartz – 2011-10-27T11:39:20.080
1Absolutely, if "sendtoaddress" simply accepted a passphrase, it would be awesome! – bitboy9999 – 2011-10-27T13:20:34.550