mirror of
https://github.com/Rucknium/xmrpeers.git
synced 2024-11-16 10:27:36 +00:00
Fix case when zero txs in a gossip message
This commit is contained in:
parent
150a123cc4
commit
e6187e5b80
1 changed files with 4 additions and 4 deletions
|
@ -138,9 +138,8 @@ get.p2p.log <- function(bitmonero.dir = "~/.bitmonero", output.file = NULL) {
|
|||
# This fixes the rare case that the number of txs received in a message
|
||||
# is zero, or if all the txs in a message did not pass validation
|
||||
# so none of them were printed to the log.
|
||||
how.many <- rle.result$lengths[i] - 1
|
||||
rle.result$lengths <- append(rle.result$lengths, rep(0, how.many), after = i)
|
||||
rle.result$values <- append(rle.result$values, rep(TRUE, how.many), after = i)
|
||||
rle.result$lengths <- append(rle.result$lengths, 0, after = i)
|
||||
rle.result$values <- append(rle.result$values, TRUE, after = i)
|
||||
}
|
||||
|
||||
cat(base::date(), " ", sum(rle.result$lengths[rle.result$values] != number.of.txs),
|
||||
|
@ -161,7 +160,8 @@ get.p2p.log <- function(bitmonero.dir = "~/.bitmonero", output.file = NULL) {
|
|||
tx.hash = get.tx.hash(monero.log),
|
||||
stringsAsFactors = FALSE)
|
||||
|
||||
stopifnot( all(diff(tx.data$gossip.msg.id)[is.na(tx.data$tx.hash)[-1]] == 1) )
|
||||
stopifnot( all(diff(tx.data[tx.data$number.of.txs.corrected > 0, "gossip.msg.id"])[is.na(tx.data[tx.data$number.of.txs.corrected > 0, "tx.hash"])[-1]] == 1) )
|
||||
# TODO: Make this syntax clearer
|
||||
# Checks to make sure each transmission of txs from each node has its
|
||||
# own gossip.msg.id, i.e. that there is no misalignment in the data.frame
|
||||
|
||||
|
|
Loading…
Reference in a new issue