logging and error handling

This commit is contained in:
Duke Leto
2021-05-30 15:14:05 -04:00
parent 14ab550b76
commit a135753cef
5 changed files with 38 additions and 48 deletions

View File

@@ -1236,13 +1236,13 @@ void Controller::refreshTransactions() {
}
int position = it["position"].get<json::number_integer_t>();
int ciphercheck = memo.length() - crypto_secretstream_xchacha20poly1305_ABYTES;
qDebug() << __func__ << ": position=" << position << " headerbytes=" << headerbytes
<< " ciphercheck=" << ciphercheck << " for memo=" << memo;
if ((memo.startsWith("{") == false) && (headerbytes > 0) && (ciphercheck > 0))
{
if (chatModel->getMemoByTx(txid) == QString("0xdeadbeef"))
{
if (chatModel->getMemoByTx(txid) == QString("0xdeadbeef")) {
if (position == 1)
{
chatModel->addMemo(txid, headerbytes);
@@ -1352,10 +1352,13 @@ void Controller::refreshTransactions() {
DataStore::getChatDataStore()->setData(ChatIDGenerator::getInstance()->generateID(item), item);
} else {
//
qDebug() << __func__ << ": ignoring txid="<< txid;
}
//} else if (memo.startsWith("{")) {
//qDebug() << __func__ << ": ignoring a header memo";
} else {
// Add a chatitem for the initial CR
ChatItem item = ChatItem(
datetime,
address,
@@ -1371,7 +1374,7 @@ void Controller::refreshTransactions() {
isContact
);
qDebug() << "refreshTransactions: adding chatItem with memo=" << memo;
qDebug() << "refreshTransactions: adding chatItem for initial CR with memo=" << memo;
DataStore::getChatDataStore()->setData(ChatIDGenerator::getInstance()->generateID(item), item);
}
}