Bitcoin Forum
May 14, 2024, 01:22:25 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: getTransaction on Stale Chain  (Read 603 times)
danielW (OP)
Sr. Member
****
Offline Offline

Activity: 277
Merit: 253


View Profile
December 25, 2015, 11:55:58 AM
Last edit: December 25, 2015, 12:56:29 PM by danielW
Merited by ABCbits (2)
 #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

1715649745
Hero Member
*
Offline Offline

Posts: 1715649745

View Profile Personal Message (Offline)

Ignore
1715649745
Reply with quote  #2

1715649745
Report to moderator
1715649745
Hero Member
*
Offline Offline

Posts: 1715649745

View Profile Personal Message (Offline)

Ignore
1715649745
Reply with quote  #2

1715649745
Report to moderator
1715649745
Hero Member
*
Offline Offline

Posts: 1715649745

View Profile Personal Message (Offline)

Ignore
1715649745
Reply with quote  #2

1715649745
Report to moderator
Bitcoin addresses contain a checksum, so it is very unlikely that mistyping an address will cause you to lose money.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6637


Just writing some code


View Profile WWW
December 25, 2015, 03:39:00 PM
Merited by ABCbits (2)
 #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.

fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 275


View Profile
December 25, 2015, 08:16:18 PM
Merited by ABCbits (2)
 #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.

Bitwasp Developer.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!