Handle Monero fee logic properly in the processor

This commit is contained in:
Luke Parker
2024-07-06 18:46:41 -04:00
parent 6357bc0ed4
commit 9f7dbf2132
3 changed files with 53 additions and 27 deletions

View File

@@ -181,7 +181,7 @@ async fn select_decoys<R: RngCore + CryptoRng>(
// TODO: Create a TX with less than the target amount, as allowed by the protocol
let high = distribution[distribution.len() - DEFAULT_LOCK_WINDOW];
if high.saturating_sub(COINBASE_LOCK_WINDOW as u64) <
if high.saturating_sub(u64::try_from(COINBASE_LOCK_WINDOW).unwrap()) <
u64::try_from(inputs.len() * ring_len).unwrap()
{
Err(RpcError::InternalError("not enough coinbase candidates".to_string()))?;

View File

@@ -137,8 +137,8 @@ pub async fn rpc() -> SimpleRequestRpc {
&Scalar::random(&mut OsRng) * ED25519_BASEPOINT_TABLE,
);
// Mine 40 blocks to ensure decoy availability
rpc.generate_blocks(&addr, 40).await.unwrap();
// Mine 80 blocks to ensure decoy availability
rpc.generate_blocks(&addr, 80).await.unwrap();
rpc
}