-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
Lines 58 to 68 in fa13a8f
| bitcoinSubmitTxSync :: Has BitcoinConfig r => Int -> SaplingTx -> Zeno r H.TxHash | |
| bitcoinSubmitTxSync confirmations tx = do | |
| txid <- queryBitcoin "sendrawtransaction" [tx] | |
| fix $ \f -> do | |
| threadDelay 5000000 | |
| rawtx <- queryBitcoin "getrawtransaction" (txid, 1::Int) | |
| case rawtx .? "{confirmations}" of | |
| Nothing -> f | |
| Just (n::Int) -> if n < confirmations then f else pure txid | |
There's currently a possibility for the submit to return OK, but then a double spend to occur (accidentally or otherwise) and take out one of the inputs. getrawtransaction won't indicate that there's a problem in this case, so it'll loop forever. This should be made more robust, by repeatedly calling submitrawtransaction, or some other way, that would give indication in the case of a double spend.
Reactions are currently unavailable