Renaming publish_req since there's no response.
This commit is contained in:
parent
443f7967e6
commit
35d7ea705d
6 changed files with 35 additions and 35 deletions
|
@ -156,7 +156,7 @@ void rai::network::publish_block (boost::asio::ip::udp::endpoint const & endpoin
|
|||
{
|
||||
client.log.add (boost::str (boost::format ("Publish %1% to %2%") % block->hash ().to_string () % endpoint_a));
|
||||
}
|
||||
rai::publish_req message (std::move (block));
|
||||
rai::publish message (std::move (block));
|
||||
rai::work work;
|
||||
message.work = work.create (message.block->hash ());
|
||||
std::shared_ptr <std::vector <uint8_t>> bytes (new std::vector <uint8_t>);
|
||||
|
@ -258,9 +258,9 @@ void rai::network::receive_action (boost::system::error_code const & error, size
|
|||
}
|
||||
break;
|
||||
}
|
||||
case rai::message_type::publish_req:
|
||||
case rai::message_type::publish:
|
||||
{
|
||||
rai::publish_req incoming;
|
||||
rai::publish incoming;
|
||||
rai::bufferstream stream (buffer.data (), size_a);
|
||||
auto error (incoming.deserialize (stream));
|
||||
receive ();
|
||||
|
@ -276,7 +276,7 @@ void rai::network::receive_action (boost::system::error_code const & error, size
|
|||
++insufficient_work_count;
|
||||
if (insufficient_work_logging ())
|
||||
{
|
||||
client.log.add ("Insufficient work for publish_req");
|
||||
client.log.add ("Insufficient work for publish");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -406,12 +406,12 @@ void rai::network::merge_peers (std::shared_ptr <std::vector <uint8_t>> const &
|
|||
}
|
||||
}
|
||||
|
||||
rai::publish_req::publish_req (std::unique_ptr <rai::block> block_a) :
|
||||
rai::publish::publish (std::unique_ptr <rai::block> block_a) :
|
||||
block (std::move (block_a))
|
||||
{
|
||||
}
|
||||
|
||||
bool rai::publish_req::deserialize (rai::stream & stream_a)
|
||||
bool rai::publish::deserialize (rai::stream & stream_a)
|
||||
{
|
||||
rai::message_type type;
|
||||
auto result (read (stream_a, type));
|
||||
|
@ -428,9 +428,9 @@ bool rai::publish_req::deserialize (rai::stream & stream_a)
|
|||
return result;
|
||||
}
|
||||
|
||||
void rai::publish_req::serialize (rai::stream & stream_a)
|
||||
void rai::publish::serialize (rai::stream & stream_a)
|
||||
{
|
||||
write (stream_a, rai::message_type::publish_req);
|
||||
write (stream_a, rai::message_type::publish);
|
||||
write (stream_a, work);
|
||||
rai::serialize_block (stream_a, *block);
|
||||
}
|
||||
|
@ -1305,9 +1305,9 @@ void rai::keepalive_ack::visit (rai::message_visitor & visitor_a) const
|
|||
visitor_a.keepalive_ack (*this);
|
||||
}
|
||||
|
||||
void rai::publish_req::visit (rai::message_visitor & visitor_a) const
|
||||
void rai::publish::visit (rai::message_visitor & visitor_a) const
|
||||
{
|
||||
visitor_a.publish_req (*this);
|
||||
visitor_a.publish (*this);
|
||||
}
|
||||
|
||||
void rai::keepalive_ack::serialize (rai::stream & stream_a)
|
||||
|
@ -2229,7 +2229,7 @@ public:
|
|||
{
|
||||
assert (false);
|
||||
}
|
||||
void publish_req (rai::publish_req const &)
|
||||
void publish (rai::publish const &)
|
||||
{
|
||||
assert (false);
|
||||
}
|
||||
|
@ -2399,7 +2399,7 @@ public:
|
|||
{
|
||||
assert (false);
|
||||
}
|
||||
void publish_req (rai::publish_req const &)
|
||||
void publish (rai::publish const &)
|
||||
{
|
||||
assert (false);
|
||||
}
|
||||
|
@ -3602,7 +3602,7 @@ public:
|
|||
});
|
||||
}
|
||||
}
|
||||
void publish_req (rai::publish_req const & message_a) override
|
||||
void publish (rai::publish const & message_a) override
|
||||
{
|
||||
if (network_message_logging ())
|
||||
{
|
||||
|
@ -3845,7 +3845,7 @@ bool rai::confirm_req::operator == (rai::confirm_req const & other_a) const
|
|||
return work == other_a.work && *block == *other_a.block;
|
||||
}
|
||||
|
||||
bool rai::publish_req::operator == (rai::publish_req const & other_a) const
|
||||
bool rai::publish::operator == (rai::publish const & other_a) const
|
||||
{
|
||||
return work == other_a.work && *block == *other_a.block;
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ namespace rai {
|
|||
not_a_type,
|
||||
keepalive_req,
|
||||
keepalive_ack,
|
||||
publish_req,
|
||||
publish,
|
||||
confirm_req,
|
||||
confirm_ack,
|
||||
confirm_unk,
|
||||
|
@ -155,15 +155,15 @@ namespace rai {
|
|||
std::array <rai::endpoint, 24> peers;
|
||||
rai::uint256_union checksum;
|
||||
};
|
||||
class publish_req : public message
|
||||
class publish : public message
|
||||
{
|
||||
public:
|
||||
publish_req () = default;
|
||||
publish_req (std::unique_ptr <rai::block>);
|
||||
publish () = default;
|
||||
publish (std::unique_ptr <rai::block>);
|
||||
void visit (rai::message_visitor &) const override;
|
||||
bool deserialize (rai::stream &);
|
||||
void serialize (rai::stream &) override;
|
||||
bool operator == (rai::publish_req const &) const;
|
||||
bool operator == (rai::publish const &) const;
|
||||
rai::uint256_union work;
|
||||
std::unique_ptr <rai::block> block;
|
||||
};
|
||||
|
@ -222,7 +222,7 @@ namespace rai {
|
|||
public:
|
||||
virtual void keepalive_req (rai::keepalive_req const &) = 0;
|
||||
virtual void keepalive_ack (rai::keepalive_ack const &) = 0;
|
||||
virtual void publish_req (rai::publish_req const &) = 0;
|
||||
virtual void publish (rai::publish const &) = 0;
|
||||
virtual void confirm_req (rai::confirm_req const &) = 0;
|
||||
virtual void confirm_ack (rai::confirm_ack const &) = 0;
|
||||
virtual void confirm_unk (rai::confirm_unk const &) = 0;
|
||||
|
|
|
@ -1063,7 +1063,7 @@ void rai::account_iterator::set_current ()
|
|||
auto slice (iterator->value ());
|
||||
rai::bufferstream stream (reinterpret_cast <uint8_t const *> (slice.data ()), slice.size ());
|
||||
auto error (current.second.deserialize (stream));
|
||||
assert (!error);
|
||||
assert (!error); // {TODO} Corrupt db
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -373,8 +373,8 @@ namespace rai
|
|||
account_iterator latest_end ();
|
||||
|
||||
void pending_put (rai::block_hash const &, rai::address const &, rai::amount const &, rai::address const &);
|
||||
void pending_del (rai::identifier const &);
|
||||
bool pending_get (rai::identifier const &, rai::address &, rai::amount &, rai::address &);
|
||||
void pending_del (rai::block_hash const &);
|
||||
bool pending_get (rai::block_hash const &, rai::address &, rai::amount &, rai::address &);
|
||||
bool pending_exists (rai::block_hash const &);
|
||||
|
||||
rai::uint128_t representation_get (rai::address const &);
|
||||
|
|
|
@ -1195,7 +1195,7 @@ TEST (fork, publish)
|
|||
send1->hashables.balance.clear ();
|
||||
send1->hashables.destination = key1.pub;
|
||||
rai::sign_message (rai::test_genesis_key.prv, rai::test_genesis_key.pub, send1->hash (), send1->signature);
|
||||
rai::publish_req publish1;
|
||||
rai::publish publish1;
|
||||
publish1.block = std::move (send1);
|
||||
rai::keypair key2;
|
||||
std::unique_ptr <rai::send_block> send2 (new rai::send_block);
|
||||
|
@ -1203,7 +1203,7 @@ TEST (fork, publish)
|
|||
send2->hashables.balance.clear ();
|
||||
send2->hashables.destination = key2.pub;
|
||||
rai::sign_message (rai::test_genesis_key.prv, rai::test_genesis_key.pub, send2->hash (), send2->signature);
|
||||
rai::publish_req publish2;
|
||||
rai::publish publish2;
|
||||
publish2.block = std::move (send2);
|
||||
client1.processor.process_message (publish1, rai::endpoint {}, true);
|
||||
ASSERT_EQ (0, client1.conflicts.roots.size ());
|
||||
|
@ -1244,7 +1244,7 @@ TEST (fork, keep)
|
|||
send1->hashables.balance.clear ();
|
||||
send1->hashables.destination = key1.pub;
|
||||
rai::sign_message (rai::test_genesis_key.prv, rai::test_genesis_key.pub, send1->hash (), send1->signature);
|
||||
rai::publish_req publish1;
|
||||
rai::publish publish1;
|
||||
publish1.block = std::move (send1);
|
||||
rai::keypair key2;
|
||||
std::unique_ptr <rai::send_block> send2 (new rai::send_block);
|
||||
|
@ -1252,7 +1252,7 @@ TEST (fork, keep)
|
|||
send2->hashables.balance.clear ();
|
||||
send2->hashables.destination = key2.pub;
|
||||
rai::sign_message (rai::test_genesis_key.prv, rai::test_genesis_key.pub, send2->hash (), send2->signature);
|
||||
rai::publish_req publish2;
|
||||
rai::publish publish2;
|
||||
publish2.block = std::move (send2);
|
||||
client1.processor.process_message (publish1, rai::endpoint {}, true);
|
||||
client2.processor.process_message (publish1, rai::endpoint {}, true);
|
||||
|
@ -1295,7 +1295,7 @@ TEST (fork, flip)
|
|||
send1->hashables.balance.clear ();
|
||||
send1->hashables.destination = key1.pub;
|
||||
rai::sign_message (rai::test_genesis_key.prv, rai::test_genesis_key.pub, send1->hash (), send1->signature);
|
||||
rai::publish_req publish1;
|
||||
rai::publish publish1;
|
||||
publish1.block = std::move (send1);
|
||||
rai::keypair key2;
|
||||
std::unique_ptr <rai::send_block> send2 (new rai::send_block);
|
||||
|
@ -1303,7 +1303,7 @@ TEST (fork, flip)
|
|||
send2->hashables.balance.clear ();
|
||||
send2->hashables.destination = key2.pub;
|
||||
rai::sign_message (rai::test_genesis_key.prv, rai::test_genesis_key.pub, send2->hash (), send2->signature);
|
||||
rai::publish_req publish2;
|
||||
rai::publish publish2;
|
||||
publish2.block = std::move (send2);
|
||||
client1.processor.process_message (publish1, rai::endpoint {}, true);
|
||||
client2.processor.process_message (publish2, rai::endpoint {}, true);
|
||||
|
@ -1347,7 +1347,7 @@ TEST (fork, multi_flip)
|
|||
send1->hashables.balance.clear ();
|
||||
send1->hashables.destination = key1.pub;
|
||||
rai::sign_message (rai::test_genesis_key.prv, rai::test_genesis_key.pub, send1->hash (), send1->signature);
|
||||
rai::publish_req publish1;
|
||||
rai::publish publish1;
|
||||
publish1.block = std::move (send1);
|
||||
rai::keypair key2;
|
||||
std::unique_ptr <rai::send_block> send2 (new rai::send_block);
|
||||
|
@ -1355,14 +1355,14 @@ TEST (fork, multi_flip)
|
|||
send2->hashables.balance.clear ();
|
||||
send2->hashables.destination = key2.pub;
|
||||
rai::sign_message (rai::test_genesis_key.prv, rai::test_genesis_key.pub, send2->hash (), send2->signature);
|
||||
rai::publish_req publish2;
|
||||
rai::publish publish2;
|
||||
publish2.block = std::move (send2);
|
||||
std::unique_ptr <rai::send_block> send3 (new rai::send_block);
|
||||
send3->hashables.previous = publish2.block->hash ();
|
||||
send3->hashables.balance.clear ();
|
||||
send3->hashables.destination = key2.pub;
|
||||
rai::sign_message (rai::test_genesis_key.prv, rai::test_genesis_key.pub, send3->hash (), send3->signature);
|
||||
rai::publish_req publish3;
|
||||
rai::publish publish3;
|
||||
publish3.block = std::move (send3);
|
||||
client1.processor.process_message (publish1, rai::endpoint {}, true);
|
||||
client2.processor.process_message (publish2, rai::endpoint {}, true);
|
||||
|
|
|
@ -257,13 +257,13 @@ TEST (network, publish_req)
|
|||
block->hashables.previous.clear ();
|
||||
block->hashables.balance = 200;
|
||||
block->hashables.destination = key2.pub;
|
||||
rai::publish_req req (std::move (block));
|
||||
rai::publish req (std::move (block));
|
||||
std::vector <uint8_t> bytes;
|
||||
{
|
||||
rai::vectorstream stream (bytes);
|
||||
req.serialize (stream);
|
||||
}
|
||||
rai::publish_req req2;
|
||||
rai::publish req2;
|
||||
rai::bufferstream stream2 (bytes.data (), bytes.size ());
|
||||
auto error (req2.deserialize (stream2));
|
||||
ASSERT_FALSE (error);
|
||||
|
@ -366,7 +366,7 @@ TEST (network, send_insufficient_work)
|
|||
block->hashables.previous.clear ();
|
||||
block->hashables.balance = 20;
|
||||
rai::sign_message (rai::test_genesis_key.prv, rai::test_genesis_key.pub, block->hash (), block->signature);
|
||||
rai::publish_req publish;
|
||||
rai::publish publish;
|
||||
publish.block = std::move (block);
|
||||
std::shared_ptr <std::vector <uint8_t>> bytes (new std::vector <uint8_t>);
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue