multi: use witnessScript everywhere instead of redeemScript

This commit consists of a mass variable renaming to call the pkScript being executed for segwit outputs the `witnessScript` instead of `redeemScript`. The latter naming convention is generally considered to be reserved for the context of BIP 16 execution. With segwit to be deployed soon, we should be using the correct terminology uniformly through the codebase. 

In addition some minor typos throughout the codebase has been fixed.
This commit is contained in:
andrew.shvv authored and Olaoluwa Osuntokun committed 2016-10-15 16:02:09 -07:00
1 parent e038491f8a
commit e515710a7d
13 files changed
+77 -76

No files matched your search

+1 -1
View File
@@ -57,7 +57,7 @@ type BtcWallet struct {
var _ lnwallet.WalletController = (*BtcWallet)(nil)
// New returns a new fully initialized instance of BtcWallet given a valid
// confirguration struct.
// configuration struct.
func New(cfg *Config) (*BtcWallet, error) {
// Ensure the wallet exists or create it when the create flag is set.
netDir := networkDir(cfg.DataDir, cfg.NetParams)
+2 -2
View File
@@ -96,7 +96,7 @@ func (b *BtcWallet) fetchPrivKey(pub *btcec.PublicKey) (*btcec.PrivateKey, error
//
// This is a part of the WalletController interface.
func (b *BtcWallet) SignOutputRaw(tx *wire.MsgTx, signDesc *lnwallet.SignDescriptor) ([]byte, error) {
redeemScript := signDesc.RedeemScript
witnessScript := signDesc.WitnessScript
privKey, err := b.fetchPrivKey(signDesc.PubKey)
if err != nil {
@@ -105,7 +105,7 @@ func (b *BtcWallet) SignOutputRaw(tx *wire.MsgTx, signDesc *lnwallet.SignDescrip
amt := signDesc.Output.Value
sig, err := txscript.RawTxInWitnessSignature(tx, signDesc.SigHashes, 0,
amt, redeemScript, txscript.SigHashAll, privKey)
amt, witnessScript, txscript.SigHashAll, privKey)
if err != nil {
return nil, err
}