Author

Topic: Make First Transaction using NBitcoin Library (Read 635 times)

newbie
Activity: 15
Merit: 0
January 23, 2017, 03:07:23 AM
#5
The code you are seeing in the example IS with fees! the variable called minerFee is the fee that you are paying and it is a fixed amount of 0.0001BTC.

Just change that line to anything you like, it can be a fixed amount or it can be a function taking the best amount of fee based on an API call such as this http://bitcoinfees.21.co/api

Or if you are doing it on top of a full node you can analyze the previous blocks to figure out the suitable fee.

Hi,

Any give me Spend bitcoin using TransactionBuilder?
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
The code you are seeing in the example IS with fees! the variable called minerFee is the fee that you are paying and it is a fixed amount of 0.0001BTC.

Just change that line to anything you like, it can be a fixed amount or it can be a function taking the best amount of fee based on an API call such as this http://bitcoinfees.21.co/api

Or if you are doing it on top of a full node you can analyze the previous blocks to figure out the suitable fee.
newbie
Activity: 15
Merit: 0
I think you are not using NBitcoin library (https://github.com/MetacoSA/NBitcoin) instead you are using the example code. And in that example code according to the book (https://programmingblockchain.gitbooks.io/programmingblockchain/content/bitcoin_transfer/spend_your_coin.html) it is setting the fee amount to 0.0001BTC which means when you spend 0.0001BTC it deducts 0.0001 from your 0.0001 and is left with 0 so as a result it throws an exception

You need to debug the program yourself to make sure, I am mainly making assumptions based on what I see from the code and your explanation.

Thanks for Reply

Can you send source code for send bitcoin with fees?
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
I think you are not using NBitcoin library (https://github.com/MetacoSA/NBitcoin) instead you are using the example code. And in that example code according to the book (https://programmingblockchain.gitbooks.io/programmingblockchain/content/bitcoin_transfer/spend_your_coin.html) it is setting the fee amount to 0.0001BTC which means when you spend 0.0001BTC it deducts 0.0001 from your 0.0001 and is left with 0 so as a result it throws an exception

You need to debug the program yourself to make sure, I am mainly making assumptions based on what I see from the code and your explanation.
newbie
Activity: 15
Merit: 0
Hi,

I am make first transaction of 0.001 using NBitcoin Library. when i make transaction of 0.0001 it give message.
ErrorCode: INSUFFICIENTFEE Error message: insufficient priority

I am make transaction using this code.
https://github.com/NicolasDorier/ProgrammingBlockchainCodeExamples/blob/master/SpendYourCoins/Program.cs

Can any tell me how to transfer transaction fees to my address?

Thanks
Jump to: