Skip to content

Commit 4627b0f

Browse files
committed
Merge pull request #6681
19bb72d add trezor support to sweep_single (ph4r05)
2 parents 829cbfd + 19bb72d commit 4627b0f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/simplewallet/simplewallet.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7340,6 +7340,32 @@ bool simple_wallet::sweep_single(const std::vector<std::string> &args_)
73407340
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_monero_tx";
73417341
}
73427342
}
7343+
else if (m_wallet->get_account().get_device().has_tx_cold_sign())
7344+
{
7345+
try
7346+
{
7347+
tools::wallet2::signed_tx_set signed_tx;
7348+
std::vector<cryptonote::address_parse_info> dsts_info;
7349+
dsts_info.push_back(info);
7350+
7351+
if (!cold_sign_tx(ptx_vector, signed_tx, dsts_info, [&](const tools::wallet2::signed_tx_set &tx){ return accept_loaded_tx(tx); })){
7352+
fail_msg_writer() << tr("Failed to cold sign transaction with HW wallet");
7353+
return true;
7354+
}
7355+
7356+
commit_or_save(signed_tx.ptx, m_do_not_relay);
7357+
success_msg_writer(true) << tr("Money successfully sent, transaction: ") << get_transaction_hash(ptx_vector[0].tx);
7358+
}
7359+
catch (const std::exception& e)
7360+
{
7361+
handle_transfer_exception(std::current_exception(), m_wallet->is_trusted_daemon());
7362+
}
7363+
catch (...)
7364+
{
7365+
LOG_ERROR("Unknown error");
7366+
fail_msg_writer() << tr("unknown error");
7367+
}
7368+
}
73437369
else if (m_wallet->watch_only())
73447370
{
73457371
bool r = m_wallet->save_tx(ptx_vector, "unsigned_monero_tx");

0 commit comments

Comments
 (0)