Documentation ¶
Index ¶
- Constants
- Variables
- type Share
- type ShareChain
- func (sc *ShareChain) GenerateMinerPayouts(minerAddress types.UnlockHash, subsidy types.Currency) (payouts []types.SiacoinOutput, err error)
- func (sc *ShareChain) GetPPLNSSummary() (sharesummary map[string]int, err error)
- func (sc *ShareChain) HeaderForWork(payoutaddress string) (blockheader types.BlockHeader, target types.Target, err error)
Constants ¶
View Source
const (ShareChainLength = 8640 * 4 ShareTime = 30 ShareDifficulty = 1 * 1000 * 1000 * 1000 * 3600 * 12 )
View Source
const (
// DatabaseFilename contains the filename of the database that will be used
DatabaseFilename = "sharechain.db"
)
Variables ¶
View Source
var ( // ShareChain pool. ShareChainPool = []byte("ShareChainPool") )
Functions ¶
This section is empty.
Types ¶
type ShareChain ¶
ShareChain holds the previous shares of the pool
func New ¶
func New(siadaemon *siad.Siad, persistDir string) (sc *ShareChain, err error)
New returns a new ShareChain. If there is an existing sharechain database present in the persist directory, it is loaded.
func (*ShareChain) GenerateMinerPayouts ¶
func (sc *ShareChain) GenerateMinerPayouts(minerAddress types.UnlockHash, subsidy types.Currency) (payouts []types.SiacoinOutput, err error)
GenerateMinerPayouts creates a list of pplns payouts An extra payment of 0 to a random address is added to have a unique merkleroot for every generated set of payouts
func (*ShareChain) GetPPLNSSummary ¶
func (sc *ShareChain) GetPPLNSSummary() (sharesummary map[string]int, err error)
GetPPLNSSummary returns a mapping between miner addresses and the number of shares they found (within the ShareChainLength last number of shares)
func (*ShareChain) HeaderForWork ¶
func (sc *ShareChain) HeaderForWork(payoutaddress string) (blockheader types.BlockHeader, target types.Target, err error)
HeaderForWork returns a header that is ready for nonce grinding.
Click to show internal directories.
Click to hide internal directories.