Fix overflow bug in analyzepsbt fee: CAmount instead of int
This commit is contained in:
1 parent
c94852e791
commit
c9963ae8b1
1 file changed
+2
-2
@@ -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;
|
||||
}
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user