mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-11 13:39:25 +00:00
Prefix arbitrary data with 127
Since we cannot expect/guarantee a payment ID will be included, the previous position-based code for determining arbitrary data wasn't sufficient.
This commit is contained in:
@@ -6,7 +6,7 @@ use crate::{
|
||||
Protocol,
|
||||
wallet::{
|
||||
address::MoneroAddress, Fee, SpendableOutput, SignableTransaction, TransactionError,
|
||||
extra::MAX_TX_EXTRA_NONCE_SIZE,
|
||||
extra::MAX_ARBITRARY_DATA_SIZE,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -104,7 +104,7 @@ impl SignableTransactionBuilder {
|
||||
}
|
||||
|
||||
pub fn add_data(&mut self, data: Vec<u8>) -> Result<Self, TransactionError> {
|
||||
if data.len() > MAX_TX_EXTRA_NONCE_SIZE {
|
||||
if data.len() > MAX_ARBITRARY_DATA_SIZE {
|
||||
Err(TransactionError::TooMuchData)?;
|
||||
}
|
||||
self.0.write().unwrap().add_data(data);
|
||||
|
||||
Reference in New Issue
Block a user