Monitor a bunch of addresses for deposits

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

Posted 2017-11-01T00:07:33.960

Reputation: 125

Answers

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

Posted 2017-11-01T00:07:33.960

Reputation: 366