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

+3 -3
View File
@@ -127,7 +127,7 @@ type OpenChannel struct {
OurMultiSigKey *btcec.PublicKey
TheirMultiSigKey *btcec.PublicKey
FundingRedeemScript []byte
FundingWitnessScript []byte
// In blocks
LocalCsvDelay uint32
@@ -1095,7 +1095,7 @@ func putChanFundingInfo(nodeChanBucket *bolt.Bucket, channel *OpenChannel) error
return err
}
if err := wire.WriteVarBytes(&b, 0, channel.FundingRedeemScript[:]); err != nil {
if err := wire.WriteVarBytes(&b, 0, channel.FundingWitnessScript[:]); err != nil {
return err
}
@@ -1151,7 +1151,7 @@ func fetchChanFundingInfo(nodeChanBucket *bolt.Bucket, channel *OpenChannel) err
return err
}
channel.FundingRedeemScript, err = wire.ReadVarBytes(infoBytes, 0, 520, "")
channel.FundingWitnessScript, err = wire.ReadVarBytes(infoBytes, 0, 520, "")
if err != nil {
return err
}
+2 -2
View File
@@ -148,7 +148,7 @@ func createTestChannelState(cdb *DB) (*OpenChannel, error) {
FundingOutpoint: testOutpoint,
OurMultiSigKey: privKey.PubKey(),
TheirMultiSigKey: privKey.PubKey(),
FundingRedeemScript: script,
FundingWitnessScript: script,
TheirCurrentRevocation: privKey.PubKey(),
TheirCurrentRevocationHash: key,
OurDeliveryScript: script,
@@ -257,7 +257,7 @@ func TestOpenChannelPutGetDelete(t *testing.T) {
newState.TheirMultiSigKey.SerializeCompressed()) {
t.Fatalf("their multisig key doesn't match")
}
if !bytes.Equal(state.FundingRedeemScript, newState.FundingRedeemScript) {
if !bytes.Equal(state.FundingWitnessScript, newState.FundingWitnessScript) {
t.Fatalf("redeem script doesn't match")
}