Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: What happens when non-Segwit transactions are sent to Segwit nodes?
by
victoriobn
on 29/08/2017, 00:50:04 UTC
⭐ Merited by ETFbitcoin (1)
@achow101 thanks a lot man!

So, both types of transactions can coexists in Segwit nodes mempool at the same time? They are then broadcasted to other nodes as is?

Just one more question: once a Segwit node receives a non-Segwit transaction, are there instructions like "if Segwit do this || if non-Segwit do that" in order to put it in the mempool?

The same reasoning apply to blocks sent from non-Segwit to Segwit nodes? I ask cause, when sending from a Segwit node, there are instructions that orientate the "block type" to be broadcasted accordingly to the destiny (Segwit or Legacy), as shown bellow:

Code:
if (inv.type == MSG_BLOCK)
     connman.PushMessageWithFlag(pfrom, SERIALIZE_TRANSACTION_NO_WITNESS, NetMsgType::BLOCK, block);
else if (inv.type == MSG_WITNESS_BLOCK)
     connman.PushMessage(pfrom, NetMsgType::BLOCK, block);

Thanks again Smiley