That depends on what information you want.
For example, if you want the block height of the block where the transaction was first confirmed, you could use a combination of getrawtransaction and getblock.
Here's an example using transaction ID 584955e07e3b87bb23446e704c73ce2332ce21adca1798ca1b8590d414a87bd7:
Command:
- snip -
"blockhash" : "000000000000000000c38b7591b174ca4915ced5ff5dc8d9b1883df56899139d",
"confirmations" : 11,
- snip -
}
Command:
- snip -
"confirmations" : 11,
"size" : 737575,
"height" : 401460,
- snip -
As you can see, the transaction was first confirmed in the block at height 401460 in the block with hash 000000000000000000c38b7591b174ca4915ced5ff5dc8d9b1883df56899139d
Therefore, if 401460 is less than your target block height, the transaction had at least one confirmation at the time of the target block.
How do you plan on handling re-orgs (where transactions that were confirmed with only 1 or 2 confirmations may become unconfirmed)?
Does it matter how many confirmations the transaction has, or do you just need ot know that it has at least 1?
Thanks Danny! This actually seems like the perfect solution.
As far as reorgs, I won't pay out until 4-6 confirmations, however I just need to know that the transaction was confirmed in or before the target block. It does not need to get calculated at the time of the target block. It can happen just before payout. Any opinion as to what a safe time to do that is? I was thinking 6, but would 4 confirmations be enough to calculate the results?
Having the correct block height and hash for the target is crucial as each team will have a chance of winning proportional to the amount each team has wagered and since it is provably fair, I will be using a blockhash + server secret method.
EDIT: Looks like I need to build a tx index with this method. Will report back. Thanks again Danny.