From c72a427274ee706bd4b2ebcddf18f954e9a4232f Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 22 Aug 2016 09:15:22 -0700 Subject: [PATCH] Add public method to get state as a human readable string from an AsyncRPCOperation. --- src/asyncrpcoperation.cpp | 5 +++++ src/asyncrpcoperation.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/asyncrpcoperation.cpp b/src/asyncrpcoperation.cpp index 56284ab0..013b0fbb 100644 --- a/src/asyncrpcoperation.cpp +++ b/src/asyncrpcoperation.cpp @@ -145,3 +145,8 @@ Value AsyncRPCOperation::getStatus() const { return Value(obj); } + +std::string AsyncRPCOperation::getStateAsString() const { + OperationStatus status = this->getState(); + return OperationStatusMap[status]; +} diff --git a/src/asyncrpcoperation.h b/src/asyncrpcoperation.h index f30c174d..7e804a5c 100644 --- a/src/asyncrpcoperation.h +++ b/src/asyncrpcoperation.h @@ -71,6 +71,8 @@ public: Value getError() const; Value getResult() const; + + std::string getStateAsString() const; int getErrorCode() const { return errorCode;