Hi,
1) Lets say I create and broadcast a transaction of txid A and it receives 1 confirmation. Then there is a fork and the chain with that transactions ends up being a stale/orphan chain.
That transaction with that txid A is not included in any blocks on the best chain.
If I use bitcoin core and call GetTransaction A, what would that return? and how many confirmations would it show?
Assuming that that transaction did not go back into the mempool, then it would return as 0 confirmations, and after some time it may not even return a transaction at all.
2)Also, there has been a lot of mention of orphan blocks recently i.e. Chinese orphan rate etc. People seem to refer to blocks not on the best chain as orphan blocks. If I understand correctly that use is wrong and what people are referring to are actually stale blocks, with orphan blocks being something completely different
https://bitcoin.org/en/developer-guide#orphan-blocksOr am I missing something?
Stale Blocks are a regular appearance, why and how often do actual orphan blocks occur? (orphan being blocks that do not have parent block)
By that definition of orphan blocks, it happens incredibly frequently, but only to a node. It is impossible to have a block to not have a parent block, but it is possible for a node to receive a block but does not know of the parent block. I would imagine it happens very frequently with the current sync method but it is always resolved.
In most cases, orphan blocks and orphan rate will refer to stale blocks
3) Is there a way to create my own blocks with only transactions I want included, if I am running Bitcoin core in regtest mode?
Yes and no. It is possible to include whatever transactions you want in a block, but it requires a code change. You would need to go into the code and change the mechanism which includes transactions into blocks in order to do this.