aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2015-12-04 15:01:22 -0500
committerAlex Morcos <morcos@chaincode.com>2016-03-16 16:11:46 -0400
commit982670c333aff6d5660c18ed00931df764733529 (patch)
treec30509abd3422e3e7fcdd10320885eabc5dac126 /src/main.h
parent8b70a64d62c6e64288762d062414cc979f880c54 (diff)
Add LockPoints
Obtain LockPoints to store in CTxMemPoolEntry and during a reorg, evaluate whether they are still valid and if not, recalculate them.
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.h b/src/main.h
index 5ba2be251c..85ec60ac61 100644
--- a/src/main.h
+++ b/src/main.h
@@ -39,6 +39,7 @@ class CValidationInterface;
class CValidationState;
struct CNodeStateStats;
+struct LockPoints;
/** Default for accepting alerts from the P2P network. */
static const bool DEFAULT_ALERTS = true;
@@ -369,6 +370,11 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime);
bool CheckFinalTx(const CTransaction &tx, int flags = -1);
/**
+ * Test whether the LockPoints height and time are still valid on the current chain
+ */
+bool TestLockPointValidity(const LockPoints* lp);
+
+/**
* Check if transaction is final per BIP 68 sequence numbers and can be included in a block.
* Consensus critical. Takes as input a list of heights at which tx's inputs (in order) confirmed.
*/
@@ -378,10 +384,14 @@ bool SequenceLocks(const CTransaction &tx, int flags, std::vector<int>* prevHeig
* Check if transaction will be BIP 68 final in the next block to be created.
*
* Simulates calling SequenceLocks() with data from the tip of the current active chain.
+ * Optionally stores in LockPoints the resulting height and time calculated and the hash
+ * of the block needed for calculation or skips the calculation and uses the LockPoints
+ * passed in for evaluation.
+ * The LockPoints should not be considered valid if CheckSequenceLocks returns false.
*
* See consensus/consensus.h for flag definitions.
*/
-bool CheckSequenceLocks(const CTransaction &tx, int flags);
+bool CheckSequenceLocks(const CTransaction &tx, int flags, LockPoints* lp = NULL, bool useExistingLockPoints = false);
/**
* Closure representing one script verification