Make PubKey variable names consistent.

This commit is contained in:
Jonathan Gillham 2015-08-02 22:21:27 +01:00
parent 88b15e74f0
commit b448a2b6bc
3 changed files with 11 additions and 11 deletions

View file

@ -1596,8 +1596,8 @@ type rescanKeys struct {
fallbacks map[string]struct{} fallbacks map[string]struct{}
pubKeyHashes map[[ripemd160.Size]byte]struct{} pubKeyHashes map[[ripemd160.Size]byte]struct{}
scriptHashes map[[ripemd160.Size]byte]struct{} scriptHashes map[[ripemd160.Size]byte]struct{}
compressedPubkeys map[[33]byte]struct{} compressedPubKeys map[[33]byte]struct{}
uncompressedPubkeys map[[65]byte]struct{} uncompressedPubKeys map[[65]byte]struct{}
unspent map[wire.OutPoint]struct{} unspent map[wire.OutPoint]struct{}
} }
@ -1684,14 +1684,14 @@ func rescanBlock(wsc *wsClient, lookups *rescanKeys, blk *btcutil.Block) {
case 33: // Compressed case 33: // Compressed
var key [33]byte var key [33]byte
copy(key[:], sa) copy(key[:], sa)
if _, ok := lookups.compressedPubkeys[key]; ok { if _, ok := lookups.compressedPubKeys[key]; ok {
found = true found = true
} }
case 65: // Uncompressed case 65: // Uncompressed
var key [65]byte var key [65]byte
copy(key[:], sa) copy(key[:], sa)
if _, ok := lookups.uncompressedPubkeys[key]; ok { if _, ok := lookups.uncompressedPubKeys[key]; ok {
found = true found = true
} }
@ -1839,8 +1839,8 @@ func handleRescan(wsc *wsClient, icmd interface{}) (interface{}, error) {
fallbacks: map[string]struct{}{}, fallbacks: map[string]struct{}{},
pubKeyHashes: map[[ripemd160.Size]byte]struct{}{}, pubKeyHashes: map[[ripemd160.Size]byte]struct{}{},
scriptHashes: map[[ripemd160.Size]byte]struct{}{}, scriptHashes: map[[ripemd160.Size]byte]struct{}{},
compressedPubkeys: map[[33]byte]struct{}{}, compressedPubKeys: map[[33]byte]struct{}{},
uncompressedPubkeys: map[[65]byte]struct{}{}, uncompressedPubKeys: map[[65]byte]struct{}{},
unspent: map[wire.OutPoint]struct{}{}, unspent: map[wire.OutPoint]struct{}{},
} }
var compressedPubkey [33]byte var compressedPubkey [33]byte
@ -1867,11 +1867,11 @@ func handleRescan(wsc *wsClient, icmd interface{}) (interface{}, error) {
switch len(pubkeyBytes) { switch len(pubkeyBytes) {
case 33: // Compressed case 33: // Compressed
copy(compressedPubkey[:], pubkeyBytes) copy(compressedPubkey[:], pubkeyBytes)
lookups.compressedPubkeys[compressedPubkey] = struct{}{} lookups.compressedPubKeys[compressedPubkey] = struct{}{}
case 65: // Uncompressed case 65: // Uncompressed
copy(uncompressedPubkey[:], pubkeyBytes) copy(uncompressedPubkey[:], pubkeyBytes)
lookups.uncompressedPubkeys[uncompressedPubkey] = struct{}{} lookups.uncompressedPubKeys[uncompressedPubkey] = struct{}{}
default: default:
jsonErr := btcjson.RPCError{ jsonErr := btcjson.RPCError{

View file

@ -58,9 +58,9 @@ var (
// without and OP_ENDIF to correspond to a conditional expression. // without and OP_ENDIF to correspond to a conditional expression.
ErrStackMissingEndif = fmt.Errorf("execute fail, in conditional execution") ErrStackMissingEndif = fmt.Errorf("execute fail, in conditional execution")
// ErrStackTooManyPubkeys is returned if an OP_CHECKMULTISIG is // ErrStackTooManyPubKeys is returned if an OP_CHECKMULTISIG is
// encountered with more than MaxPubKeysPerMultiSig pubkeys present. // encountered with more than MaxPubKeysPerMultiSig pubkeys present.
ErrStackTooManyPubkeys = errors.New("Invalid pubkey count in OP_CHECKMULTISIG") ErrStackTooManyPubKeys = errors.New("Invalid pubkey count in OP_CHECKMULTISIG")
// ErrStackTooManyOperations is returned if a script has more than // ErrStackTooManyOperations is returned if a script has more than
// MaxOpsPerScript opcodes that do not push data. // MaxOpsPerScript opcodes that do not push data.

View file

@ -1904,7 +1904,7 @@ func opcodeCheckMultiSig(op *parsedOpcode, vm *Engine) error {
numPubKeys := int(numKeys.Int32()) numPubKeys := int(numKeys.Int32())
if numPubKeys < 0 || numPubKeys > MaxPubKeysPerMultiSig { if numPubKeys < 0 || numPubKeys > MaxPubKeysPerMultiSig {
return ErrStackTooManyPubkeys return ErrStackTooManyPubKeys
} }
vm.numOps += numPubKeys vm.numOps += numPubKeys
if vm.numOps > MaxOpsPerScript { if vm.numOps > MaxOpsPerScript {