I'm building a web application that uses bitcoind's accounts to track user balances. My dev env is currently in regtest
mode. I am working on calculating the network transaction fee prior to creating a raw transaction.
When I listunspent
to bitcoind over JSON-RPC, I get a multidim array that includes txid, address, and scriptPubKey (amongst other things). How can I use this information to determine which account these utxo's are tied to? I thought I'd be able to use getaccount
with the returned corresponding addresses, but I'm returned an empty string. Is that because the transaction originated from the wallet 'global' account? Is that something to do with regression testing mode?
I also tried listtransactions
for the specific account to match txid, but didn't have txid's because they were moves. Even if I could do this for network transactions, how would I handle utxo's that were resulting from a move?
I can getbalance
for different accounts and see the correct resulting balances from using the move
command. I'm beginning to question a few things so I'm not sure where I have an problem or if I'm going about this the wrong way. Ultimately, my goal is to be able to calculate tx fee so the user can approve them before sending...keeping in mind single wallet with each user having their own account.
Thanks for the help! ...it's late and my head hurts lol
sendfrom
choose its utxo's to ensure spending from the right account? i see from your links that performance would likely wain the more and more accounts you have, but could you predict the utxo's the wallet will choose for asendfrom
knowing that it will always attempt to pull from the default account? i've seen other posts mentioning the routine but not in regards to accounts – Jon B Oct 26 '14 at 22:19createrawtransaction
andsignrawtransaction
. – morsecoder Oct 27 '14 at 02:57