Bitcoin Forum
May 06, 2024, 05:23:48 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Determining the account associated with a given txid+vout  (Read 935 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.
1714973028
Hero Member
*
Offline Offline

Posts: 1714973028

View Profile Personal Message (Offline)

Ignore
1714973028
Reply with quote  #2

1714973028
Report to moderator
1714973028
Hero Member
*
Offline Offline

Posts: 1714973028

View Profile Personal Message (Offline)

Ignore
1714973028
Reply with quote  #2

1714973028
Report to moderator
1714973028
Hero Member
*
Offline Offline

Posts: 1714973028

View Profile Personal Message (Offline)

Ignore
1714973028
Reply with quote  #2

1714973028
Report to moderator
The Bitcoin network protocol was designed to be extremely flexible. It can be used to create timed transactions, escrow transactions, multi-signature transactions, etc. The current features of the client only hint at what will be possible in the future.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714973028
Hero Member
*
Offline Offline

Posts: 1714973028

View Profile Personal Message (Offline)

Ignore
1714973028
Reply with quote  #2

1714973028
Report to moderator
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1024



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: 1024



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: 1024



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!