Skip to content

Fix backwards compatibility issue in autocombinerewards #27

@CaveSpectre11

Description

@CaveSpectre11

Those with an autocombinereward record in their wallet, will get a wallet.dat corruption error on startup. This needs to be handled.

PIVX-Project/PIVX#873

bool getAutocombineSettings()
{
    bool fAutocombineException = false;

    try {
        std::pair<std::pair<bool, CAmount>,int> pSettings;
        ssValue >> pSettings;
        pwallet->fCombineDust = pSettings.first.first;
        pwallet->nAutoCombineThreshold = pSettings.first.second;
        pwallet->nAutoCombineBlockFrequency = pSettings.second;
    } catch (...) {
        fAutocombineException = true;
    }

    if (fAutocombineException) {
        try {
            pwallet->fCombineDust = pSettings.first;
            pwallet->nAutoCombineThreshold = pSettings.second;
            pwallet->nAutoCombineBlockFrequency = 15;  // interpret for new functionality
            // include notification to user in an attempt to get them to redo their autocombinereward 
        } catch (...) {
            return false;
        }
    }
    return true;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions