mirror of
https://github.com/logos-blockchain/logos-blockchain-module.git
synced 2026-02-20 04:53:10 +00:00
Fix comments
This commit is contained in:
parent
7a50587392
commit
f608bdb506
@ -5,13 +5,12 @@
|
||||
// Define static member
|
||||
LogosBlockchainModule* LogosBlockchainModule::s_instance = nullptr;
|
||||
|
||||
// Static callback implementation
|
||||
void LogosBlockchainModule::onNewBlockCallback(const char* block) {
|
||||
if (s_instance) {
|
||||
qInfo() << "Received new block: " << block;
|
||||
QVariantList data;
|
||||
data.append(QString::fromUtf8(block));
|
||||
s_instance->emitNewBlockEvent(data);
|
||||
s_instance->emitEvent("newBlock", data);
|
||||
free_cstring(const_cast<char*>(block)); // Free Rust-allocated memory
|
||||
}
|
||||
}
|
||||
@ -26,6 +25,7 @@ LogosBlockchainModule::LogosBlockchainModule() {
|
||||
}
|
||||
|
||||
LogosBlockchainModule::~LogosBlockchainModule() {
|
||||
s_instance = nullptr;
|
||||
if (node) {
|
||||
stop();
|
||||
}
|
||||
@ -162,7 +162,3 @@ void LogosBlockchainModule::emitEvent(const QString& eventName, const QVariantLi
|
||||
}
|
||||
client->onEventResponse(this, eventName, data);
|
||||
}
|
||||
|
||||
void LogosBlockchainModule::emitNewBlockEvent(const QVariantList& data) {
|
||||
emitEvent("newBlock", data);
|
||||
}
|
||||
|
||||
@ -26,10 +26,6 @@ public:
|
||||
signals:
|
||||
void eventResponse(const QString& eventName, const QVariantList& data);
|
||||
|
||||
public:
|
||||
// Public method for C callback to emit block events
|
||||
void emitNewBlockEvent(const QVariantList& data);
|
||||
|
||||
private:
|
||||
LogosBlockchainNode* node = nullptr;
|
||||
LogosAPIClient* client = nullptr;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user