1

I have a situation where I create one address per user through GetNewAddress(User.Id)

So, in the end, I have a lot of addresses to monitor, to see if any user has deposited money.

I can do something like this:

foreach (var User in Users)
{
  var T = GetReceivedByAccount(User.Id);
  .. do something if money arrived
}

Wait 30 seconds and repeat...

But I'm guessing it's not the most efficient.

Is there a better way to do this?

Or can I get all transactions within a specific range in the wallet and then parse them by account?

Sorry if the question seems basic, I'm extremely new to this.. got some code running for the first time something like 16 hours ago :)

Thomas
  • 125
  • 5
  • 3
    Does this answer your question? [Get notified of incoming Bitcoin transaction, as soon as it broadcasted](https://bitcoin.stackexchange.com/questions/21500/get-notified-of-incoming-bitcoin-transaction-as-soon-as-it-broadcasted) one answer says *"If using the wallet notify option in bitcoin.conf, you can get a notification any time a transaction occurs on the network that matches a bitcoin address in the wallet. To use this, of course, you'll have to keep Bitcoin-QT or bitcoind running at all times."* See also [How do I use walletnotify](https://bitcoin.stackexchange.com/q/24457/13866) – RedGrittyBrick Aug 06 '21 at 09:59

1 Answers1

0

We use a third party service for this - i’d recommend https://blockchainwebhooks.com - You can set a webhook for each address, and when a new transaction enters a block with this address as an input or output the webhooks will trigger and send you the transaction details. Hope this helps!

sizzlecookie
  • 436
  • 4
  • 9