Skip to content

Instantly share code, notes, and snippets.

@jb55
Created October 23, 2017 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jb55/1f9f0cd8906c82d577d96f97d9584230 to your computer and use it in GitHub Desktop.
Save jb55/1f9f0cd8906c82d577d96f97d9584230 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
howlong() {
mins=$(($1 * 10))
target=$(date -u -d "now + $mins minutes" -Iseconds)
targetp=$(date -d $target '+%F %R %Z')
ddiff=$(datediff -f "%dd %Hh %0Mm @ $targetp" "now" "$target")
printf "%s\n" "$ddiff"
}
height=$(bitcoin-cli getblockcount)
segwit2x=$((494784 - height))
gold=$((491407 - height))
printf "s2x(%sb, %s)\ngold(%sb, %s)\n" \
"$segwit2x" "$(howlong $segwit2x)" \
"$gold" "$(howlong $gold)"
@jb55
Copy link
Author

jb55 commented Oct 23, 2017

s2x(3446b, 23d 22h 20m @ 2017-11-16 06:58 PST)
gold(69b,  0d  11h 30m @ 2017-10-23 21:08 PDT)

@jb55
Copy link
Author

jb55 commented Oct 23, 2017

dateutils required for datediff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment