haskoin-store 0.11.1 → 0.11.2
raw patch · 5 files changed
+18/−10 lines, 5 files
Files
- CHANGELOG.md +4/−0
- haskoin-store.cabal +2/−2
- src/Haskoin/Store.hs +1/−3
- src/Network/Haskoin/Store/Block.hs +2/−1
- src/Network/Haskoin/Store/Logic.hs +9/−4
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.11.2+### Changed+- Fix duplicate mempool transaction announcements in event stream.+ ## 0.11.1 ### Removed - Removed latest block time check.
haskoin-store.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 139f91772d993146024af96c5aaf5d871181cb34df80da213de5de2bd4ebfe99+-- hash: fb34b3d0d4ea2f11f65e907766f8a85bb16500b28c01fef91a8e4cc677a558bb name: haskoin-store-version: 0.11.1+version: 0.11.2 synopsis: Storage and index for Bitcoin and Bitcoin Cash description: Store blocks, transactions, and balances for Bitcoin or Bitcoin Cash, and make that information via REST API. category: Bitcoin, Finance, Network
src/Haskoin/Store.hs view
@@ -78,7 +78,6 @@ import Data.List import Data.Maybe import Data.Serialize (decode)-import Data.Time.Clock.System import Database.RocksDB as R import Haskoin import Haskoin.Node@@ -234,8 +233,7 @@ MaybeT $ getBlock i h p <- timeout (5 * 1000 * 1000) $ managerGetPeers mgr let k = isNothing n || isNothing b || maybe False (not . null) p- t <- fromIntegral . systemSeconds <$> liftIO getSystemTime- let s =+ s = isJust $ do x <- n y <- b
src/Network/Haskoin/Store/Block.hs view
@@ -215,9 +215,10 @@ $(logErrorS) "Block" $ "Error importing tx: " <> txHashToHex (txHash tx) <> ": " <> fromString (show e)- Right () -> do+ Right True -> do l <- blockConfListener <$> asks myConfig atomically $ l (StoreMempoolNew (txHash tx))+ Right False -> return () processTxs :: (MonadReader BlockRead m, MonadUnliftIO m, MonadLoggerIO m)
src/Network/Haskoin/Store/Logic.hs view
@@ -89,7 +89,7 @@ -> i -> Tx -> PreciseUnixTime- -> m ()+ -> m Bool newMempoolTx net i tx now@(PreciseUnixTime w) = do $(logInfoS) "BlockLogic" $ "Adding transaction to mempool: " <> txHashToHex (txHash tx)@@ -98,7 +98,7 @@ | not (txDataDeleted x) -> do $(logWarnS) "BlockLogic" $ "Transaction already exists: " <> txHashToHex (txHash tx)- return ()+ return False _ -> go where go = do@@ -107,7 +107,8 @@ mapM (getTxData i . outPointHash . prevOutput) (txIn tx) if orp then do- $(logErrorS) "BlockLogic" $ "Transaction is orphan: " <> txHashToHex (txHash tx)+ $(logErrorS) "BlockLogic" $+ "Transaction is orphan: " <> txHashToHex (txHash tx) throwError $ OrphanTx (txHash tx) else f f = do@@ -117,7 +118,9 @@ getTxOutput (outPointIndex op) t let ds = map spenderHash (mapMaybe outputSpender us) if null ds- then importTx net i (MemRef now) (w `div` 1000) tx+ then do+ importTx net i (MemRef now) (w `div` 1000) tx+ return True else g ds g ds = do $(logWarnS) "BlockLogic" $@@ -134,11 +137,13 @@ "Replacting RBF transaction with: " <> txHashToHex (txHash tx) forM_ ds (deleteTx net i True) importTx net i (MemRef now) (w `div` 1000) tx+ return True n = do $(logWarnS) "BlockLogic" $ "Inserting transaction with deleted flag: " <> txHashToHex (txHash tx) insertDeletedMempoolTx i tx now+ return False isrbf th = transactionRBF <$> getImportTx i th newBlock ::