cryptonote_utils/construct_tx, monero_sendingFunds_utils/SendFunds: disallowing sending to subaddr with pid

pull/24/head
Paul Shapiro 6 years ago
parent 85a1e1ead6
commit f603bd7d53

@ -1692,7 +1692,10 @@ var cnUtil = function(currencyConfig)
// R = rD for subaddresses
if(this.is_subaddress(dsts[i].address, nettype)) {
txkey.pub = ge_scalarmult(dsts[i].keys.spend, txkey.sec);
if (typeof payment_id !== 'undefined' && payment_id) { // this could stand to be placed earlier in the function but we save repeating a little algo time this way
throw "Payment ID must not be supplied when sending to a subaddress"
}
txkey.pub = this.ge_scalarmult(dsts[i].keys.spend, txkey.sec);
}
var out_derivation;

@ -226,10 +226,16 @@ function SendFunds(
__trampolineFor_err_withStr(typeof e === 'string' ? e : e.toString())
return
}
if (address__decode_result.intPaymentId && payment_id) {
const errStr = "Payment ID field must be blank when using an Integrated Address"
__trampolineFor_err_withStr(errStr)
return
if (payment_id) {
if (address__decode_result.intPaymentId) {
const errStr = "Payment ID must be blank when using an Integrated Address"
__trampolineFor_err_withStr(errStr)
return
} else if (monero_utils.is_subaddress(moneroReady_targetDescription_address, nettype)) {
const errStr = "Payment ID must be blank when using a Subaddress"
__trampolineFor_err_withStr(errStr)
return
}
}
if (address__decode_result.intPaymentId) {
final__payment_id = address__decode_result.intPaymentId

Loading…
Cancel
Save