Merge pull request #660 from nathan-at-least/t654.fetch-params-resume-downloads

Add feature to resume downloads of params files.
This commit is contained in:
ebfull 2016-01-22 13:03:39 -07:00
commit 5d0b0129f5
1 changed files with 7 additions and 0 deletions

View File

@ -18,6 +18,8 @@ TESTNET3_DIR="$PARAMS_DIR/testnet3"
function fetch_params {
local url="$1"
local filename="$(echo "$url" | sed 's,^.*/,,')"
local dlname="${filename}.dl"
if ! [ -f "$filename" ]
then
echo "Retrieving: $url"
@ -28,7 +30,12 @@ function fetch_params {
wget \
--progress=dot:giga \
--no-check-certificate \
--output-document="$dlname" \
--continue \
"$url"
# Only after successful download do we update the parameter load path:
mv -v "$dlname" "$filename"
fi
}