Skip to content

Commit 7dace4e

Browse files
authored
[r2r] Lightning channels and payments history #1045 (#1240)
* WIP: Channels history in SQL storage * review fixes: specific types, add serialization tests * WIP: refactor start_lightning fn * WIP: continue refactoring start_lightning fn * WIP: refactoring, add init_channel_manager fn * WIP: refactoring, ln_p2p * WIP: refactoring, ln_platform * Refactor completed * WIP: use user_channel_id as channel id in rpc calls to avoid using temp id * Channels in sql WIP: add pending outbound channel to sql * Channels sql WIP: get channel and add funding_tx * Channels sql WIP: add funding tx to sql after FundingGenerationReady event * Channels sql WIP: add closure_reason to sql table * Channels sql WIP: update channel to closed in sql * Channels sql WIP: get closed channels in list_channels response * Channels sql WIP: get closed channel by rpc_id in get_channel_details response * Channels sql WIP: add closing transaction to sql * outbound channels history in sql completed * Payments in sql WIP: add/get payment to/from sql * Payments in sql completed * update rust-lightning to v0.0.105 * set manually_accept_inbound_channels to true to be able to add them to sql in the future * correct calculation of claimed balances * add destination to payment info * add description to payment info * add created/updated at to payment info, wip: list payments by filter * list_payments_by_filter completed, pagination completed * list channels by filter for open and closed * fix wasm build * part of review fixes * part of review fixes: save_channel_closing_details function * review fixes wip: simplify find_watched_output_spend_with_header * review fixes * reviw fix for funding_generated_in_block * fix saving closing tx to db issues if electrums are down * review fixes: better grouping of SqlStorage trait functions + added descriptions * review fixes: add get_open_channels_by_filter fn * review fixes wip: some refactors * review fixes wip: default_fee_per_kb, refactors * review fixes: use try_loop_with_sleep macro wip * review fixes * remove wasm warnings * destination can't be None in OutboundPayment * empty string for description instead of an option * Review fixes: refactors * review fixes wip * wip: more review fixes * review fixes: inline, refactors * sql_text_conversion_err, h256_slice_from_row
1 parent 3b79a87 commit 7dace4e

30 files changed

Lines changed: 4059 additions & 1430 deletions

Cargo.lock

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

mm2src/coins/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ jsonrpc-core = "8.0.1"
5050
keys = { path = "../mm2_bitcoin/keys" }
5151
lazy_static = "1.4"
5252
libc = "0.2"
53-
lightning = "0.0.104"
53+
lightning = "0.0.105"
5454
lightning-background-processor = { path = "lightning_background_processor" }
55-
lightning-invoice = "0.12.0"
55+
lightning-invoice = "0.13.0"
5656
metrics = "0.12"
5757
mocktopus = "0.7.0"
5858
num-traits = "0.2"
@@ -93,7 +93,7 @@ web-sys = { version = "0.3.55", features = ["console", "Headers", "Request", "Re
9393
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
9494
dirs = { version = "1" }
9595
lightning-persister = { path = "lightning_persister" }
96-
lightning-net-tokio = "0.0.104"
96+
lightning-net-tokio = "0.0.105"
9797
rust-ini = { version = "0.13" }
9898
rustls = { version = "0.19", features = ["dangerous_configuration"] }
9999
tokio = { version = "1.7" }

mm2src/coins/eth.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use std::collections::HashMap;
4848
use std::ops::Deref;
4949
use std::path::PathBuf;
5050
use std::str::FromStr;
51-
use std::sync::atomic::{AtomicU64, Ordering as AtomicOrderding};
51+
use std::sync::atomic::{AtomicU64, Ordering as AtomicOrdering};
5252
use std::sync::{Arc, Mutex};
5353
use web3::types::{Action as TraceAction, BlockId, BlockNumber, Bytes, CallRequest, FilterBuilder, Log, Trace,
5454
TraceFilterBuilder, Transaction as Web3Transaction, TransactionId};
@@ -3100,13 +3100,13 @@ impl MmCoin for EthCoin {
31003100
})
31013101
}
31023102

3103-
fn required_confirmations(&self) -> u64 { self.required_confirmations.load(AtomicOrderding::Relaxed) }
3103+
fn required_confirmations(&self) -> u64 { self.required_confirmations.load(AtomicOrdering::Relaxed) }
31043104

31053105
fn requires_notarization(&self) -> bool { false }
31063106

31073107
fn set_required_confirmations(&self, confirmations: u64) {
31083108
self.required_confirmations
3109-
.store(confirmations, AtomicOrderding::Relaxed);
3109+
.store(confirmations, AtomicOrdering::Relaxed);
31103110
}
31113111

31123112
fn set_requires_notarization(&self, _requires_nota: bool) {

0 commit comments

Comments
 (0)