From 24364cfba04f3887e7b62d324659a2af19b8074f Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Fri, 30 Sep 2022 08:47:20 -0400 Subject: [PATCH] Allow rescan RPC to take an optional height --- src/rpc.cpp | 6 ++++-- src/rpc.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rpc.cpp b/src/rpc.cpp index 2e4e231..e77cfd0 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -135,15 +135,17 @@ QJsonValue RPC::makePayload(QString method) { return payload; } +//TODO: we can use listaddresses void RPC::getTAddresses(const std::function& cb) { QString method = "getaddressesbyaccount"; QString params = ""; conn->doRPCWithDefaultErrorHandling(makePayload(method, ""), cb); } -void RPC::rescan(const std::function& cb) { +// full or partial rescan +void RPC::rescan(qint64 height, const std::function& cb) { QString method = "rescan"; - conn->doRPCWithDefaultErrorHandling(makePayload(method), cb); + conn->doRPCWithDefaultErrorHandling(makePayload(method, QString::number(height)), cb); } void RPC::getZAddresses(const std::function& cb) { diff --git a/src/rpc.h b/src/rpc.h index e31d8e8..695ff13 100644 --- a/src/rpc.h +++ b/src/rpc.h @@ -138,7 +138,7 @@ private: void getPeerInfo (const std::function& cb); void getZAddresses (const std::function& cb); void getTAddresses (const std::function& cb); - void rescan (const std::function& cb); + void rescan (qint64 height, const std::function& cb); Connection* conn = nullptr; std::shared_ptr ehushd = nullptr;