Bitcoin Forum
May 12, 2024, 12:00:28 AM *
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: 501


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
1715472028
Hero Member
*
Offline Offline

Posts: 1715472028

View Profile Personal Message (Offline)

Ignore
1715472028
Reply with quote  #2

1715472028
Report to moderator
Bitcoin mining is now a specialized and very risky industry, just like gold mining. Amateur miners are unlikely to make much money, and may even lose money. Bitcoin is much more than just mining, though!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715472028
Hero Member
*
Offline Offline

Posts: 1715472028

View Profile Personal Message (Offline)

Ignore
1715472028
Reply with quote  #2

1715472028
Report to moderator
1715472028
Hero Member
*
Offline Offline

Posts: 1715472028

View Profile Personal Message (Offline)

Ignore
1715472028
Reply with quote  #2

1715472028
Report to moderator
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12983


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!