Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Erik Jansen
crown-core-test-new-gitlab-runner
Commits
4edab3db
Commit
4edab3db
authored
12 years ago
by
Gavin Andresen
Browse files
Options
Download
Email Patches
Plain Diff
Use unsigned ints to fix signed/unsigned warnings
parent
5a287fb6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/bitcoinrpc.cpp
+1
-1
src/bitcoinrpc.cpp
src/rpcrawtransaction.cpp
+3
-3
src/rpcrawtransaction.cpp
src/script.cpp
+7
-6
src/script.cpp
with
11 additions
and
10 deletions
+11
-10
src/bitcoinrpc.cpp
View file @
4edab3db
...
...
@@ -72,7 +72,7 @@ Object JSONRPCError(int code, const string& message)
void RPCTypeCheck(const Array& params,
const list<Value_type>& typesExpected)
{
int i = 0;
unsigned
int i = 0;
BOOST_FOREACH(Value_type t, typesExpected)
{
if (params.size() <= i)
...
...
This diff is collapsed.
Click to expand it.
src/rpcrawtransaction.cpp
View file @
4edab3db
...
...
@@ -75,12 +75,12 @@ TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry)
}
entry
.
push_back
(
Pair
(
"vin"
,
vin
));
Array
vout
;
for
(
int
i
=
0
;
i
<
tx
.
vout
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
tx
.
vout
.
size
();
i
++
)
{
const
CTxOut
&
txout
=
tx
.
vout
[
i
];
Object
out
;
out
.
push_back
(
Pair
(
"value"
,
ValueFromAmount
(
txout
.
nValue
)));
out
.
push_back
(
Pair
(
"n"
,
i
));
out
.
push_back
(
Pair
(
"n"
,
(
boost
::
int64_t
)
i
));
Object
o
;
ScriptPubKeyToJSON
(
txout
.
scriptPubKey
,
o
);
out
.
push_back
(
Pair
(
"scriptPubKey"
,
o
));
...
...
@@ -402,7 +402,7 @@ Value signrawtransaction(const Array& params, bool fHelp)
const
CKeyStore
&
keystore
=
(
fGivenKeys
?
tempKeystore
:
*
pwalletMain
);
// Sign what we can:
for
(
int
i
=
0
;
i
<
mergedTx
.
vin
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
mergedTx
.
vin
.
size
();
i
++
)
{
CTxIn
&
txin
=
mergedTx
.
vin
[
i
];
if
(
mapPrevOut
.
count
(
txin
.
prevout
)
==
0
)
...
...
This diff is collapsed.
Click to expand it.
src/script.cpp
View file @
4edab3db
...
...
@@ -1331,7 +1331,7 @@ bool SignN(const vector<valtype>& multisigdata, const CKeyStore& keystore, uint2
{
int
nSigned
=
0
;
int
nRequired
=
multisigdata
.
front
()[
0
];
for
(
int
i
=
1
;
i
<
multisigdata
.
size
()
-
1
&&
nSigned
<
nRequired
;
i
++
)
for
(
unsigned
int
i
=
1
;
i
<
multisigdata
.
size
()
-
1
&&
nSigned
<
nRequired
;
i
++
)
{
const
valtype
&
pubkey
=
multisigdata
[
i
];
CKeyID
keyID
=
CPubKey
(
pubkey
).
GetID
();
...
...
@@ -1672,12 +1672,13 @@ static CScript CombineMultisig(CScript scriptPubKey, const CTransaction& txTo, u
}
// Build a map of pubkey -> signature by matching sigs to pubkeys:
int
nSigsRequired
=
vSolutions
.
front
()[
0
];
int
nPubKeys
=
vSolutions
.
size
()
-
2
;
assert
(
vSolutions
.
size
()
>
1
);
unsigned
int
nSigsRequired
=
vSolutions
.
front
()[
0
];
unsigned
int
nPubKeys
=
vSolutions
.
size
()
-
2
;
map
<
valtype
,
valtype
>
sigs
;
BOOST_FOREACH
(
const
valtype
&
sig
,
allsigs
)
{
for
(
int
i
=
0
;
i
<
nPubKeys
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
nPubKeys
;
i
++
)
{
const
valtype
&
pubkey
=
vSolutions
[
i
+
1
];
if
(
sigs
.
count
(
pubkey
))
...
...
@@ -1693,7 +1694,7 @@ static CScript CombineMultisig(CScript scriptPubKey, const CTransaction& txTo, u
// Now build a merged CScript:
unsigned
int
nSigsHave
=
0
;
CScript
result
;
result
<<
OP_0
;
// pop-one-too-many workaround
for
(
int
i
=
0
;
i
<
nPubKeys
&&
nSigsHave
<
nSigsRequired
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
nPubKeys
&&
nSigsHave
<
nSigsRequired
;
i
++
)
{
if
(
sigs
.
count
(
vSolutions
[
i
+
1
]))
{
...
...
@@ -1702,7 +1703,7 @@ static CScript CombineMultisig(CScript scriptPubKey, const CTransaction& txTo, u
}
}
// Fill any missing with OP_0:
for
(
int
i
=
nSigsHave
;
i
<
nSigsRequired
;
i
++
)
for
(
unsigned
int
i
=
nSigsHave
;
i
<
nSigsRequired
;
i
++
)
result
<<
OP_0
;
return
result
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help