mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
ensure getblocktemplate always returns a value
This commit is contained in:
@@ -119,13 +119,15 @@ export class BitcoinRpcService implements OnModuleInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = await this.client.getblocktemplate({
|
while (result == null) {
|
||||||
template_request: {
|
result = await this.client.getblocktemplate({
|
||||||
rules: ['segwit'],
|
template_request: {
|
||||||
mode: 'template',
|
rules: ['segwit'],
|
||||||
capabilities: ['serverlist', 'proposal']
|
mode: 'template',
|
||||||
}
|
capabilities: ['serverlist', 'proposal']
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
await this.rpcBlockService.saveBlock(blockHeight, JSON.stringify(result));
|
await this.rpcBlockService.saveBlock(blockHeight, JSON.stringify(result));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user