New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
You cannot add an unspendable coin #139
Comments
from the source code https://github.com/MetacoSA/NBitcoin/blob/master/NBitcoin/TransactionBuilder.cs when you call AddCoins() method , it checks if the coin is spendable , if its not it throws an error. public TransactionBuilder AddCoins(IEnumerable<ICoin> coins)
{
foreach (var coin in coins)
{
if (coin.TxOut.ScriptPubKey.IsUnspendable)
throw new InvalidOperationException("You cannot add an unspendable coin");
CurrentGroup.Coins.AddOrReplace(coin.Outpoint, coin);
}
return this;
} |
Yeah, if you add an unspendable coin, we indeed cna't spend it and it should crash. What part of the book does it relate to? |
@NicolasDorier this is a different question, I don't want to open an issue on it. is it possible for nbxplorer to generate hardened addresses for me from the derivation scheme it's tracking ? from what I know, you can't generate hardened address from xpub. I can generate the address I want myself using private keys, But since I'll be tracking using nbxplorer, I'll like to use the addresses generated from nbxplorer nbxplorer is currently generating address for me but it's keypath(0/0), what i want us keypath(m/84'/2'/0'/0/0). Thanks for your time |
No it can't. You need to derive the xpub at |
Hi,
I have problem with second transaction. When I use first txtID everything is OK, but when I use second txtID appears "You cannot add an unspendable coin".
MY second txtID is:
8b94a5589cf0416c4e0c0b4a289d31f6db7987756e5e7653d42c3dbd60eb7b14
Nbitcoin + Qbitninja.client is awsome for me. If I found resolve, I'd be very happy :)
Thanks a lot :)
The text was updated successfully, but these errors were encountered: