コード例 #1
0
ファイル: coinbase.go プロジェクト: conseweb/factoid
// This routine generates the Coinbase.  This is a fixed amount to be
// paid to the federated servers.
//
// Currently we are paying just a few fixed addresses.
//
func GetCoinbase(ftime uint64) fct.ITransaction {

	if false && adrs == nil {
		var w wallet.ISCWallet
		w = new(wallet.SCWallet)
		w.Init()

		adrs = make([]fct.IAddress, addressCnt)
		for i := 0; i < addressCnt; i++ {
			adr, _ := w.GenerateFctAddress([]byte("adr"+string(i)), 1, 1)
			adrs[i] = adr
		}
	}

	coinbase := new(fct.Transaction)
	coinbase.SetMilliTimestamp(ftime)

	for _, adr := range adrs {
		coinbase.AddOutput(adr, amount) // add specified amount
	}

	return coinbase
}