revault / revault-gui

Revault terminal
https://revault.dev
BSD 3-Clause "New" or "Revised" License
51 stars 8 forks source link

Notice if one of the revaultd threads panicked and *do something* in the GUI #257

Closed danielabrozzoni closed 3 years ago

danielabrozzoni commented 3 years ago

While trying out one of the threads panicked, but I had no way to know

darosior commented 3 years ago

So @edouardparis told me that it was handled already, so it actually may not have panic'ed.

danielabrozzoni commented 3 years ago

True, my bad. This happens when the bitcoind daemon crashes:

Revault GUI_146

To reproduce:

diff --git a/src/daemon/bitcoind/interface.rs b/src/daemon/bitcoind/interface.rs
index f723b0a..5004d8b 100644
--- a/src/daemon/bitcoind/interface.rs
+++ b/src/daemon/bitcoind/interface.rs
@@ -743,6 +743,7 @@ impl BitcoinD {

     /// Broadcast a transaction with 'sendrawtransaction', discarding the returned txid
     pub fn broadcast_transaction(&self, tx: &Transaction) -> Result<(), BitcoindError> {
+        panic!("Uh oh");
         let tx_hex = encode::serialize_hex(tx);
         log::debug!("Broadcasting '{}'", tx_hex);
         self.make_watchonly_request("sendrawtransaction", &params!(Json::String(tx_hex)))

then try to broadcast an unvault.