aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/cryptonote_core.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-10-22 20:46:51 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-10-23 00:32:49 +0100
commit1e163666f3c5265d9d091eece0403de6bc5eca96 (patch)
tree8a7abe757ab6c2116d524e08d4a6a7f71d64e4f4 /src/cryptonote_core/cryptonote_core.cpp
parentf3c374fe08c2f309b3349a2341f4ebf5b8c10609 (diff)
downloadmonzero-core-1e163666f3c5265d9d091eece0403de6bc5eca96.tar.gz
monzero-core-1e163666f3c5265d9d091eece0403de6bc5eca96.tar.xz
monzero-core-1e163666f3c5265d9d091eece0403de6bc5eca96.zip
core: notify the txpool when transactions are relayed
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index a82d96416..95c49f627 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -709,6 +709,20 @@ namespace cryptonote
return true;
}
//-----------------------------------------------------------------------------------------------
+ void core::on_transaction_relayed(const cryptonote::blobdata& tx_blob)
+ {
+ std::list<std::pair<crypto::hash, cryptonote::transaction>> txs;
+ cryptonote::transaction tx;
+ crypto::hash tx_hash, tx_prefix_hash;
+ if (!parse_and_validate_tx_from_blob(tx_blob, tx, tx_hash, tx_prefix_hash))
+ {
+ LOG_ERROR("Failed to parse relayed tranasction");
+ return;
+ }
+ txs.push_back(std::make_pair(tx_hash, std::move(tx)));
+ m_mempool.set_relayed(txs);
+ }
+ //-----------------------------------------------------------------------------------------------
bool core::get_block_template(block& b, const account_public_address& adr, difficulty_type& diffic, uint64_t& height, const blobdata& ex_nonce)
{
return m_blockchain_storage.create_block_template(b, adr, diffic, height, ex_nonce);