Difference between revisions of "P2pool util forest"

From Bitcoin Wiki
Jump to: navigation, search
(p2pool/util/forest.py)
(p2pool/util/forest.py)
Line 1: Line 1:
==p2pool/util/forest.py==
 
 
This contains code for tracking shares.
 
This contains code for tracking shares.
 +
==Class Tracker==
 +
Number of dictionaries that store the shares in various ways to allow fast access.
 +
# shares (hash->share) Since share contains parent share allows you to link to previous shares all the way to the tail.
 +
# reverse_shares (delta.tail->set of share_hashes) Allows you to link share to the next share that came after it all the way to the head.
 +
# deltas (share_hash -> delta, ref)
 +
# reverse_deltas (ref -> set of share_hashes)
 +
# delta_refs (ref -> delta)
 +
# reverse_delta_refs ( delta.tail -> ref)
 +
 +
'''what are deltas???''' I have not got my head round this code at all!
 +
===Method add===
 +
Adds a share to the tracker

Revision as of 18:58, 24 June 2012

This contains code for tracking shares.

Class Tracker

Number of dictionaries that store the shares in various ways to allow fast access.

  1. shares (hash->share) Since share contains parent share allows you to link to previous shares all the way to the tail.
  2. reverse_shares (delta.tail->set of share_hashes) Allows you to link share to the next share that came after it all the way to the head.
  3. deltas (share_hash -> delta, ref)
  4. reverse_deltas (ref -> set of share_hashes)
  5. delta_refs (ref -> delta)
  6. reverse_delta_refs ( delta.tail -> ref)

what are deltas??? I have not got my head round this code at all!

Method add

Adds a share to the tracker