diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-05-14 14:06:55 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-05-25 22:23:37 +0100 |
commit | b52abd1370cc21484d64f45504adbab47240debf (patch) | |
tree | 42c9327b4b928d008fcc61e4b7ca09c85ec9ccd9 /src/cryptonote_protocol/cryptonote_protocol_handler.inl | |
parent | Merge pull request #1956 (diff) | |
download | monero-b52abd1370cc21484d64f45504adbab47240debf.tar.xz |
Move txpool to the database
Integration could go further (ie, return_tx_to_pool calls should
not be needed anymore, possibly other things).
poolstate.bin is now obsolete.
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_handler.inl')
-rw-r--r-- | src/cryptonote_protocol/cryptonote_protocol_handler.inl | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index 79578a34e..8b41ce514 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -479,7 +479,7 @@ namespace cryptonote // we might already have the tx that the peer // sent in our pool, so don't verify again.. - if(!m_core.get_pool_transaction(tx_hash, tx)) + if(!m_core.pool_has_tx(tx_hash)) { MDEBUG("Incoming tx " << tx_hash << " not in pool, adding"); cryptonote::tx_verification_context tvc = AUTO_VAL_INIT(tvc); @@ -536,9 +536,10 @@ namespace cryptonote size_t tx_idx = 0; for(auto& tx_hash: new_block.tx_hashes) { - if(m_core.get_pool_transaction(tx_hash, tx)) + cryptonote::blobdata txblob; + if(m_core.get_pool_transaction(tx_hash, txblob)) { - have_tx.push_back(tx_to_blob(tx)); + have_tx.push_back(txblob); } else { @@ -731,6 +732,15 @@ namespace cryptonote if(context.m_state != cryptonote_connection_context::state_normal) return 1; + // while syncing, core will lock for a long time, so we ignore + // those txes as they aren't really needed anyway, and avoid a + // long block before replying + if(!is_synchronized()) + { + LOG_DEBUG_CC(context, "Received new tx while syncing, ignored"); + return 1; + } + for(auto tx_blob_it = arg.txs.begin(); tx_blob_it!=arg.txs.end();) { cryptonote::tx_verification_context tvc = AUTO_VAL_INIT(tvc); |