diff --git a/build/proof-params/mkparamfetch.sh b/build/proof-params/mkparamfetch.sh index b503e22ef..a9f8023ea 100755 --- a/build/proof-params/mkparamfetch.sh +++ b/build/proof-params/mkparamfetch.sh @@ -2,5 +2,19 @@ set -euo pipefail -sed "s/{{PARAMSJSON}}/$(base64 build/proof-params/parameters.json -w 0)/g" build/proof-params/paramfetch.sh.template > ./build/paramfetch.sh +function b64() { + f="$1" + case `uname` in + Darwin) + base64 -i "$f" + ;; + Linux) + base64 "$f" -w 0 + ;; + esac + printf "unsupported system" 1>&2 + exit 1 +} + +sed "s/{{PARAMSJSON}}/$(b64 build/proof-params/parameters.json)/g" build/proof-params/paramfetch.sh.template > ./build/paramfetch.sh chmod +x ./build/paramfetch.sh diff --git a/chain/sync.go b/chain/sync.go index d3028f057..0c224b84a 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -546,7 +546,7 @@ loop: blockSet = append(blockSet, b) } - syncer.syncState.SetHeight(blks[len(blockSet)-1].Height()) + syncer.syncState.SetHeight(blks[len(blks)-1].Height()) at = blks[len(blks)-1].Parents() }