Skip to content

Commit

Permalink
Bug fixes to extract-tx-graphs.R
Browse files Browse the repository at this point in the history
  • Loading branch information
Rucknium committed Jul 17, 2022
1 parent de3bc93 commit e1ba956
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions extract-tx-graphs.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ data.dir <- ""
# Input data directory here, with trailing "/"

current.block.height <- NA_integer_
# current.block.height <- rbch::getblockchaininfo(bch.config)@result$blocks
# current.block.height <- rbch::getblockchaininfo(blockchain.config)@result$blocks

n.threads <- min(c(6, parallelly::availableCores()))
# Recommended no more than 6 threads since all threads query the single blockchain daemon process.
Expand All @@ -34,7 +34,7 @@ cut.seq <- c(-1, cut.seq, current.block.height)

heights.to.process <- 0:current.block.height
heights.to.process <- split(heights.to.process,
cut(heights.to.process, cut.seq))
cut(heights.to.process, unique(cut.seq)))

future::plan(future::multiprocess(workers = n.threads))

Expand All @@ -49,13 +49,13 @@ for (height.set in heights.to.process) {

block.hash <- rbch::getblockhash(blockchain.config, iter.block.height)
if( ! is.dogecoin) {
block.data <- rbch::getblock(bch.config, blockhash = block.hash@result, verbosity = "l2")
block.data <- rbch::getblock(blockchain.config, blockhash = block.hash@result, verbosity = "l2")
# Argument verbose = 2 gives full transaction data
raw.txs.ls <- block.data@result$tx
} else {
block.data <- jsonlite::fromJSON(paste0("http://localhost:22555/rest/block/", block.hash@result, ".json"), simplifyVector = FALSE)
raw.txs.ls <- block.data$tx
}
#raw.txs.ls <- block.data@result$tx
raw.txs.ls <- block.data$tx

coinbase.tx <- raw.txs.ls[[1]]

Expand Down

0 comments on commit e1ba956

Please sign in to comment.