diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-11-28 22:32:13 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-11-28 22:32:58 +0000 |
commit | 8f6ec90c83f63a8b20ac3c977379067dc1589342 (patch) | |
tree | 0df0bf460bf85f4271a89eaaf4b06b330ce5c2d4 /src | |
parent | Merge pull request #1372 (diff) | |
download | monero-8f6ec90c83f63a8b20ac3c977379067dc1589342.tar.xz |
blockchain: reject invalid pubkeys from v4
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index c2ccf3db0..bf2b4b71a 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -2231,6 +2231,19 @@ bool Blockchain::check_tx_outputs(const transaction& tx, tx_verification_context } } + // from v4, forbid invalid pubkeys + if (m_hardfork->get_current_version() >= 4) { + for (const auto &o: tx.vout) { + if (o.target.type() == typeid(txout_to_key)) { + const txout_to_key& out_to_key = boost::get<txout_to_key>(o.target); + if (!crypto::check_key(out_to_key.key)) { + tvc.m_invalid_output = true; + return false; + } + } + } + } + return true; } //------------------------------------------------------------------ |