aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/chain.h
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2019-01-07 22:35:47 -0800
committerRussell Yanofsky <russ@yanofsky.org>2019-01-15 08:42:00 -0800
commitd93c4c1d6e0aab5f32306ecd7c1237257b26940d (patch)
treee11259962b2fdb58049057658bf924b4266ba892 /src/interfaces/chain.h
parent700c42b85d20e624bef4228eef062c93084efab5 (diff)
Add time methods to the Chain interface
And use them to remove uses of chainActive and mapBlockIndex in wallet code This commit does not change behavior. Co-authored-by: Ben Woosley <ben.woosley@gmail.com>
Diffstat (limited to 'src/interfaces/chain.h')
-rw-r--r--src/interfaces/chain.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h
index 928b8af1f4..1db9d3861d 100644
--- a/src/interfaces/chain.h
+++ b/src/interfaces/chain.h
@@ -8,6 +8,7 @@
#include <optional.h>
#include <memory>
+#include <stdint.h>
#include <string>
#include <vector>
@@ -48,6 +49,13 @@ public:
//! Get block hash. Height must be valid or this function will abort.
virtual uint256 getBlockHash(int height) = 0;
+
+ //! Get block time. Height must be valid or this function will abort.
+ virtual int64_t getBlockTime(int height) = 0;
+
+ //! Get block median time past. Height must be valid or this function
+ //! will abort.
+ virtual int64_t getBlockMedianTimePast(int height) = 0;
};
//! Return Lock interface. Chain is locked when this is called, and