diff options
author | Alex Morcos <morcos@chaincode.com> | 2015-12-04 15:01:22 -0500 |
---|---|---|
committer | BtcDrak <btcdrak@gmail.com> | 2016-03-18 09:14:52 +0000 |
commit | ade85e126d1ba7cb90a3382fb8c3cc4f3b89dc4d (patch) | |
tree | 8977bfdb2474536bd0868e95a0bca4b0dae791db /src/main.h | |
parent | c8d309e4b4d82dd233f167b4df503e6a5b4164ef (diff) | |
download | bitcoin-ade85e126d1ba7cb90a3382fb8c3cc4f3b89dc4d.tar.xz |
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.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.h b/src/main.h index 93e58988cf..3793f55ba2 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; @@ -354,6 +355,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. */ @@ -363,10 +369,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 |