Bitcoin Forum
December 15, 2017, 05:40:37 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Determining the account associated with a given txid+vout  (Read 834 times)
jon_smark
Member
**
Offline Offline

Activity: 90


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.
1513316437
Hero Member
*
Offline Offline

Posts: 1513316437

View Profile Personal Message (Offline)

Ignore
1513316437
Reply with quote  #2

1513316437
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1513316437
Hero Member
*
Offline Offline

Posts: 1513316437

View Profile Personal Message (Offline)

Ignore
1513316437
Reply with quote  #2

1513316437
Report to moderator
kjj
Legendary
*
Offline Offline

Activity: 1302



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

Why do you want to know?

p2pcoin: a USB/CD/PXE p2pool miner - 1N8ZXx2cuMzqBYSK72X4DAy1UdDbZQNPLf - todo
I routinely ignore posters with paid advertising in their sigs.  You should too.
jon_smark
Member
**
Offline Offline

Activity: 90


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



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.

p2pcoin: a USB/CD/PXE p2pool miner - 1N8ZXx2cuMzqBYSK72X4DAy1UdDbZQNPLf - todo
I routinely ignore posters with paid advertising in their sigs.  You should too.
jon_smark
Member
**
Offline Offline

Activity: 90


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



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.

p2pcoin: a USB/CD/PXE p2pool miner - 1N8ZXx2cuMzqBYSK72X4DAy1UdDbZQNPLf - todo
I routinely ignore posters with paid advertising in their sigs.  You should too.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!