You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rpc: Block until synced if coinstatsindex is used in gettxoutsetinfo
During initial sync after startup the gettxoutsetinfo RPC will still return an error while catching up. However, after the initial sync the index will not error immediately anymore when it's in the process of syncing to the tip while being called. Instead it will block until synced and then return the response.
// If a specific block was requested and the index has already synced past that height, we can return the
1183
+
// data already even though the index is not fully synced yet.
1184
+
if (pindex->nHeight > summary.best_block_height) {
1185
+
throwJSONRPCError(RPC_INTERNAL_ERROR, strprintf("Unable to get data because coinstatsindex is still syncing. Current height: %d", summary.best_block_height));
1186
+
}
1187
+
}
1188
+
}
1189
+
1178
1190
if (GetUTXOStats(coins_view, *blockman, stats, node.rpc_interruption_point, pindex)) {
throwJSONRPCError(RPC_INTERNAL_ERROR, strprintf("Unable to read UTXO set because coinstatsindex is still syncing. Current height: %d", summary.best_block_height));
1223
-
}
1224
-
}
1225
1230
throwJSONRPCError(RPC_INTERNAL_ERROR, "Unable to read UTXO set");
0 commit comments