Bitcoin Forum
May 21, 2024, 05:24:59 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is there any way to mark/flag a specific transaction using bitcoind/rpc?  (Read 1118 times)
bitfreedom (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
December 07, 2014, 12:37:13 AM
 #1

For example to add a flag or comment to indicate that a transaction has been seen and/or processed.

I know it's possible to move addresses between accounts, which would achieve this at the address level

However, I also want to mark individual transactions that involve the same address/set of addresses without resorting to another state store/ database etc
lontivero
Full Member
***
Offline Offline

Activity: 164
Merit: 128

Amazing times are coming


View Profile
December 07, 2014, 04:35:27 AM
 #2

No, there isn't any built-in way to mark/flag a specific transaction with bitcoind/rpc just because the blockchain (the data structure where transactions are saved) doesn't provide any place for custom data.

You can implement your own marking system but that will require a database.
bitfreedom (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
December 07, 2014, 05:00:43 AM
 #3

Thanks. I was wondering more about storing this state against the wallet data structures. For example the blockchain has no notion of named accounts and address groupings, but the wallet certainly does.
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5208
Merit: 12998


View Profile
December 07, 2014, 07:06:21 AM
Last edit: December 07, 2014, 07:29:32 AM by theymos
 #4

There's an old issue open for that feature:
https://github.com/bitcoin/bitcoin/issues/2086

If you really don't want to use any sort of external database, one thing you could do to mark the last transaction you've processed would be to create a new local-only transaction with the move command whenever you're done processing transactions, and then only go back to the last move transaction when processing. You can also give these move transactions comments when you create them that will show up in listtransactions. But you don't want to fill your wallet with these transactions, and it's a pain to delete transactions from a Bitcoin Core wallet, so you should probably only do this if you're polling your wallet infrequently. If there's any way at all that you can store data outside of Bitcoin Core, then it'll be way better to just remember the timestamp of the last transaction you processed and then go back up to that next time.

Note that processing transactions in order using any of these approaches (including the marking thing that you want to do) is not reorg-safe: you might accept a transaction as confirmed that later becomes invalid, but you wouldn't detect this. So this approach might not be appropriate for payment processing. It's usually better to use accounts, listsinceblock, or walletnotify.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
bitfreedom (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
December 09, 2014, 07:10:49 AM
 #5

Thanks for your answer theymos. I'll bite the bullet and go with a db.
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!