Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chaincfg: Gate mustPayout with subsidy generation. #1988

Merged
merged 1 commit into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions chaincfg/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,6 @@ type TokenPayout struct {
Amount int64
}

// mustPayout returns a token payout populated with script version 0, the
// provided hex-encoded script string converted to bytes and the provided
// amount. It will panic if the specified script hex fails to parse so errors
// in the source code be detected. It will only (and must only) be called with
// hard-coded, and therefore known good, hex-encoded scripts.
func mustPayout(script string, amount int64) TokenPayout {
return TokenPayout{
ScriptVersion: 0,
Script: hexDecode(script),
Amount: amount,
}
}

// DNSSeed identifies a DNS seed.
type DNSSeed struct {
// Host defines the hostname of the seed.
Expand Down
13 changes: 13 additions & 0 deletions chaincfg/subsidydefinitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@

package chaincfg

// mustPayout returns a token payout populated with script version 0, the
// provided hex-encoded script string converted to bytes and the provided
// amount. It will panic if the specified script hex fails to parse so errors
// in the source code be detected. It will only (and must only) be called with
// hard-coded, and therefore known good, hex-encoded scripts.
func mustPayout(script string, amount int64) TokenPayout {
return TokenPayout{
ScriptVersion: 0,
Script: hexDecode(script),
Amount: amount,
}
}

var MainNetSubsidyDefinition = []TokenPayout{
mustPayout("76a91464e20eb6075561d30c23a517c5b73badbc120f0588ac", 5000*1e8),
mustPayout("76a91464fd67aa8ffde6970c62383ce559bbfb0429b41e88ac", 5000*1e8),
Expand Down