Skip to content

Commit

Permalink
Fix overflow bug in analyzepsbt fee: CAmount instead of int
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa committed Mar 11, 2019
1 parent c94852e commit c9963ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1981,8 +1981,8 @@ UniValue analyzepsbt(const JSONRPCRequest& request)
}
if (calc_fee) {
// Get the output amount
CAmount out_amt = std::accumulate(psbtx.tx->vout.begin(), psbtx.tx->vout.end(), 0,
[](int a, const CTxOut& b) {
CAmount out_amt = std::accumulate(psbtx.tx->vout.begin(), psbtx.tx->vout.end(), CAmount(0),
[](CAmount a, const CTxOut& b) {
return a += b.nValue;
}
);
Expand Down

0 comments on commit c9963ae

Please sign in to comment.