ensure getblocktemplate always returns a value

This commit is contained in:
Benjamin Wilson
2024-07-04 16:46:44 -04:00
parent 3e279ee662
commit ad3035b908
+2
View File
@@ -111,6 +111,7 @@ export class BitcoinRpcService implements OnModuleInit {
}
}
while (result == null) {
result = await this.client.getblocktemplate({
template_request: {
rules: ['segwit'],
@@ -118,6 +119,7 @@ export class BitcoinRpcService implements OnModuleInit {
capabilities: ['serverlist', 'proposal']
}
});
}
await this.rpcBlockService.saveBlock(blockHeight, JSON.stringify(result));
} else {