aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2019-03-11 15:16:24 -0700
committerWladimir J. van der Laan <laanwj@gmail.com>2019-03-13 19:36:36 +0100
commit232ef630ecd30b9a3d7c69ec8c7f53df85eb2771 (patch)
treede1f71d4c2619a57d6fec30ff13c194e02824422 /src/rpc
parent2edd0c40c34bb4d0132df31b110005b7fe944170 (diff)
Fix overflow bug in analyzepsbt fee: CAmount instead of int
Github-Pull: #15582 Rebased-From: c9963ae8b1a4d26d19c58e18fde9c85783edb788 Tree-SHA512: ed1dcfafb7015de5405112938b04c4009bec3349a8d4e8aca641598ccab31a34c7f16b5045670909fd2e795fc40640a79658ef6b1771e9f21abd0ca759b239b5
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/rawtransaction.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 541171602e..71acdbfb99 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -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;
}
);