Usability issue: bitcoind gives an incorrect error message when one tries to dumppriv a key while the wallet is still locked. Unlike the other commands I've tried which immediately point to the lock as the reason for the failure, dumppriv emits a frightening message that the private key does not exist (implying one has completely lost the funds at that address). The relevant code should do the same check for lock as the other commands.
Installed version (Debian testing):
$ apt-cache show bitcoind
Package: bitcoind
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 2648
Maintainer: Debian Bitcoin Packaging Team <pkg-bitcoin-devel@lists.alioth.debian.org>
Architecture: amd64
Source: bitcoin
Version: 0.8.3-1
Depends: libboost-filesystem1.49.0 (>= 1.49.0-1), libboost-program-options1.49.0 (>= 1.49.0-1), libboost-system1.49.0 (>= 1.49.0-1), libboost-thread1.49.0 (>= 1.49.0-1), libc6 (>= 2.15), libdb5.1++, libgcc1 (>= 1:4.1.1), libleveldb1, libminiupnpc5, libssl1.0.0 (>= 1.0.0), libstdc++6 (>= 4.6), zlib1g (>= 1:1.1.4)
Suggests: db-util, db4.8-util
...
The problem:
$ # normal, helpful, meaningful error message with a locked wallet:
$ bitcoind sendfrom 1AZvaBEJMiK8AJ5GvfvLWgHjWgL59TRPGy 1BWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW 1
error: {"code":-13,"message":"Error: Please enter the wallet passphrase with walletpassphrase first."}
$ # problematic error message with dumpprivkey:
$ bitcoind dumpprivkey 1AZvaBEJMiK8AJ5GvfvLWgHjWgL59TRPGy
error: {"code":-4,"message":"Private key for address 1AZvaBEJMiK8AJ5GvfvLWgHjWgL59TRPGy is not known"}
$ # don't give me a heart attack like that - the private key *is* known! we just need to unlock the wallet:
$ bitcoind walletpassphrase XXXXXXXXXXXXXXXXXXXX 60
$ bitcoind dumpprivkey 1AZvaBEJMiK8AJ5GvfvLWgHjWgL59TRPGy
KwpYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY