Add documentation to recent code changes.

This commit is contained in:
Kevin Gorham 2021-06-07 00:18:25 -04:00
parent c95b8307c4
commit a1a28cac82
No known key found for this signature in database
GPG Key ID: CCA55602DF49FC38
3 changed files with 13 additions and 0 deletions

View File

@ -171,6 +171,10 @@ class SdkSynchronizer internal constructor(
*/
override val processorInfo: Flow<CompactBlockProcessor.ProcessorInfo> = processor.processorInfo
/**
* The latest height seen on the network while processing blocks. This may differ from the
* latest height scanned and is useful for determining block confirmations and expiration.
*/
override val networkHeight: StateFlow<Int> = processor.networkHeight
//

View File

@ -92,6 +92,11 @@ interface Synchronizer {
*/
val processorInfo: Flow<CompactBlockProcessor.ProcessorInfo>
/**
* The latest height observed on the network, which does not necessarily correspond to the
* latest downloaded height or scanned height. Although this is present in [processorInfo], it
* is such a frequently used value that it is convenient to have the real-time value by itself.
*/
val networkHeight: StateFlow<Int>
/**

View File

@ -163,6 +163,10 @@ class CompactBlockProcessor(
*/
val processorInfo = _processorInfo.asFlow()
/**
* The flow of network height. This value is updated at the same time that [currentInfo] is
* updated but this allows consumers to have the information pushed instead of polling.
*/
val networkHeight = _networkHeight.asStateFlow()
/**