Skip to content

Commit dd93329

Browse files
committed
checkout wallet2
1 parent 64cbd2f commit dd93329

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/wallet/wallet2.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ using namespace epee;
9191
#include "common/dns_utils.h"
9292
#include "common/notify.h"
9393
#include "common/perf_timer.h"
94+
#include "common/power.h"
9495
#include "ringct/rctSigs.h"
9596
#include "ringdb.h"
9697
#include "device/device_cold.hpp"
@@ -7754,6 +7755,27 @@ void wallet2::commit_tx(pending_tx& ptx)
77547755
req.tx_as_hex = epee::string_tools::buff_to_hex_nodelimer(tx_to_blob(ptx.tx));
77557756
req.do_not_relay = false;
77567757
req.do_sanity_checks = true;
7758+
7759+
// TODO
7760+
if (!tools::is_local_address(m_daemon_address))
7761+
{
7762+
MDEBUG("Non local RPC: finding PoWER solution");
7763+
7764+
// TODO
7765+
crypto::hash tx_prefix_hash {};
7766+
crypto::hash recent_block_hash {};
7767+
7768+
tools::power::power_solution s = tools::power::solve_rpc(
7769+
tx_prefix_hash,
7770+
recent_block_hash,
7771+
tools::power::DIFFICULTY
7772+
);
7773+
7774+
req.recent_block_hash = epee::string_tools::pod_to_hex(recent_block_hash);
7775+
req.power_solution = epee::string_tools::pod_to_hex(s.solution);
7776+
req.nonce = s.nonce;
7777+
}
7778+
77577779
COMMAND_RPC_SEND_RAW_TX::response daemon_send_resp;
77587780

77597781
{

0 commit comments

Comments
 (0)