blockchain: Remove unused median time calc func.

This removes the CalcPastMedianTime since it is now exposed much more
efficiently via the MedianTime field of the BestState snapshot returned
from the BestSnapshot function.
This commit is contained in:
Dave Collins 2017-01-31 17:40:57 -06:00
parent 5ffd552214
commit 0d0f50c464
No known key found for this signature in database
GPG key ID: B8904D9D9C93D1F2

View file

@ -708,18 +708,6 @@ func (b *BlockChain) calcPastMedianTime(startNode *blockNode) (time.Time, error)
return time.Unix(medianTimestamp, 0), nil
}
// CalcPastMedianTime calculates the median time of the previous few blocks
// prior to, and including, the end of the current best chain. It is primarily
// used to ensure new blocks have sane timestamps.
//
// This function is safe for concurrent access.
func (b *BlockChain) CalcPastMedianTime() (time.Time, error) {
b.chainLock.Lock()
defer b.chainLock.Unlock()
return b.calcPastMedianTime(b.bestNode)
}
// SequenceLock represents the converted relative lock-time in seconds, and
// absolute block-height for a transaction input's relative lock-times.
// According to SequenceLock, after the referenced input has been confirmed