Commit 515d7fb5 authored by Luke Champine's avatar Luke Champine

change Freeze type to uint64

parent 932974bf
......@@ -15,7 +15,8 @@ const (
// Renters can contact the host privately to obtain more detailed hosting
// parameters (see HostSettings). To mitigate Sybil attacks, HostAnnouncements
// are paired with a volume of 'frozen' coins. The FreezeIndex indicates which
// output in the transaction contains the frozen coins.
// output in the transaction contains the frozen coins, and the
// SpendConditions indicate the number of blocks the coins are frozen for.
type HostAnnouncement struct {
IPAddress network.Address
FreezeIndex uint64 // the index of the output that froze coins
......@@ -43,7 +44,7 @@ type HostSettings struct {
type HostEntry struct {
HostSettings
IPAddress network.Address
Freeze consensus.Currency
Freeze uint64 // actual units are Currency * BlockHeight: "CoinBlocks"
}
type HostDB interface {
......
......@@ -32,7 +32,7 @@ func findHostAnnouncements(height consensus.BlockHeight, b consensus.Block) (ann
}
// calculate freeze
freeze := consensus.Currency(ha.SpendConditions.TimeLock-height) * t.Outputs[ha.FreezeIndex].Value
freeze := uint64(ha.SpendConditions.TimeLock-height) * uint64(t.Outputs[ha.FreezeIndex].Value)
// check for sane freeze value
if freeze <= 0 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment