upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/rpc.cpp
diff options
context:
space:
mode:
authorbitflash-maintainer <noreply@bitflash.invalid>2026-09-03 21:49:35 +0000
committerbitflash-maintainer <noreply@bitflash.invalid>2026-09-03 21:49:35 +0000
commitaadf093313b55f1ab08671068471eedf6fb0445c (patch)
tree05788d5cf40d5adc59971e887bf2c05547642871 /src/rpc.cpp
parent4b3069f2de140cda427627d470f2751609be6620 (diff)
parentf094dc2f95df213f8c89d1d6f25dc864062623ae (diff)
merge: !6 fix/wallet-locked-payouts into deploy/all-2026-08-24
Diffstat (limited to 'src/rpc.cpp')
-rw-r--r--src/rpc.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/rpc.cpp b/src/rpc.cpp
index 49746ee..579c01c 100644
--- a/src/rpc.cpp
+++ b/src/rpc.cpp
@@ -236,6 +236,29 @@ static bool RebuildJob()
236 // From the pool, so the template's payout key is in wallet.dat before 236 // From the pool, so the template's payout key is in wallet.dat before
237 // any miner is handed work against it. 237 // any miner is handed work against it.
238 vector<unsigned char> vchPubKey = GetKeyFromPool(); 238 vector<unsigned char> vchPubKey = GetKeyFromPool();
239 if (vchPubKey.empty()) {
240 // Empty means the wallet could not produce a key: encrypted and
241 // locked, or key generation itself failed. Serialised, an empty
242 // vector is a zero-length push, so the coinbase would become
243 // `<empty> OP_CHECKSIG` -- a script nobody can satisfy. Every
244 // block mined against such a job burns its whole subsidy, while
245 // QueuePayouts still records the full obligation and the miners
246 // are then paid out of coin that block never contributed.
247 // BitcoinMiner refuses to mine in this state; refuse to hand the
248 // pool's miners work in it too. printf and not LogPrint for the
249 // reason given above the deaf-node refusal, and throttled the
250 // same way -- the no-job watchdog retries every few seconds for
251 // as long as the condition lasts.
252 static int64 nLastSaidNoKey = 0;
253 if (GetTime() - nLastSaidNoKey > 60) {
254 nLastSaidNoKey = GetTime();
255 printf("RebuildJob: no wallet key available for the coinbase "
256 "(wallet locked, or key generation failed -- the "
257 "GetKeyFromPool line above says which) -- not issuing "
258 "jobs\n");
259 }
260 return false;
261 }
239 static std::atomic<uint32_t> sExtra{0}; 262 static std::atomic<uint32_t> sExtra{0};
240 uint32_t extraNonce = ++sExtra; 263 uint32_t extraNonce = ++sExtra;
241 264