Author

Topic: Lifecycle of a Message (Read 1024 times)

administrator
Activity: 5222
Merit: 13032
August 20, 2014, 02:50:37 PM
#2
Quote
If an unknown message is received (it will hit the final else statement in ProcessMessage() and be ignored) will it still be propagated to other nodes?

No.

Quote
Is pnode->PushMessage() enough to broadcast a message? From what I understand, it adds the message to the queue of outgoing messages, which are then gathered by    SendMessages() and sent.

PushMessage sends a message to a peer. Only certain message types are then broadcast to the rest of the network.

Quote
Is it possible to assign an expiration date to an individual message? So all nodes know to stop propagating it at that time?

No, but that's not necessary. Nodes don't propagate duplicate information, so block/tx/addr broadcasts reach every network node in a matter of minutes and then stop propagating.

Quote
How can you reject an incoming message and make sure it doesn't get relayed or processed?

Just ignore it when you receive it. ProcessMessage would probably be a good place to put additional logic of this sort.
hero member
Activity: 690
Merit: 501
August 20, 2014, 12:31:41 AM
#1
I understand that messages are handled by ThreadMessageHandler in net.cpp, and are received/sent/processed in main.cpp.

My questions are:
  • If an unknown message is received (it will hit the final else statement in ProcessMessage() and be ignored) will it still be propagated to other nodes?
  • Is pnode->PushMessage() enough to broadcast a message? From what I understand, it adds the message to the queue of outgoing messages, which are then gathered by    SendMessages() and sent.
  • Is it possible to assign an expiration date to an individual message? So all nodes know to stop propagating it at that time?
  • How can you reject an incoming message and make sure it doesn't get relayed or processed?

Thanks
Jump to: