From e160d6f3512d87cf46bf72f2b3a249cefb4b53d1 Mon Sep 17 00:00:00 2001 From: Rucknium Date: Wed, 1 Jun 2022 01:26:26 +0000 Subject: [PATCH] Must get rpcport form config file --- General-Blockchain-Age-of-Spent-Outputs/get-block-times.R | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/General-Blockchain-Age-of-Spent-Outputs/get-block-times.R b/General-Blockchain-Age-of-Spent-Outputs/get-block-times.R index 0c68427..41b430f 100644 --- a/General-Blockchain-Age-of-Spent-Outputs/get-block-times.R +++ b/General-Blockchain-Age-of-Spent-Outputs/get-block-times.R @@ -16,7 +16,14 @@ current.block.height <- NA_integer_ n.threads <- min(c(6, parallelly::availableCores())) # Recommended no more than 6 threads since all threads query the single blockchain daemon process. + blockchain.config <- rbch::conrpc(blockchain.conf.file) +rpcport <- readLines(blockchain.conf.file) +rpcport <- rpcport[grepl("rpcport", rpcport) ] +if (length(rpcport) > 0) { + blockchain.config@url <- paste0("http://127.0.0.1:", gsub("[^0-9]", "", rpcport)) +} + getblock.doge <- function(con, blockhash, verbosity = TRUE) {