tracking: read the ledger's version, not just write it; clear owned on any block; channel-correct prune recovery
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
#include "core/model/bank_model.h"
|
||||
|
||||
#include <cctype>
|
||||
|
||||
#include "core/json/json.h"
|
||||
#include "core/util/relative_path.h"
|
||||
|
||||
// bank_model implementation. JSON rides on the shared core/json lexical layer;
|
||||
// only the Sample/index DOMAIN grammar lives here. Doubles are emitted with 17
|
||||
@@ -44,22 +43,7 @@ bool Sample::operator==(const Sample& o) const {
|
||||
provenance == o.provenance && createdTimestamp == o.createdTimestamp;
|
||||
}
|
||||
|
||||
// -- path invariant -------------------------------------------------------
|
||||
|
||||
// Rejects absolute paths rather than normalizing them: the pure model has no
|
||||
// knowledge of the project root, so any "normalization" would be a guess that
|
||||
// could point at the wrong file. Covers POSIX ("/x"), Windows drive ("C:\x",
|
||||
// "C:/x", "C:foo" drive-relative), and UNC ("\\host\share") forms. Any leading
|
||||
// <alpha>: is rejected regardless of what follows — drive-relative paths
|
||||
// ("C:foo.wav") resolve against the drive's current directory, not the project
|
||||
// root, so they violate relative-paths-only just as much as "C:\foo.wav" does.
|
||||
static bool isAbsolutePath(const std::string& p) {
|
||||
if (p.empty()) return false;
|
||||
if (p[0] == '/' || p[0] == '\\') return true; // POSIX root or UNC
|
||||
if (p.size() >= 2 && std::isalpha(static_cast<unsigned char>(p[0])) && p[1] == ':')
|
||||
return true; // Windows drive (C:\, C:/, C:foo, C:)
|
||||
return false;
|
||||
}
|
||||
using util::isAbsolutePath;
|
||||
|
||||
// -- BankModel ------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user