mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-16 11:53:07 +02:00
refactor: Use ToIntegral in CreateFromDump
The unsigned version is never serialized with a `+` prefix, so the stricter ToIntegral can be used.
This commit is contained in:
parent
fa23ed7fc2
commit
fa98041325
@ -151,13 +151,13 @@ bool CreateFromDump(const ArgsManager& args, const std::string& name, const fs::
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Check the version number (value of first record)
|
// Check the version number (value of first record)
|
||||||
uint32_t ver;
|
const auto ver{ToIntegral<uint32_t>(version_value)};
|
||||||
if (!ParseUInt32(version_value, &ver)) {
|
if (!ver) {
|
||||||
error =strprintf(_("Error: Unable to parse version %u as a uint32_t"), version_value);
|
error = strprintf(_("Error: Unable to parse version %u as a uint32_t"), version_value);
|
||||||
dump_file.close();
|
dump_file.close();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (ver != DUMP_VERSION) {
|
if (*ver != DUMP_VERSION) {
|
||||||
error = strprintf(_("Error: Dumpfile version is not supported. This version of bitcoin-wallet only supports version 1 dumpfiles. Got dumpfile with version %s"), version_value);
|
error = strprintf(_("Error: Dumpfile version is not supported. This version of bitcoin-wallet only supports version 1 dumpfiles. Got dumpfile with version %s"), version_value);
|
||||||
dump_file.close();
|
dump_file.close();
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user