| 475 | } |
| 476 | |
| 477 | std::vector<std::tuple<Hash, std::string, BinaryArray>> WalletHDsqlite::payment_queue_get2() const { |
| 478 | std::vector<std::tuple<Hash, std::string, BinaryArray>> result; |
| 479 | sqlite::Stmt stmt_get; |
| 480 | stmt_get.prepare(m_db_dbi, "SELECT tid, net, binary_transaction FROM payment_queue"); |
| 481 | while (stmt_get.step()) { |
| 482 | auto tid_size = stmt_get.column_bytes(0); |
| 483 | auto tid_data = stmt_get.column_blob(0); |
| 484 | auto net_size = stmt_get.column_bytes(1); |
| 485 | auto net_data = stmt_get.column_blob(1); |
| 486 | auto btx_size = stmt_get.column_bytes(2); |
| 487 | auto btx_data = stmt_get.column_blob(2); |
| 488 | |
| 489 | BinaryArray key = decrypt_data(m_wallet_key, tid_data, tid_size); |
| 490 | invariant(key.size() == sizeof(Hash), ""); |
| 491 | Hash tid; |
| 492 | memcpy(tid.data, key.data(), sizeof(Hash)); |
| 493 | BinaryArray net = decrypt_data(m_wallet_key, net_data, net_size); |
| 494 | BinaryArray ba = decrypt_data(m_wallet_key, btx_data, btx_size); |
| 495 | result.push_back(std::make_tuple(tid, std::string(net.begin(), net.end()), ba)); |
| 496 | } |
| 497 | return result; |
| 498 | } |
| 499 | |
| 500 | void WalletHDsqlite::payment_queue_add(const Hash &tid, const std::string &net, const BinaryArray &binary_transaction) { |
| 501 | m_payment_queue[net][tid] = binary_transaction; |
nothing calls this directly
no test coverage detected