From 154dca10a089425450b50081f8f05bea60a00c55 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@allmydata.com>
Date: Mon, 19 May 2008 14:16:02 -0700
Subject: [PATCH] servermap.py: add size_of_version(), to retrieve the size of
 a mutable file version

---
 src/allmydata/mutable/servermap.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/allmydata/mutable/servermap.py b/src/allmydata/mutable/servermap.py
index 0bf8e9d7..4fbb83f4 100644
--- a/src/allmydata/mutable/servermap.py
+++ b/src/allmydata/mutable/servermap.py
@@ -258,6 +258,13 @@ class ServerMap:
             return recoverable[-1]
         return None
 
+    def size_of_version(self, verinfo):
+        """Given a versionid (perhaps returned by best_recoverable_version),
+        return the size of the file in bytes."""
+        (seqnum, root_hash, IV, segsize, datalength, k, N, prefix,
+         offsets_tuple) = verinfo
+        return datalength
+
     def unrecoverable_newer_versions(self):
         # Return a dict of versionid -> health, for versions that are
         # unrecoverable and have later seqnums than any recoverable versions.
-- 
2.45.2