haskoin-store 0.32.1 → 0.32.2
raw patch · 3 files changed
+17/−26 lines, 3 filesdep ~haskoin-storedep ~haskoin-store-data
Dependency ranges changed: haskoin-store, haskoin-store-data
Files
- haskoin-store.cabal +6/−6
- src/Haskoin/Store/BlockStore.hs +3/−12
- src/Haskoin/Store/Logic.hs +8/−8
haskoin-store.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 8f397e6f9e903b35a262f7bfee6b7cee503d83b6fae7846f30a85045fab37c1a+-- hash: 7bd7b9b383e5678c1caf669403968fed075d15fea8244d54062c3e505eec6fcb name: haskoin-store-version: 0.32.1+version: 0.32.2 synopsis: Storage and index for Bitcoin and Bitcoin Cash description: Please see the README on GitHub at <https://github.com/haskoin/haskoin-store#readme> category: Bitcoin, Finance, Network@@ -53,7 +53,7 @@ , hashable >=1.3.0.0 , haskoin-core >=0.13.6 , haskoin-node >=0.14.1- , haskoin-store-data ==0.32.1+ , haskoin-store-data ==0.32.2 , hedis >=0.12.13 , http-types >=0.12.3 , monad-logger >=0.3.32@@ -96,7 +96,7 @@ , haskoin-core >=0.13.6 , haskoin-node >=0.14.1 , haskoin-store- , haskoin-store-data ==0.32.1+ , haskoin-store-data ==0.32.2 , monad-logger >=0.3.32 , mtl >=2.2.2 , nqe >=0.6.1@@ -135,8 +135,8 @@ , hashable >=1.3.0.0 , haskoin-core >=0.13.6 , haskoin-node >=0.14.1- , haskoin-store ==0.32.1- , haskoin-store-data ==0.32.1+ , haskoin-store ==0.32.2+ , haskoin-store-data ==0.32.2 , hedis >=0.12.13 , hspec >=2.7.1 , http-types >=0.12.3
src/Haskoin/Store/BlockStore.hs view
@@ -516,15 +516,8 @@ tx_hash = txHash tx handle_error Orphan = do newOrphanTx block_read time tx- $(logWarnS) "BlockStore" $- "Import tx " <> txHashToHex tx_hash- <> ": Orphan" return False- handle_error _ = do- $(logWarnS) "BlockStore" $- "Import tx " <> txHashToHex tx_hash- <> ": Failed"- return False+ handle_error _ = return False seconds = floor (utcTimeToPOSIXSeconds time) new_mempool_tx = newMempoolTx tx seconds >>= \case@@ -535,7 +528,7 @@ fulfillOrphans block_read tx_hash return True False -> do- $(logInfoS) "BlockStore" $+ $(logDebugS) "BlockStore" $ "Import tx " <> txHashToHex (txHash tx) <> ": Already imported" return False@@ -660,9 +653,7 @@ where delete_it txid = do $(logDebugS) "BlockStore" $- "Deleting "- <> ": " <> txHashToHex txid- <> " (old mempool tx)"+ "Deleting old mempool tx: " <> txHashToHex txid deleteUnconfirmedTx False txid revertToMainChain :: MonadLoggerIO m => BlockT m ()
src/Haskoin/Store/Logic.hs view
@@ -22,7 +22,7 @@ runExceptT, throwError) import Control.Monad.Logger (LoggingT (..), MonadLoggerIO (..), logDebugS,- logErrorS)+ logErrorS, logWarnS) import Control.Monad.Reader (ReaderT (ReaderT), runReaderT) import Control.Monad.Trans (lift) import qualified Data.ByteString as B@@ -34,8 +34,6 @@ isNothing, mapMaybe) import Data.Ord (Down (Down)) import Data.Serialize (encode)-import Data.String.Conversions (cs)-import Data.Text (Text) import Data.Word (Word32, Word64) import Haskoin (Address, Block (..), BlockHash, BlockHeader (..),@@ -457,7 +455,13 @@ deleteConfirmedTx = deleteTx False False deleteUnconfirmedTx :: MonadImport m => Bool -> TxHash -> WriterT m ()-deleteUnconfirmedTx = deleteTx True+deleteUnconfirmedTx rbfcheck th =+ getActiveTxData th >>= \case+ Just _ ->+ deleteTx True rbfcheck th+ Nothing ->+ $(logWarnS) "BlockStore" $+ "Not found or deleted: " <> txHashToHex th deleteTx :: MonadImport m@@ -754,7 +758,3 @@ return False Just Spender { spenderHash = s } -> return $ s == txHash tx--logOutput :: OutPoint -> Text-logOutput op =- txHashToHex (outPointHash op) <> ":" <> cs (show (outPointIndex op))