aboutsummaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2011-02-02 18:47:04 -0500
committerJeff Garzik <jgarzik@redhat.com>2011-02-02 18:47:04 -0500
commitc68ffb30dd17b32f69665af18b72687875770972 (patch)
tree748110c309233117b7f26bd4dc575a2904266aba /util.c
parent453101d9e9f8b7408ca645dd174aa3e8af1d87ac (diff)
Display proof-of-work hash when one is discovered
Diffstat (limited to 'util.c')
-rw-r--r--util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/util.c b/util.c
index 669dd82..2a52a04 100644
--- a/util.c
+++ b/util.c
@@ -255,3 +255,14 @@ timeval_subtract (
return x->tv_sec < y->tv_sec;
}
+void print_pow(const unsigned char *hash)
+{
+ char *hexstr;
+ unsigned char hash_swap[32];
+
+ swap256(hash_swap, hash);
+ hexstr = bin2hex(hash_swap, 32);
+ fprintf(stderr, "PoW found: %s\n", hexstr);
+ free(hexstr);
+}
+