diff options
| author | Riccardo Spagni <ric@spagni.net> | 2016-03-12 16:14:07 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2016-03-12 16:14:07 +0200 |
| commit | bb7b31d5eda71e2df4faf676f12d87de5223993e (patch) | |
| tree | 2bc555d25803de37a95b9e612f0e3c655893db49 /src/wallet/wallet_rpc_server.cpp | |
| parent | 9a04793067dddf8ca6bfaec031db49688de03a87 (diff) | |
| parent | 8bc1bd6b65d89ecd36ecc410194512da17212cd3 (diff) | |
| download | monzero-core-bb7b31d5eda71e2df4faf676f12d87de5223993e.tar.gz monzero-core-bb7b31d5eda71e2df4faf676f12d87de5223993e.tar.xz monzero-core-bb7b31d5eda71e2df4faf676f12d87de5223993e.zip | |
Merge pull request #715
8bc1bd6 wallet: use minimum mixin when RPC asks for too low mixin (moneromooo-monero)
31d2e0f wallet_rpc_server: make use_fork_rules public (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
| -rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index ac13d8021..418de327c 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -227,7 +227,12 @@ namespace tools try { - std::vector<wallet2::pending_tx> ptx_vector = m_wallet.create_transactions(dsts, req.mixin, req.unlock_time, req.fee, extra); + uint64_t mixin = req.mixin; + if (mixin < 2 && m_wallet.use_fork_rules(2)) { + LOG_PRINT_L1("Requested mixin " << req.mixin << " too low for hard fork 2, using 2"); + mixin = 2; + } + std::vector<wallet2::pending_tx> ptx_vector = m_wallet.create_transactions(dsts, mixin, req.unlock_time, req.fee, extra); // reject proposed transactions if there are more than one. see on_transfer_split below. if (ptx_vector.size() != 1) @@ -287,11 +292,16 @@ namespace tools try { + uint64_t mixin = req.mixin; + if (mixin < 2 && m_wallet.use_fork_rules(2)) { + LOG_PRINT_L1("Requested mixin " << req.mixin << " too low for hard fork 2, using 2"); + mixin = 2; + } std::vector<wallet2::pending_tx> ptx_vector; if (req.new_algorithm) - ptx_vector = m_wallet.create_transactions_2(dsts, req.mixin, req.unlock_time, req.fee, extra); + ptx_vector = m_wallet.create_transactions_2(dsts, mixin, req.unlock_time, req.fee, extra); else - ptx_vector = m_wallet.create_transactions(dsts, req.mixin, req.unlock_time, req.fee, extra); + ptx_vector = m_wallet.create_transactions(dsts, mixin, req.unlock_time, req.fee, extra); m_wallet.commit_tx(ptx_vector); |
