aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/rawtransaction.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2019-03-11 15:16:24 -0700
committerPieter Wuille <[email protected]>2019-03-11 15:17:05 -0700
commitc9963ae8b1a4d26d19c58e18fde9c85783edb788 (patch)
tree881fb8f41a5cba1ed0730f44d1fad83bcfc52bf2 /src/rpc/rawtransaction.cpp
parentMerge #15564: cli: remove duplicate wallet fields from -getinfo (diff)
downloaddiscoin-c9963ae8b1a4d26d19c58e18fde9c85783edb788.tar.xz
discoin-c9963ae8b1a4d26d19c58e18fde9c85783edb788.zip
Fix overflow bug in analyzepsbt fee: CAmount instead of int
Diffstat (limited to 'src/rpc/rawtransaction.cpp')
-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 d19afaa8a..3da766163 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;
}
);