mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-12 04:42:36 -03:00
Fix overflow bug in analyzepsbt fee: CAmount instead of int
This commit is contained in:
parent
c94852e791
commit
c9963ae8b1
1 changed files with 2 additions and 2 deletions
|
@ -1981,8 +1981,8 @@ UniValue analyzepsbt(const JSONRPCRequest& request)
|
||||||
}
|
}
|
||||||
if (calc_fee) {
|
if (calc_fee) {
|
||||||
// Get the output amount
|
// Get the output amount
|
||||||
CAmount out_amt = std::accumulate(psbtx.tx->vout.begin(), psbtx.tx->vout.end(), 0,
|
CAmount out_amt = std::accumulate(psbtx.tx->vout.begin(), psbtx.tx->vout.end(), CAmount(0),
|
||||||
[](int a, const CTxOut& b) {
|
[](CAmount a, const CTxOut& b) {
|
||||||
return a += b.nValue;
|
return a += b.nValue;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue