Example #1
0
        public void requestMissingPoolTransactions(CryptoNoteConnectionContext context)
        {
            if (context.version < 1)
            {
                return;
            }

            NOTIFY_REQUEST_TX_POOL.request notification = new NOTIFY_REQUEST_TX_POOL.request();
            notification.txs = m_core.GetPoolTransactionHashes();

            bool ok = GlobalMembers.post_notify <NOTIFY_REQUEST_TX_POOL>(m_p2p, notification, context);

            if (!ok)
            {
                logger.functorMethod(Logging.Level.WARNING, Logging.BRIGHT_YELLOW) << "Failed to post notification NOTIFY_REQUEST_TX_POOL to " << context.m_connection_id;
            }
        }
Example #2
0
        public bool start_sync(CryptoNoteConnectionContext context)
        {
            logger.functorMethod(Logging.Level.TRACE) << context << "Starting synchronization";

            if (context.m_state == CryptoNoteConnectionContext.state_synchronizing)
            {
                Debug.Assert(context.m_needed_objects.Count == 0);
                Debug.Assert(context.m_requested_objects.Count == 0);

                NOTIFY_REQUEST_CHAIN.request r = boost::value_initialized <NOTIFY_REQUEST_CHAIN.request>();
                r.block_ids = new List <Crypto.Hash>(m_core.BuildSparseChain());
                logger.functorMethod(Logging.Level.TRACE) << context << "-->>NOTIFY_REQUEST_CHAIN: m_block_ids.size()=" << r.block_ids.Count;
                GlobalMembers.post_notify <NOTIFY_REQUEST_CHAIN>(m_p2p, r, context);
            }

            return(true);
        }