Commit 329efaed authored by Luke Champine's avatar Luke Champine

address comments

parent cf20b601
......@@ -72,14 +72,14 @@ dependencies:
go get -u golang.org/x/tools/cmd/cover
# release builds and installs release binaries.
release: dependencies test-long
release: dependencies test-long REBUILD
go install ./...
# xc builds and packages release binaries for all systems by using goxc.
# Cross Compile - makes binaries for windows, linux, and mac, 32 and 64 bit.
xc: dependencies test-long
xc: dependencies test-long REBUILD
goxc -arch="amd64" -bc="linux windows darwin" -d=release -pv=0.2.0 \
-br=release -pr=beta -include=example-config,LICENSE*,README* \
-tasks-=deb,deb-dev,deb-source,go-test
.PHONY: all fmt install clean test test-long cover whitepaper dependencies release xc
.PHONY: all fmt install clean test test-long cover whitepaper dependencies release xc REBUILD
......@@ -21,8 +21,6 @@ const (
GenesisTimestamp = Timestamp(1417070299) // Approx. 1:47pm EST Nov. 13th, 2014
)
// Though these are variables, they should never be changed during runtime.
// They get altered during testing.
var (
RootTarget = Target{0, 0, 8}
RootDepth = Target{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}
......
......@@ -21,8 +21,6 @@ const (
GenesisTimestamp = Timestamp(1417070299) // Approx. 1:47pm EST Nov. 13th, 2014
)
// Though these are variables, they should never be changed during runtime.
// They get altered during testing.
var (
RootTarget = Target{0, 0, 0, 8}
RootDepth = Target{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}
......
......@@ -21,8 +21,6 @@ const (
GenesisTimestamp = Timestamp(1417070299) // Approx. 1:47pm EST Nov. 13th, 2014
)
// Though these are variables, they should never be changed during runtime.
// They get altered during testing.
var (
RootTarget = Target{64}
RootDepth = Target{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}
......
......@@ -35,7 +35,7 @@ type Host interface {
// Announce announces the host on the blockchain. A host announcement
// requires two things: the host's address, and a volume of "frozen"
// (time-locked) coins, used to mitigate Sybil attacks.
Announce(network.Address, consensus.Currency, consensus.BlockHeight) error
Announce(addr network.Address, freezeValue consensus.Currency, freezeDuration consensus.BlockHeight) error
// NegotiateContract is a strict function that enables a client to
// communicate with the host to propose a contract.
......
......@@ -65,11 +65,11 @@ func (h *Host) considerTerms(terms modules.ContractTerms) error {
case terms.MissedProofAddress != consensus.ZeroAddress:
return errors.New("burn payout needs to go to the zero address")
// TODO: should this be <= ?
case terms.Price != h.Price:
case terms.Price < h.Price:
return errors.New("price does not match host settings")
// TODO: should this be >= ?
case terms.Collateral != h.Collateral:
case terms.Collateral > h.Collateral:
return errors.New("collateral does not match host settings")
}
......@@ -78,7 +78,6 @@ func (h *Host) considerTerms(terms modules.ContractTerms) error {
// verifyContract verifies that the values in the FileContract match the
// ContractTerms agreed upon.
// TODO: could this just return a bool (i.e. "contract does not match terms"?)
func verifyContract(contract consensus.FileContract, terms modules.ContractTerms, merkleRoot hash.Hash) error {
switch {
case contract.FileSize != terms.FileSize:
......
......@@ -6,12 +6,12 @@ import (
"github.com/NebulousLabs/Sia/consensus"
)
// TODO: embed ContractTerms?
// UploadParams contains the information used by the Renter to upload a file,
// including the file contents and the duration for which it is to be stored.
type UploadParams struct {
Data io.ReadSeeker
Duration consensus.BlockHeight
Delay consensus.BlockHeight
FileSize uint64
// these fields are not seen by the host
Nickname string
......
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