Skip to content

Autocombine Reward Backward Compatibility issue #18

@CaveSpectre11

Description

@CaveSpectre11

This applies to the code added for next release.

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

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions