Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random patches #1203

Merged
merged 3 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion coordinator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ path = "../crates/orderbook-commons"

[dependencies.parking_lot]
version = "0.12.1"
features = ["deadlock_detection"]

[dependencies.rust_decimal]
version = "1"
Expand Down
2 changes: 1 addition & 1 deletion crates/ln-dlc-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ lightning-persister = { version = "0.0.114" }
lightning-transaction-sync = { version = "0.0.114", features = ["esplora-blocking"] }
log = "0.4.17"
p2pd-oracle-client = { version = "0.1.0" }
parking_lot = { version = "0.12.1", features = ["deadlock_detection"] }
parking_lot = { version = "0.12.1" }
rand = "0.8.5"
reqwest = { version = "0.11", default-features = false, features = ["json"] }
rust-bitcoin-coin-selection = { version = "0.1.0", features = ["rand"] }
Expand Down
21 changes: 0 additions & 21 deletions crates/ln-dlc-node/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,6 @@ where
self.keys_manager.clone(),
));

std::thread::spawn(monitor_for_deadlocks());

tracing::info!("Lightning node started with node ID {}", self.info);

Ok(RunningNode { _handles: handles })
Expand Down Expand Up @@ -573,25 +571,6 @@ fn spawn_background_processor(
remote_handle
}

/// Parking lot mutexes have the ability to mark deadlocks.
///
/// Take advantage of this behaviour and log deadlocks when they occur.
fn monitor_for_deadlocks() -> impl Fn() {
move || loop {
let deadlocks = parking_lot::deadlock::check_deadlock();

for (i, threads) in deadlocks.iter().enumerate() {
tracing::error!(%i, "Deadlock detected");
for t in threads {
tracing::error!(thread_id = %t.thread_id());
tracing::error!("{:#?}", t.backtrace());
}
}

std::thread::sleep(Duration::from_secs(10));
}
}

async fn lightning_wallet_sync(
channel_manager: Arc<ChannelManager>,
chain_monitor: Arc<ChainMonitor>,
Expand Down
5 changes: 5 additions & 0 deletions mobile/lib/features/wallet/create_invoice_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:math';

import 'package:flutter/material.dart';
import 'package:get_10101/bridge_generated/bridge_definitions.dart' as bridge;
import 'package:get_10101/common/amount_text.dart';
import 'package:get_10101/common/amount_text_input_form_field.dart';
import 'package:get_10101/common/application/channel_info_service.dart';
Expand Down Expand Up @@ -57,6 +58,10 @@ class _CreateInvoiceScreenState extends State<CreateInvoiceScreen> {
void initState() {
final ChannelInfoService channelInfoService = context.read<ChannelInfoService>();
initChannelInfo(channelInfoService);

final bridge.Config config = context.read<bridge.Config>();
amount = config.network == "regtest" ? Amount(100000) : null;

super.initState();
}

Expand Down
13 changes: 8 additions & 5 deletions mobile/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,16 @@ class _TenTenOneAppState extends State<TenTenOneApp> {
init(config);

WidgetsBinding.instance.addPostFrameCallback((_) async {
await initFirebase();
await requestNotificationPermission();
final flutterLocalNotificationsPlugin = initLocalNotifications();
await configureFirebase(flutterLocalNotificationsPlugin);
try {
await initFirebase();
await requestNotificationPermission();
final flutterLocalNotificationsPlugin = initLocalNotifications();
await configureFirebase(flutterLocalNotificationsPlugin);
} catch (e) {
FLog.error(text: "Error setting up Firebase: ${e.toString()}");
}

PackageInfo packageInfo = await PackageInfo.fromPlatform();

final messenger = scaffoldMessengerKey.currentState!;

try {
Expand Down
2 changes: 1 addition & 1 deletion mobile/native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ln-dlc-node = { path = "../../crates/ln-dlc-node" }
openssl = { version = "0.10.55", features = ["vendored"] }
orderbook-client = { path = "../../crates/orderbook-client" }
orderbook-commons = { path = "../../crates/orderbook-commons" }
parking_lot = { version = "0.12.1", features = ["deadlock_detection"] }
parking_lot = { version = "0.12.1" }
reqwest = { version = "0.11", default-features = false, features = ["json"] }
rust_decimal = { version = "1", features = ["serde-with-float"] }
serde = { version = "1.0.152", features = ["serde_derive"] }
Expand Down