Skip to content

About the process of sending the transaction by the Bitcoin core. #95

Open

Description

@youngminpark2559

At this page:
https://github.com/youngmtool/ProgrammingBlockchain/blob/master/bitcoin_transfer/spend_your_coin.md

At this code:

using (var node = Node.ConnectToLocal(network)) //Connect to the node
{
    node.VersionHandshake(); //Say hello
                             //Advertize your transaction (send just the hash)
    node.SendMessage(new InvPayload(InventoryType.MSG_TX, transaction.GetHash()));
    //Send it
    node.SendMessage(new TxPayload(transaction));
    Thread.Sleep(500); //Wait a bit
}

For me, I think the explanations about the code is lack about the role of VersionHandshake(), SendMessage(), InvPayload(), InventoryType, MSG_TX, TxPayload().

Could you give some explanations on each one?

Activity

  1. nopara73 commented on Nov 23, 2017

    @nopara73
    Contributor

    Actually this is not the correct way to send it, but it would be kind of overkill to do it properly in the book.

    You only send transaction when a node asks for it.
    So you need a listener that is listening to every message nodes send to you.
    If you catch an inv txid message then you check if you have the transactions and if you have it then you send the tx.

    So why do we send the inv txid? It's because that's how we tell the node, "hey, we have this tx in our inventory" and if the node decides that it needs it then we give them the transaction.

  2. youngminpark2559 commented on Nov 24, 2017

    @youngminpark2559
    ContributorAuthor

    Thanks for answer.

  3. Ogunyinka27 commented on Jul 26, 2022

    @Ogunyinka27

    Hello

  4. Ogunyinka27 commented on Aug 5, 2022

    @Ogunyinka27

    how to put bitcoin address to generate script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions