Author

Topic: Determining the account associated with a given txid+vout (Read 949 times)

kjj
legendary
Activity: 1302
Merit: 1026
The database is going to be your best bet.

Way too expensive.  I reckon my original plan might be the cheapest option yet, even if convoluted.

Also, you might want to consider using the cold wallet to protect the hot wallet, not to protect individual accounts.

I may be missing what you intended to say, but the cold wallet is used to protect the hot wallet, which happens to have several accounts.  Note that these accounts are not associated with external users; they all belong to me, and are just separate for administrative/accounting purposes.

I can't imagine any possible database where a single query is going to be more expensive than a RPC call to bitcoind.

Change your administrative plan.  Smiley  What you are trying to do isn't worth it.  Set your policies based on the wallets, not the accounts.
member
Activity: 90
Merit: 10
The database is going to be your best bet.

Way too expensive.  I reckon my original plan might be the cheapest option yet, even if convoluted.

Also, you might want to consider using the cold wallet to protect the hot wallet, not to protect individual accounts.

I may be missing what you intended to say, but the cold wallet is used to protect the hot wallet, which happens to have several accounts.  Note that these accounts are not associated with external users; they all belong to me, and are just separate for administrative/accounting purposes.
kjj
legendary
Activity: 1302
Merit: 1026
The database is going to be your best bet.

Also, you might want to consider using the cold wallet to protect the hot wallet, not to protect individual accounts.
member
Activity: 90
Merit: 10
Why do you want to know?

Because I want to forward unspent transactions to a cold-wallet, and knowing the account would let me know immediately which cold-wallet to use.  Though I can derive this information by going through my databases, if Bitcoin were to tell me the associated account that would save me the costly database access...
kjj
legendary
Activity: 1302
Merit: 1026
Why do you want to know?
member
Activity: 90
Merit: 10
Calling listunspent gives me a list of {txid,vout,spk,amount,conf}.  I also want to determine the account associated with each item in that list.  This can be done in two steps: 1) calling getrawtransaction txid will get me the address associated with a txid+vout combination; 2) calling getaccount addr will finally get me the associated account.

This works, but is awfully convoluted.  Is there a more straightforward way?  I thought about calling gettransaction txid, which does provide account information associated with each "receive" address, but I'm not sure whether I can rely on the array order being exactly the same as the original vout.
Jump to: