MCPcopy Create free account
hub / github.com/bcndev/bytecoin / payment_queue_get2

Method payment_queue_get2

src/Core/WalletHDsqlite.cpp:477–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

475}
476
477std::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
500void WalletHDsqlite::payment_queue_add(const Hash &tid, const std::string &net, const BinaryArray &binary_transaction) {
501 m_payment_queue[net][tid] = binary_transaction;

Callers

nothing calls this directly

Calls 8

stepMethod · 0.80
column_bytesMethod · 0.80
column_blobMethod · 0.80
prepareMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected