aboutsummaryrefslogtreecommitdiff
path: root/src/rpcmining.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2014-11-03 20:47:25 +0100
committerWladimir J. van der Laan <[email protected]>2014-11-03 20:55:46 +0100
commitff17816abf2d2be2b349c4ba4d49633a126074fa (patch)
treee2b7c0e84a2314876ecaabeaf3788ceffee1da60 /src/rpcmining.cpp
parentMerge pull request #5157 (diff)
parentRPC: submitblock: Support for returning specific rejection reasons (diff)
downloaddiscoin-ff17816abf2d2be2b349c4ba4d49633a126074fa.tar.xz
discoin-ff17816abf2d2be2b349c4ba4d49633a126074fa.zip
Merge pull request #3727
e69a587 RPC: submitblock: Support for returning specific rejection reasons (Luke Dashjr)
Diffstat (limited to 'src/rpcmining.cpp')
-rw-r--r--src/rpcmining.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp
index 0be4e0616..879a50411 100644
--- a/src/rpcmining.cpp
+++ b/src/rpcmining.cpp
@@ -593,7 +593,12 @@ Value submitblock(const Array& params, bool fHelp)
throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason);
}
if (state.IsInvalid())
- return "rejected"; // TODO: report validation state
+ {
+ std::string strRejectReason = state.GetRejectReason();
+ if (strRejectReason.empty())
+ return "rejected";
+ return strRejectReason;
+ }
return Value::null;
}