diff options
Diffstat (limited to 'src/rpc.cpp')
| -rw-r--r-- | src/rpc.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/rpc.cpp b/src/rpc.cpp index a4b53ca..cc3fffa 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp | |||
| @@ -223,6 +223,29 @@ static bool RebuildJob() | |||
| 223 | // From the pool, so the template's payout key is in wallet.dat before | 223 | // From the pool, so the template's payout key is in wallet.dat before |
| 224 | // any miner is handed work against it. | 224 | // any miner is handed work against it. |
| 225 | vector<unsigned char> vchPubKey = GetKeyFromPool(); | 225 | vector<unsigned char> vchPubKey = GetKeyFromPool(); |
| 226 | if (vchPubKey.empty()) { | ||
| 227 | // Empty means the wallet could not produce a key: encrypted and | ||
| 228 | // locked, or key generation itself failed. Serialised, an empty | ||
| 229 | // vector is a zero-length push, so the coinbase would become | ||
| 230 | // `<empty> OP_CHECKSIG` -- a script nobody can satisfy. Every | ||
| 231 | // block mined against such a job burns its whole subsidy, while | ||
| 232 | // QueuePayouts still records the full obligation and the miners | ||
| 233 | // are then paid out of coin that block never contributed. | ||
| 234 | // BitcoinMiner refuses to mine in this state; refuse to hand the | ||
| 235 | // pool's miners work in it too. printf and not LogPrint for the | ||
| 236 | // reason given above the deaf-node refusal, and throttled the | ||
| 237 | // same way -- the no-job watchdog retries every few seconds for | ||
| 238 | // as long as the condition lasts. | ||
| 239 | static int64 nLastSaidNoKey = 0; | ||
| 240 | if (GetTime() - nLastSaidNoKey > 60) { | ||
| 241 | nLastSaidNoKey = GetTime(); | ||
| 242 | printf("RebuildJob: no wallet key available for the coinbase " | ||
| 243 | "(wallet locked, or key generation failed -- the " | ||
| 244 | "GetKeyFromPool line above says which) -- not issuing " | ||
| 245 | "jobs\n"); | ||
| 246 | } | ||
| 247 | return false; | ||
| 248 | } | ||
| 226 | static std::atomic<uint32_t> sExtra{0}; | 249 | static std::atomic<uint32_t> sExtra{0}; |
| 227 | uint32_t extraNonce = ++sExtra; | 250 | uint32_t extraNonce = ++sExtra; |
| 228 | 251 | ||