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

Fix bugs related to fidelity registration and redemption #390

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
16 changes: 12 additions & 4 deletions src/maker/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use std::{
atomic::{AtomicBool, Ordering::Relaxed},
Arc, Mutex, RwLock,
},
thread::JoinHandle,
thread::{self, JoinHandle},
time::{Duration, Instant},
};

Expand All @@ -49,16 +49,26 @@ use crate::{
use super::{config::MakerConfig, error::MakerError};

/// Interval for health checks on a stable RPC connection with bitcoind.
pub const RPC_PING_INTERVAL: Duration = Duration::from_secs(10);
pub const RPC_PING_INTERVAL_SECS: u32 = 9;

// Currently we don't refresh address at DNS. The Maker only post it once at startup.
// If the address record gets deleted, or the DNS gets blasted, the Maker won't know.
// TODO: Make the maker repost their address to DNS once a day in spawned thread.
// pub const DIRECTORY_SERVERS_REFRESH_INTERVAL_SECS: u64 = Duartion::from_days(1); // Once a day.

/// Maker triggers the recovery mechanism, if Taker is idle for more than 1 hour.
#[cfg(feature = "integration-test")]
pub const IDLE_CONNECTION_TIMEOUT: Duration = Duration::from_secs(60);
#[cfg(not(feature = "integration-test"))]
pub const IDLE_CONNECTION_TIMEOUT: Duration = Duration::from_secs(60 * 60);

/// Interval for fidelity expiry check i.e after every 1 block = 10 mins
#[cfg(feature = "integration-test")]
pub const FIDELITY_CHECK_INTERVAL_SECS: u32 = 3;

#[cfg(not(feature = "integration-test"))]
pub const FIDELITY_CHECK_INTERVAL_SECS: u32 = 600;

/// The minimum difference in locktime (in blocks) between the incoming and outgoing swaps.
///
/// This value specifies the reaction time, in blocks, available to a Maker
Expand Down Expand Up @@ -111,8 +121,6 @@ pub const TIME_RELATIVE_FEE_PCT: f64 = 0.005;
/// Minimum Coinswap amount; makers will not accept amounts below this.
pub const MIN_SWAP_AMOUNT: u64 = 10_000;

// What's the use of RefundLocktimeStep?

/// Used to configure the maker for testing purposes.
///
/// This enum defines various behaviors that can be assigned to the maker during testing
Expand Down
Loading