mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-11 01:11:50 +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;
|
||||
}
|
||||
// Check the version number (value of first record)
|
||||
uint32_t ver;
|
||||
if (!ParseUInt32(version_value, &ver)) {
|
||||
error =strprintf(_("Error: Unable to parse version %u as a uint32_t"), version_value);
|
||||
const auto ver{ToIntegral<uint32_t>(version_value)};
|
||||
if (!ver) {
|
||||
error = strprintf(_("Error: Unable to parse version %u as a uint32_t"), version_value);
|
||||
dump_file.close();
|
||||
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);
|
||||
dump_file.close();
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user