Skip to content

Commit b42ece4

Browse files
committed
fix: temporary fix for spending missing inputs
1 parent 7f29ea1 commit b42ece4

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ bdk_esplora = { version = "0.19.0", features = [
2626
"async-https-rustls",
2727
], default-features = false }
2828
bdk_wallet = { version = "1.0.0-beta.5", features = ["rusqlite"] }
29+
chrono = { version = "0.4.38", default-features = false, features = ["now"] }
2930
colored = "2.1.0"
3031
concurrent-map = "5.0.37"
3132
config = { version = "0.14.0", features = ["toml"], default-features = false }

src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use bdk_wallet::{
3232
bitcoin::{address::NetworkUnchecked, Address as L1Address},
3333
KeychainKind,
3434
};
35+
use chrono::Utc;
3536
use hex::Hex;
3637
use l1::{fee_rate, L1Wallet, Persister, ESPLORA_CLIENT};
3738
use l2::L2Wallet;
@@ -186,6 +187,11 @@ async fn claim_l1(
186187

187188
let txid = tx.compute_txid();
188189

190+
let mut l1w = state.l1_wallet.write();
191+
l1w.apply_unconfirmed_txs([(tx, Utc::now().timestamp() as u64)]);
192+
l1w.persist(&mut Persister).expect("persist should work");
193+
drop(l1w);
194+
189195
info!("l1 claim to {address} via tx {}", txid);
190196

191197
Ok(txid.to_string())

0 commit comments

Comments
 (0)