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

Method get_output_handler

src/Core/WalletHDsqlite.cpp:585–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

583}
584
585Wallet::OutputHandler WalletHDsqlite::get_output_handler() const {
586 SecretKey vsk_copy = m_view_secret_key;
587 hardware::HardwareWallet *hw_copy = m_view_secret_key == SecretKey{} ? m_hw.get() : nullptr;
588 // When we have imported view key, we can scan as usual
589 return
590 [vsk_copy, hw_copy](uint8_t tx_version, const KeyDerivation &kd, const Hash &tx_inputs_hash,
591 size_t output_index, const OutputKey &key_output, PublicKey *address_S, PublicKey *output_shared_secret) {
592 // multicore preparator should be never used with hardware wallet, otherwise crash
593 // we will remake architecture later
594 if (hw_copy) {
595 auto Pv = hw_copy->scan_outputs({key_output.public_key}).at(0);
596 *address_S = unlinkable_underive_address_S_step2(Pv, tx_inputs_hash, output_index,
597 key_output.public_key, key_output.encrypted_secret, output_shared_secret);
598 } else {
599 *address_S = unlinkable_underive_address_S(vsk_copy, tx_inputs_hash, output_index,
600 key_output.public_key, key_output.encrypted_secret, output_shared_secret);
601 }
602 };
603}
604
605bool WalletHDsqlite::detect_our_output(uint8_t tx_version, const Hash &tx_inputs_hash, const KeyDerivation &kd,
606 size_t out_index, const PublicKey &address_S, const PublicKey &output_shared_secret, const OutputKey &key_output,

Callers

nothing calls this directly

Calls 5

atMethod · 0.80
getMethod · 0.45
scan_outputsMethod · 0.45

Tested by

no test coverage detected