mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-12-24 15:09:35 -05:00
Don't qualify with alice::
if we are within a module of Alice
This commit is contained in:
parent
a31d6febca
commit
5b515d6fb2
@ -2,9 +2,8 @@
|
||||
//! Alice holds XMR and wishes receive BTC.
|
||||
use crate::bitcoin::ExpiredTimelocks;
|
||||
use crate::env::Config;
|
||||
use crate::protocol::alice;
|
||||
use crate::protocol::alice::event_loop::EventLoopHandle;
|
||||
use crate::protocol::alice::AliceState;
|
||||
use crate::protocol::alice::{AliceState, Swap};
|
||||
use crate::{bitcoin, database, monero};
|
||||
use anyhow::{bail, Context, Result};
|
||||
use tokio::select;
|
||||
@ -12,15 +11,12 @@ use tokio::time::timeout;
|
||||
use tracing::{error, info};
|
||||
use uuid::Uuid;
|
||||
|
||||
pub async fn run(swap: alice::Swap) -> Result<AliceState> {
|
||||
pub async fn run(swap: Swap) -> Result<AliceState> {
|
||||
run_until(swap, |_| false).await
|
||||
}
|
||||
|
||||
#[tracing::instrument(name = "swap", skip(swap,exit_early), fields(id = %swap.swap_id), err)]
|
||||
pub async fn run_until(
|
||||
mut swap: alice::Swap,
|
||||
exit_early: fn(&AliceState) -> bool,
|
||||
) -> Result<AliceState> {
|
||||
pub async fn run_until(mut swap: Swap, exit_early: fn(&AliceState) -> bool) -> Result<AliceState> {
|
||||
let mut current_state = swap.state;
|
||||
|
||||
while !is_complete(¤t_state) && !exit_early(¤t_state) {
|
||||
|
Loading…
Reference in New Issue
Block a user