Title: Interesting accidental feature of bitcoind Post by: casascius on October 17, 2012, 04:37:17 PM I thought I would point out an accidental feature of bitcoind - or at least bitcoind with a minor modification.
I make no secret of the fact that I like storing my bitcoins on paper wallets instead of in online wallets, and that I own a handheld USB bar code scanner that helps me do that movement. One thing I always do when I download a new version of bitcoind is I find the code for the "importprivkey" command and knick out the code that causes a full block chain rescan after importing each key. I simply comment it out and recompile. This is so I can import large batches of private keys, and then shut down bitcoind and do a single rescan to catch them all. (this also helps if I, for example, am doing a wallet recovery where I have 100+ private keys to import). In the past, I would often modify the rescan command to take an argument: -rescan=180000 (for example) would start the rescan from block 180000, saving time if I knew I was only importing recently received payments. Ever since I switched my bitcoin machine to using an SSD, it's been fast enough to not be worth the bother, but others might benefit from this same modification. So anyway... I have noticed that if I import a private key to which I have already sent bitcoins from that same wallet, that bitcoind sees the funds without needing a rescan. This feature is actually a nice unintended benefit, because it means that I can move my coins from my hotwallet on to paper, and then put them back in for immediate use whenever I want. I figure someone might explain "yes, this works because the wallet is always scanned for transactions belonging to it, and the existence of a 'send' transaction from the wallet meets the criteria and results in the match" (assuming that's actually the case). Another thing I might point out is that the "sendmany" command has two flaws, at least in the version of bitcoind I'm using. First, unlike "sendtoaddress", it demands that I wait 6 confirmations before sending coins that I sent to myself. (I often send coins to myself to consolidate txid's into one, because I like my Casascius Coins to appear in block explorers as being funded by a single address rather than a hodgepodge of customer payment addresses). Second, the fact that sendmany requires an "account" to send from is a little bit annoying, and there ought to be a way to just put a value there to mean "send from any/all accounts". This second thing mainly gets in others' way rather than mine (since my incoming funds are sourced through private key imports, they always have an account ID of an empty string, and can all be spent just by specifying "" as the account name). |