Bitcoin Forum
April 30, 2017, 07:06:34 PM *
News: If the forum does not load normally for you, please send me a traceroute.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [PULL] Report immature coinbase txns in listtransactions  (Read 2001 times)
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
April 06, 2011, 01:53:15 PM
 #1

https://github.com/bitcoin/bitcoin/pull/138

I think this is ready:
Quote
This patch adds immature generated blocks to listtransactions. They are reported just like mature blocks, except the category is 'immature' instead of 'generate'.

This functionality is needed by people creating alternative, JSON-RPC-based GUIs, and is useful for impatient miners who currently grep through debug.log or use unofficial patches to see not-yet-mature blocks they've generated.

I found one edge case during testing, and after discussion on #bitcoin-dev changed the information reported.  The edge case was reporting the coinbase transactions from orphaned blocks.  Here's the scenario:

+ As soon as you generate a block, the coinbase transaction goes into your wallet as a 1-confirmation transaction.  Before this patch, that transaction was not listed in the listtransactions output.  With this patch, it is (as "category" : "immature", "confirmations" : 1).

+ If that block is orphaned, the coinbase transaction is no longer valid.  With this patch, it will be reported at "category" : "orphan", "confirmations" : 0

+ When a coinbase transaction has 120 confirmations, it will be reported as "category" : "generate" (as before).

How often do you get the chance to work on a potentially world-changing project?
1493579194
Hero Member
*
Offline Offline

Posts: 1493579194

View Profile Personal Message (Offline)

Ignore
1493579194
Reply with quote  #2

1493579194
Report to moderator
1493579194
Hero Member
*
Offline Offline

Posts: 1493579194

View Profile Personal Message (Offline)

Ignore
1493579194
Reply with quote  #2

1493579194
Report to moderator
1493579194
Hero Member
*
Offline Offline

Posts: 1493579194

View Profile Personal Message (Offline)

Ignore
1493579194
Reply with quote  #2

1493579194
Report to moderator
There are several different types of Bitcoin clients. Header-only clients like MultiBit trust that the majority of mining power is honest for the purposes of enforcing network rules such as the 21 million BTC limit. Full clients do not trust miners in this way.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1493579194
Hero Member
*
Offline Offline

Posts: 1493579194

View Profile Personal Message (Offline)

Ignore
1493579194
Reply with quote  #2

1493579194
Report to moderator
1493579194
Hero Member
*
Offline Offline

Posts: 1493579194

View Profile Personal Message (Offline)

Ignore
1493579194
Reply with quote  #2

1493579194
Report to moderator
1493579194
Hero Member
*
Offline Offline

Posts: 1493579194

View Profile Personal Message (Offline)

Ignore
1493579194
Reply with quote  #2

1493579194
Report to moderator
Luke-Jr
Legendary
*
expert
Online Online

Activity: 2142



View Profile
April 18, 2011, 04:17:08 PM
 #2

Here is a patch that implements (in a hacky way) what I was trying to suggest on IRC:

http://luke.dashjr.org/programs/bitcoin/w/bitcoind/luke-jr.git/commitdiff/eb5778feee7bc1e742620b149e265342832a745b

Changing category of a transaction is rather ugly, especially when the same status concept applies to regular transactions as well.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!