Skip to content

Commit

Permalink
Skip full block downloading if SPV is not synchronized
Browse files Browse the repository at this point in the history
  • Loading branch information
memekas committed Dec 15, 2021
1 parent 3e5b249 commit 95cb359
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ enum class DownloadStatus {

fun isDownloading(): Boolean =
DOWNLOADING == this

fun isReady(): Boolean =
READY == this
}
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ class PeerEventListener(
// TODO(warchant): if allBlocksAccepted == false here, block can not be connected or invalid
// maybe ban peer? for now, do nothing

// download full block bodies to manage mempool
// download full block bodies to manage mempool. Skip if SPV is not synchronized
if (!spvContext.spvService.getDownloadStatus().downloadStatus.isReady()) return
try {
val blocksToRequest = ArrayList<BlockRequest>()

Expand Down

0 comments on commit 95cb359

Please sign in to comment.