diff options
author | TheCharlatan <seb.kung@gmail.com> | 2023-09-12 13:01:07 +0200 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2023-09-12 22:49:49 +0200 |
commit | 9be330b654cfbd792620295f3867f592059d6a7a (patch) | |
tree | d1596eed457af928c181b2332c292d1c7a982b85 /src/wallet | |
parent | 37e2b011136ca1cf00dfb9e575d12f0d035a6a2c (diff) |
[refactor] Define MessageStartChars as std::array
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/db.cpp | 2 | ||||
-rw-r--r-- | src/wallet/sqlite.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp index 0c24920516..0ee39d2b5a 100644 --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -136,7 +136,7 @@ bool IsSQLiteFile(const fs::path& path) } // Check the application id matches our network magic - return memcmp(Params().MessageStart(), app_id, 4) == 0; + return memcmp(Params().MessageStart().data(), app_id, 4) == 0; } void ReadDatabaseArgs(const ArgsManager& args, DatabaseOptions& options) diff --git a/src/wallet/sqlite.cpp b/src/wallet/sqlite.cpp index ecd34bb96a..db9989163d 100644 --- a/src/wallet/sqlite.cpp +++ b/src/wallet/sqlite.cpp @@ -193,7 +193,7 @@ bool SQLiteDatabase::Verify(bilingual_str& error) auto read_result = ReadPragmaInteger(m_db, "application_id", "the application id", error); if (!read_result.has_value()) return false; uint32_t app_id = static_cast<uint32_t>(read_result.value()); - uint32_t net_magic = ReadBE32(Params().MessageStart()); + uint32_t net_magic = ReadBE32(Params().MessageStart().data()); if (app_id != net_magic) { error = strprintf(_("SQLiteDatabase: Unexpected application id. Expected %u, got %u"), net_magic, app_id); return false; @@ -324,7 +324,7 @@ void SQLiteDatabase::Open() } // Set the application id - uint32_t app_id = ReadBE32(Params().MessageStart()); + uint32_t app_id = ReadBE32(Params().MessageStart().data()); SetPragma(m_db, "application_id", strprintf("%d", static_cast<int32_t>(app_id)), "Failed to set the application id"); |