Bitcoin Forum
May 04, 2024, 06:25:45 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Lifecycle of a Message  (Read 1021 times)
cloudboy (OP)
Hero Member
*****
Offline Offline

Activity: 690
Merit: 500


View Profile
August 20, 2014, 04:31:41 AM
Last edit: August 20, 2014, 05:10:08 AM by cloudboy
 #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
In order to get the maximum amount of activity points possible, you just need to post once per day on average. Skipping days is OK as long as you maintain the average.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714847145
Hero Member
*
Offline Offline

Posts: 1714847145

View Profile Personal Message (Offline)

Ignore
1714847145
Reply with quote  #2

1714847145
Report to moderator
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12972


View Profile
August 20, 2014, 06: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.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!