Fix the "use mining voucher many times" bug

Fixes #3265