Merge pull request #5746

3140a37 wallet_rpc_server: fix get_bulk_payments with short payment ids (moneromooo-monero)
This commit is contained in:
luigi1111 2019-07-12 20:28:15 -05:00
commit fd3ff74164
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
2 changed files with 8 additions and 0 deletions

View file

@ -1745,6 +1745,11 @@ namespace tools
else if (payment_id_str.size() == 2 * sizeof(payment_id8)) else if (payment_id_str.size() == 2 * sizeof(payment_id8))
{ {
r = epee::string_tools::hex_to_pod(payment_id_str, payment_id8); r = epee::string_tools::hex_to_pod(payment_id_str, payment_id8);
if (r)
{
memcpy(payment_id.data, payment_id8.data, 8);
memset(payment_id.data + 8, 0, 24);
}
} }
else else
{ {

View file

@ -519,6 +519,9 @@ class TransferTest():
res = self.wallet[2].get_bulk_payments(payment_ids = ['1'*64, '1234500000012345abcde00000abcdeff1234500000012345abcde00000abcde', '2'*64]) res = self.wallet[2].get_bulk_payments(payment_ids = ['1'*64, '1234500000012345abcde00000abcdeff1234500000012345abcde00000abcde', '2'*64])
assert len(res.payments) >= 1 # one tx was sent assert len(res.payments) >= 1 # one tx was sent
res = self.wallet[1].get_bulk_payments(["1111111122222222"])
assert len(res.payments) >= 1 # we have one of these
def check_double_spend_detection(self): def check_double_spend_detection(self):
print('Checking double spend detection') print('Checking double spend detection')
txes = [[None, None], [None, None]] txes = [[None, None], [None, None]]