From c196812ef920490c3bd5b4efb3da6f75dc4c5946 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Tue, 13 Feb 2024 15:18:02 -0600 Subject: [PATCH] Increase default HeaderQueue max_age value --- src/app.rs | 22 ++++++++++++++++++++++ src/bitcoin/header_queue.rs | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index 163917c4..b436282a 100644 --- a/src/app.rs +++ b/src/app.rs @@ -934,6 +934,28 @@ impl ConvertSdkTx for InnerApp { Ok(PaidCall { payer, paid }) } + "nomic/PayIntoFeePool" => { + let msg = msg + .value + .as_object() + .ok_or_else(|| Error::App("Invalid message value".to_string()))?; + + let recovery_addr: bitcoin::Address = msg["recovery_address"] + .as_str() + .ok_or_else(|| Error::App("Invalid recovery address".to_string()))? + .parse() + .map_err(|_| Error::App("Invalid recovery address".to_string()))?; + + let script = + crate::bitcoin::adapter::Adapter::new(recovery_addr.script_pubkey()); + + let funding_amt = MIN_FEE; + let payer = build_call!(self.accounts.take_as_funding(funding_amt.into())); + let paid = build_call!(self.bitcoin.set_recovery_script(script.clone())); + + Ok(PaidCall { payer, paid }) + } + _ => Err(Error::App("Unsupported message type".into())), } } diff --git a/src/bitcoin/header_queue.rs b/src/bitcoin/header_queue.rs index 43bef15f..69dea250 100644 --- a/src/bitcoin/header_queue.rs +++ b/src/bitcoin/header_queue.rs @@ -13,7 +13,7 @@ use orga::prelude::*; use orga::Error as OrgaError; use orga::Result as OrgaResult; -const MAX_LENGTH: u64 = 4032; +const MAX_LENGTH: u64 = 24_192; // ~6 months const MAX_RELAY: u64 = 250; const MAX_TIME_INCREASE: u32 = 2 * 60 * 60; const RETARGET_INTERVAL: u32 = 2016;