haskoin-store-data 0.64.15 → 0.64.16
raw patch · 3 files changed
+18/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Haskoin.Store.Data: isCoinbaseTx :: Tx -> Bool
+ Haskoin.Store.Data: txDataFee :: TxData -> Word64
Files
- CHANGELOG.md +4/−0
- haskoin-store-data.cabal +2/−2
- src/Haskoin/Store/Data.hs +12/−0
CHANGELOG.md view
@@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) +## 0.64.16+### Fixed+- Correct fee calculation for blocks that do not claim all rewards.+ ## 0.64.15 ### Fixed - Correct scale of cache pruning code.
haskoin-store-data.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 1d92004464aff0836fa36768c8c98b1407caf3d022f8977819cd3e711098ea4e+-- hash: f48a7ae3c9a67fe4458dc559bf0f7f70208a69d48472e728ca1a78a14bc95fb9 name: haskoin-store-data-version: 0.64.15+version: 0.64.16 synopsis: Data for Haskoin Store description: Please see the README on GitHub at <https://github.com/haskoin/haskoin-store#readme> category: Bitcoin, Finance, Network
src/Haskoin/Store/Data.hs view
@@ -25,6 +25,8 @@ -- * Transactions TxRef (..), TxData (..),+ txDataFee,+ isCoinbaseTx, Transaction (..), transactionToJSON, transactionToEncoding,@@ -836,6 +838,9 @@ put = serialize get = deserialize +isCoinbaseTx :: Tx -> Bool+isCoinbaseTx = all ((== nullOutPoint) . prevOutput) . txIn+ isCoinbase :: StoreInput -> Bool isCoinbase StoreCoinbase {} = True isCoinbase StoreInput {} = False@@ -1156,6 +1161,13 @@ instance Binary TxData where put = serialize get = deserialize++txDataFee :: TxData -> Word64+txDataFee TxData {..} =+ if isCoinbaseTx txData then 0 else inputs - outputs+ where+ inputs = sum . map prevAmount $ IntMap.elems txDataPrevs+ outputs = sum . map outValue $ txOut txData toTransaction :: TxData -> IntMap Spender -> Transaction toTransaction t sm =