ensure getblocktemplate always returns a value

This commit is contained in:
Benjamin Wilson 2024-07-03 14:31:33 -04:00
parent 3e279ee662
commit ad3035b908

View File

@ -111,13 +111,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 {