Author

Topic: getTransaction on Stale Chain (Read 604 times)

sr. member
Activity: 412
Merit: 275
December 25, 2015, 04:16:18 PM
#3
[1]: GetTransaction will return false, and will not set the hash/blockhash because it doesn't exist in the main chain. Bitcoin Core doesn't dispose of these blocks, but GetTransaction only reports from the main chain.

[2]: Unusual, I had the same impression, that orphans were those that just fall out due to the greatest work rule. Perhaps the stale blocks term has fallen out of use.

[3]: Regtest is unlike testnet, you don't need other peers. You can just spend your regtest generated coins, and every time you call `generate`, the mempool transactions will be included a block.
staff
Activity: 3374
Merit: 6530
Just writing some code
December 25, 2015, 11:39:00 AM
#2
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-blocks

Or 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.
sr. member
Activity: 277
Merit: 253
December 25, 2015, 07:55:58 AM
#1
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?


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-blocks

Or 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)

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?


Thanks for help Smiley

Jump to: