Bitcoin Forum
November 14, 2024, 01:28:24 PM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Determining the account associated with a given txid+vout  (Read 952 times)
jon_smark (OP)
Member
**
Offline Offline

Activity: 90
Merit: 10


View Profile
October 15, 2012, 05:37:43 PM
 #1

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.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1026



View Profile
October 16, 2012, 01:04:25 PM
 #2

Why do you want to know?

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
jon_smark (OP)
Member
**
Offline Offline

Activity: 90
Merit: 10


View Profile
October 17, 2012, 01:14:39 PM
 #3

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
*
Offline Offline

Activity: 1302
Merit: 1026



View Profile
October 17, 2012, 06:33:34 PM
 #4

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.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
jon_smark (OP)
Member
**
Offline Offline

Activity: 90
Merit: 10


View Profile
October 17, 2012, 08:47:43 PM
 #5

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
*
Offline Offline

Activity: 1302
Merit: 1026



View Profile
October 18, 2012, 04:37:47 AM
 #6

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.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!