aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-07-12 20:29:32 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-07-12 20:29:32 -0500
commit5e81214d5c8f2bdeb40e54089465dc078142453a (patch)
tree6ab00b99033cde052c0658b53b50737bca987f4d
parentMerge pull request #5737 (diff)
parentwallet_rpc_server: fix get_bulk_payments with short payment ids (diff)
downloadmonero-5e81214d5c8f2bdeb40e54089465dc078142453a.tar.xz
Merge pull request #5747
f3febaf wallet_rpc_server: fix get_bulk_payments with short payment ids (moneromooo-monero)
-rw-r--r--src/wallet/wallet_rpc_server.cpp5
-rwxr-xr-xtests/functional_tests/transfer.py3
2 files changed, 8 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index 8b8d832dc..0e2a34470 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -1745,6 +1745,11 @@ namespace tools
else if (payment_id_str.size() == 2 * sizeof(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
{
diff --git a/tests/functional_tests/transfer.py b/tests/functional_tests/transfer.py
index 7bf0f4957..d9a6e592e 100755
--- a/tests/functional_tests/transfer.py
+++ b/tests/functional_tests/transfer.py
@@ -519,6 +519,9 @@ class TransferTest():
res = self.wallet[2].get_bulk_payments(payment_ids = ['1'*64, '1234500000012345abcde00000abcdeff1234500000012345abcde00000abcde', '2'*64])
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):
print('Checking double spend detection')
txes = [[None, None], [None, None]]