From 16d51986a9b4b78207e042e52e2384940a1e9af0 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Wed, 17 Jan 2018 15:11:58 -0800 Subject: [PATCH] Make the call to receiveAt more robust --- interface/src/commerce/Ledger.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/interface/src/commerce/Ledger.cpp b/interface/src/commerce/Ledger.cpp index 15830636f0..9b76c91fd2 100644 --- a/interface/src/commerce/Ledger.cpp +++ b/interface/src/commerce/Ledger.cpp @@ -198,11 +198,17 @@ void Ledger::accountSuccess(QNetworkReply& reply) { auto salt = QByteArray::fromBase64(data["salt"].toString().toUtf8()); auto iv = QByteArray::fromBase64(data["iv"].toString().toUtf8()); auto ckey = QByteArray::fromBase64(data["ckey"].toString().toUtf8()); + QString remotePublicKey = data["public_key"].toString(); wallet->setSalt(salt); wallet->setIv(iv); wallet->setCKey(ckey); + QStringList localPublicKeys = wallet->listPublicKeys(); + if (remotePublicKey.isEmpty() && !localPublicKeys.isEmpty()) { + receiveAt(localPublicKeys.first(), ""); + } + // none of the hfc account info should be emitted emit accountResult(QJsonObject{ {"status", "success"} }); }