mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2025-07-13 13:22:19 +02: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({
|
||||
template_request: {
|
||||
rules: ['segwit'],
|
||||
mode: 'template',
|
||||
capabilities: ['serverlist', 'proposal']
|
||||
}
|
||||
});
|
||||
while (result == null) {
|
||||
result = await this.client.getblocktemplate({
|
||||
template_request: {
|
||||
rules: ['segwit'],
|
||||
mode: 'template',
|
||||
capabilities: ['serverlist', 'proposal']
|
||||
}
|
||||
});
|
||||
}
|
||||
await this.rpcBlockService.saveBlock(blockHeight, JSON.stringify(result));
|
||||
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user