mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Implement a proper Monero Timelock type
Transaction scanning now returns the timelock to ensure it's acknowledged by wallets. Fixes https://github.com/serai-dex/serai/issues/16.
This commit is contained in:
@@ -9,7 +9,7 @@ use frost::MultisigKeys;
|
||||
use monero::util::address::Address;
|
||||
use monero_serai::{
|
||||
frost::Ed25519,
|
||||
transaction::Transaction,
|
||||
transaction::{Timelock, Transaction},
|
||||
rpc::Rpc,
|
||||
wallet::{SpendableOutput, SignableTransaction}
|
||||
};
|
||||
@@ -90,7 +90,18 @@ impl Coin for Monero {
|
||||
}
|
||||
|
||||
async fn get_outputs(&self, block: &Self::Block, key: dfg::EdwardsPoint) -> Vec<Self::Output> {
|
||||
block.iter().flat_map(|tx| tx.scan(self.view, key.0)).map(Output::from).collect()
|
||||
block
|
||||
.iter()
|
||||
.flat_map(|tx| {
|
||||
let (outputs, timelock) = tx.scan(self.view, key.0);
|
||||
if timelock == Timelock::None {
|
||||
outputs
|
||||
} else {
|
||||
vec![]
|
||||
}
|
||||
})
|
||||
.map(Output::from)
|
||||
.collect()
|
||||
}
|
||||
|
||||
async fn prepare_send<R: RngCore + CryptoRng>(
|
||||
|
||||
Reference in New Issue
Block a user