create Datastore for countedNotes over 10000 puposhis, debug for notes in send
This commit is contained in:
51
src/DataStore/NoteCountDataStore.cpp
Normal file
51
src/DataStore/NoteCountDataStore.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#include "NoteCountDataStore.h"
|
||||
|
||||
NoteCountDataStore* NoteCountDataStore::instance = nullptr;
|
||||
bool NoteCountDataStore::instanced = false;
|
||||
|
||||
NoteCountDataStore* NoteCountDataStore::getInstance() {
|
||||
if (!instanced) {
|
||||
instanced = true;
|
||||
instance = new NoteCountDataStore();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
void NoteCountDataStore::clear() {
|
||||
data.clear();
|
||||
}
|
||||
|
||||
void NoteCountDataStore::setData(const QString& key, const QString& value) {
|
||||
data[key] = value;
|
||||
}
|
||||
|
||||
QString NoteCountDataStore::getData(const QString& key) {
|
||||
return data.value(key);
|
||||
}
|
||||
|
||||
QString NoteCountDataStore::dump() {
|
||||
QString result;
|
||||
for (const auto& key : data.keys()) {
|
||||
result += key + ": " + data[key] + "\n";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void NoteCountDataStore::setSpendableNotesCount(int count) {
|
||||
spendableNotesCount = count;
|
||||
}
|
||||
|
||||
int NoteCountDataStore::getSpendableNotesCount() const {
|
||||
return spendableNotesCount;
|
||||
}
|
||||
|
||||
void NoteCountDataStore::setAddressWithMaxValue(const QString& address, int value) {
|
||||
if (value > maxValue) {
|
||||
maxValue = value;
|
||||
addressWithMaxValue = address;
|
||||
}
|
||||
}
|
||||
|
||||
QString NoteCountDataStore::getAddressWithMaxValue() const {
|
||||
return addressWithMaxValue;
|
||||
}
|
||||
Reference in New Issue
Block a user