mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Clarify when wallet2 will decrypt payment IDs with citations
This commit is contained in:
@@ -301,12 +301,28 @@ impl WalletOutput {
|
|||||||
|
|
||||||
/// The payment ID included with this output.
|
/// The payment ID included with this output.
|
||||||
///
|
///
|
||||||
/// This field may be `Some` even if wallet2 would not return a payment ID. This will happen if
|
/// This field may be `Some` even if wallet2 would not return a payment ID. wallet2 will only
|
||||||
/// the scanned output belongs to the subaddress which spent Monero within the transaction which
|
/// decrypt a payment ID if either:
|
||||||
/// created the output. If multiple subaddresses spent Monero within this transactions, the key
|
///
|
||||||
/// image with the highest index is determined to be the subaddress considered as the one
|
/// A) The transaction wasn't made by the wallet (via checking if any key images are recognized)
|
||||||
/// spending.
|
/// B) For the highest-indexed input with a recognized key image, it spends an output with
|
||||||
// TODO: Clarify and cite for point A ("highest index spent key image"??)
|
/// subaddress account `(a, _)` which is distinct from this output's subaddress account
|
||||||
|
///
|
||||||
|
/// Neither of these cases are handled by `monero-wallet` as scanning doesn't have the context
|
||||||
|
/// of key images.
|
||||||
|
//
|
||||||
|
// Identification of the subaddress account for the highest-indexed input with a recognized key
|
||||||
|
// image:
|
||||||
|
// https://github.com/monero-project/monero/blob/a1dc85c5373a30f14aaf7dcfdd95f5a7375d3623
|
||||||
|
// /src/wallet/wallet2.cpp/#L2637-L2670
|
||||||
|
//
|
||||||
|
// Removal of 'transfers' received to this account:
|
||||||
|
// https://github.com/monero-project/monero/blob/a1dc85c5373a30f14aaf7dcfdd95f5a7375d3623
|
||||||
|
// /src/wallet/wallet2.cpp/#L2782-L2794
|
||||||
|
//
|
||||||
|
// Payment IDs only being decrypted for the remaining transfers:
|
||||||
|
// https://github.com/monero-project/monero/blob/a1dc85c5373a30f14aaf7dcfdd95f5a7375d3623
|
||||||
|
// /src/wallet/wallet2.cpp/#L2796-L2844
|
||||||
pub fn payment_id(&self) -> Option<PaymentId> {
|
pub fn payment_id(&self) -> Option<PaymentId> {
|
||||||
self.metadata.payment_id
|
self.metadata.payment_id
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user