Skip to content

Commit

Permalink
Fix incorrect check on distribution len
Browse files Browse the repository at this point in the history
The RingCT distribution on mainnet doesn't start until well after
genesis, so the distribution length is expected to be < height.

To be clear, this was my mistake from this series of changes
to the DSA. I noticed this mistake because the DSA would error
when running on mainnet.
  • Loading branch information
j-berman committed Feb 20, 2024
1 parent 19973f9 commit 733e6c9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions coins/monero/src/wallet/decoys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,7 @@ async fn select_decoys<R: RngCore + CryptoRng, RPC: RpcConnection>(
// Should never happen, yet risks desyncing if it did
distribution.truncate(height);

if distribution.len() != height {
Err(RpcError::InternalError("unexpected rct out distribution len"))?;
} else if distribution.len() < DEFAULT_LOCK_WINDOW {
if distribution.len() < DEFAULT_LOCK_WINDOW {
Err(RpcError::InternalError("not enough decoy candidates"))?;
}

Expand Down

0 comments on commit 733e6c9

Please sign in to comment.