mirror of
https://github.com/cculianu/Fulcrum.git
synced 2026-08-15 12:50:49 +02:00
Devised a scheme for asynch messaging to bitcoind
And added some test code in Controller to use the scheme. It's very asynchronous. Needs some tuning long term to see how it deals with load and perhaps throttle the requests if we know bitcoind is under load. But for right now, for testing, it should work ok. Also in this commit small nits, plus bugfix to RPC::Message factory methods (I forgot to populate some instance properties when constructing the objects). Additionally, we were registering the qMetaType wrong for RPC::Message and RPC::Message::Id (this has been fixed).
This commit is contained in:
parent
0b6d6f0b70
commit
f4091bb005
5 changed files with 144 additions and 15 deletions
|
|
@ -71,4 +71,11 @@ void Controller::process()
|
|||
Debug() << "Process called...";
|
||||
if (!sm) sm = std::make_unique<StateMachine>(); // create statemachine if doest not exist
|
||||
|
||||
bitcoindmgr->submitRequest(this, IdMixin::newId(), "getmempoolinfo", {}, [](auto resp){ // testing
|
||||
Trace() << resp.id.toString() << ": result reply: " << resp.toJsonString();
|
||||
}, [](auto resp){
|
||||
Trace() << resp.id.toString() << ": error response: " << resp.toJsonString();
|
||||
}, [](auto id, auto msg) {
|
||||
Warning() << id.toString() << ": FAIL: " << msg;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue