bitcoin/bitcoin — Issue #909: 'sendfrom' used incorrect account name one time
Author: dooglus
Created: 2012-02-28 11:57:01+00:00
State: open

Every day or two I run a script to move bitcoins between local and remote wallets. The script hasn't been changed since 16th Feb, but one time when I ran it a few days ago it sent coins from the "" account, not the one I told it to.

The script runs:
bitcoind sendfrom name $address $amount

which should debit the "name" account. And every time except for one that's what it did. Now, however, if I check the balance of the "name" account, it is too high by the amount I transferred the time it went wrong, and if I "listtransactions" the transaction in question has:
. "account" : "",
instead of
. "account" : "name",

I don't know how to get this to happen again - it's been fine for 6 months, only going wrong this one time. It has been working again since the time it went wrong.

I doubt it matters, but this is the script I use. It's in a Makefile, so most of the $'s are doubled up:

move:
@x=$$($(BITCOIND) getbalance name 0) || exit;	\
echo $$x | sed -E 's/[.]?00000000$$//';	\
echo -n "amount: "; read Y; Y0=$$Y"00000000";	\
echo "send $$Y BTC to $(ADDRESS)?";	\
echo -n "wallet passphrase: "; read X; echo;	\
$(BITCOIND) walletpassphrase "$$X" 300 &&	\
($(BITCOIND) sendfrom name $(ADDRESS) $$Y;	\
$(BITCOIND) walletlock;	\
ssh server "echo \"$$(date) - received $$Y BTC at $(ADDRESS)\" >> wallet.log";	\
$(BITCOIND) getbalance name 0 |	\
sed 's/00000000$$//')