aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-06-24 14:35:30 -0500
committerluigi1111 <luigi1111w@gmail.com>2021-06-24 14:35:30 -0500
commit9c18f2767bc62796eacb0428ac50abf8fc5c14dd (patch)
treed5957063d6a7788a3fbba603fe2dd72c85445b5f
parentMerge pull request #7752 (diff)
parentwallet_api: get bytes sent/received (diff)
downloadmonero-9c18f2767bc62796eacb0428ac50abf8fc5c14dd.tar.xz
Merge pull request #7743
8a67724 wallet_api: get bytes sent/received (tobtoht)
-rw-r--r--src/wallet/api/wallet.cpp11
-rw-r--r--src/wallet/api/wallet.h2
-rw-r--r--src/wallet/api/wallet2_api.h6
3 files changed, 19 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index d53cbddad..2b0349501 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -2603,4 +2603,15 @@ bool WalletImpl::reconnectDevice()
return r;
}
+
+uint64_t WalletImpl::getBytesReceived()
+{
+ return m_wallet->get_bytes_received();
+}
+
+uint64_t WalletImpl::getBytesSent()
+{
+ return m_wallet->get_bytes_sent();
+}
+
} // namespace
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
index 802c7492e..d0900daa2 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
@@ -221,6 +221,8 @@ public:
virtual uint64_t coldKeyImageSync(uint64_t &spent, uint64_t &unspent) override;
virtual void deviceShowAddress(uint32_t accountIndex, uint32_t addressIndex, const std::string &paymentId) override;
virtual bool reconnectDevice() override;
+ virtual uint64_t getBytesReceived() override;
+ virtual uint64_t getBytesSent() override;
private:
void clearStatus() const;
diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h
index a67bf7074..99a4de731 100644
--- a/src/wallet/api/wallet2_api.h
+++ b/src/wallet/api/wallet2_api.h
@@ -1087,6 +1087,12 @@ struct Wallet
//! attempt to reconnect to hardware device
virtual bool reconnectDevice() = 0;
+
+ //! get bytes received
+ virtual uint64_t getBytesReceived() = 0;
+
+ //! get bytes sent
+ virtual uint64_t getBytesSent() = 0;
};
/**