Class monitor
#include <keychain/monitor/monitor.hpp>
Namespace: keychain
Inheritance: monitor
Description
monitor
subscribes to block updates from the blockchain and updates the database cache state of persona
and contact
accordingly. monitor
updates attributes such as number of confirmations, public keys and metadata, certificate transaction data. A thread for monitoring the blockchain state is created in the on_start()
method.
Method Specifically, note that the |
Without at least one monitor
the gateway
will run out of sync with the blockchain and will cause the gateway
to not be able to perform cryptographic operations properly on subsequent data. Thus, you should ensure that a monitor
is instantiated within the current Activity.
Since: v2.0
Public Constructors
Constructor |
---|
Creates a |
Public Member Functions Detail
on_pause
|
|
Pause the monitor thread. Block the monitor thread if it was unblocked and running. The thread will remain blocked until |
|
Returns: |
|
The Keychain library error code indicating success or failure |
on_resume
|
|
Run/resume the monitor thread. This method starts/unblocks the monitor thread if it was blocked or not running. If the thread does not exist upon calling |
|
Returns: |
|
The Keychain library error code indicating success or failure |
on_start
|
|
Create the monitor thread if it did not exist. Note that this does not start the thread. Use |
|
Returns: |
|
The Keychain library error code indicating success or failure |
on_stop
|
|||
Stop and destroy the monitor thread if it exists. If the thread is running upon entry in this method, this method will (safely) cause the thread to stop execution before destroying the thread.
|
|||
Returns: |
|||
The Keychain library error code indicating success or failure |