Author

Topic: Where are functions: Add transaction, Sign transaction, Check transaction ... (Read 136 times)

staff
Activity: 3374
Merit: 6530
Just writing some code
SignSignature is the one that sign a transaction with private key no ?
No, ProduceSignature is. SignSignature is not actually used outside of tests.
member
Activity: 96
Merit: 10
By Add Transaction i mean: Create a new transaction.
Follow the code for createrawtransaction. If you are interested in how the wallet works, then follow the code for sendtoaddress

Transaction is checked first and added to Mempool waiting for miners no ?
Yes. However the checking and adding to mempool are done as part of the same function. The AddToMemoryPool function will call the various checking functions for checking a transaction and then add it to the mempool at the end. It also performs its own checks for the additional conditions of adding a transaction to the mempool (e.g. conflicts, replacement, transaction fee, etc.).

First thank you for the explaignation, really appreciated Smiley

SignSignature is the one that sign a transaction with private key no ?
staff
Activity: 3374
Merit: 6530
Just writing some code
By Add Transaction i mean: Create a new transaction.
Follow the code for createrawtransaction. If you are interested in how the wallet works, then follow the code for sendtoaddress

Transaction is checked first and added to Mempool waiting for miners no ?
Yes. However the checking and adding to mempool are done as part of the same function. The AddToMemoryPool function will call the various checking functions for checking a transaction and then add it to the mempool at the end. It also performs its own checks for the additional conditions of adding a transaction to the mempool (e.g. conflicts, replacement, transaction fee, etc.).
member
Activity: 96
Merit: 10
- Add transaction
Add transaction to what?

- Sign the transaction by private key
The code for the RPC command signrawtransactionwithwallet can be found here. Follow the code and it will take you to where transactions are actually signed. Starting with this command shows you the whole process.

- Check the transaction by nodes
- Add to mempool
Checking a transaction is done when it is being added to the mempool (the same functions are used for checking transactions in blocks). Just follow the code for AcceptToMemoryPool

By Add Transaction i mean: Create a new transaction.

Transaction is checked first and added to Mempool waiting for miners no ?

Many thank's
staff
Activity: 3374
Merit: 6530
Just writing some code
- Add transaction
Add transaction to what?

- Sign the transaction by private key
The code for the RPC command signrawtransactionwithwallet can be found here. Follow the code and it will take you to where transactions are actually signed. Starting with this command shows you the whole process.

- Check the transaction by nodes
- Add to mempool
Checking a transaction is done when it is being added to the mempool (the same functions are used for checking transactions in blocks). Just follow the code for AcceptToMemoryPool
member
Activity: 96
Merit: 10
Hi,

I need to know where are the functions responsible to:
- Add transaction
- Sign the transaction by private key
- Check the transaction by nodes
- Add to mempool

In the bitcoin code please ?

What is the function reponsible to check if transaction can be added to block by all nodes, and if it's correct ?

Thank's
Jump to: