Nbitcoin: The redeem provided does not match the scriptPubKey of the coin

0

Trying to spend litecoin from a p2sh address, i get this error when trying to convert utxos to scriptcoin.

var add1 = "MP3RwwmVDoHw3h25uKHn8PLA8DhjaZtooQ";

var fromadd = BitcoinAddress.Create(add1, network);

    var add2 = "MVVftwwVt2KputjnVb858n4kzz8Wthrk3B";
    var destadd = BitcoinAddress.Create(add2, network);

    var utxos = GetUnSpentCoinsN($"{xpubstring}-[p2sh]").Result;

   // i have tried using the ScriptPubKey of from address and destination address still the same error
    var realredeem = PayToScriptHashTemplate.Instance.GenerateScriptPubKey(fromadd.ScriptPubKey);


  //i get the error at this point - The redeem provided does not match the scriptPubKey of the coin
    var utxoScriptCoin = utxos.Select(a => a.ToScriptCoin(realredeem)).ToList();

victor bolum

Posted 2020-07-06T06:43:25.577

Reputation: 11

No answers