+2004-09-28 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * hashcash.el (hashcash-generate-payment)
+ (hashcash-check-payment): do the right thing if hashcash-path is
+ nil (because the hashcash program could not be found)
+
+ * spam.el (spam-use-hashcash): remove comment
+
2004-09-27 Jesper Harder <harder@ifa.au.dk>
* gnus-cache.el (gnus-cache-possibly-remove-articles-1)
(defun hashcash-generate-payment (str val)
"Generate a hashcash payment by finding a VAL-bit collison on STR."
- (if (> val 0)
+ (if (and (> val 0)
+ hashcash-path)
(save-excursion
(set-buffer (get-buffer-create " *hashcash*"))
(erase-buffer)
"-m" "-q" "-b" (number-to-string val) str)
(goto-char (point-min))
(hashcash-token-substring))
- nil))
+ (progn
+ (message "No hashcash binary found")
+ (sleep-for 1)
+ nil)))
(defun hashcash-check-payment (token str val)
"Check the validity of a hashcash payment."
- (zerop (call-process hashcash-path nil nil nil "-c"
- "-d" "-f" hashcash-double-spend-database
- "-b" (number-to-string val)
- "-r" str
- token)))
+ (if hashcash-path
+ (zerop (call-process hashcash-path nil nil nil "-c"
+ "-d" "-f" hashcash-double-spend-database
+ "-b" (number-to-string val)
+ "-r" str
+ token))
+ (progn
+ (message "No hashcash binary found")
+ (sleep-for 1)
+ nil)))
(defun hashcash-version (token)
"Find the format version of a hashcash token."
(spam-install-checkonly-backend 'spam-use-blackholes
'spam-check-blackholes)
-;; TODO: does anyone use hashcash? We should remove it if not.
(spam-install-checkonly-backend 'spam-use-hashcash
'spam-check-hashcash)