Fixes #1823. Witness anchors for input notes no longer cross block boundaries.

This commit is contained in:
Simon
2016-12-03 00:22:42 -08:00
parent 5a0d9db4e4
commit 2d931e905b
4 changed files with 168 additions and 8 deletions

View File

@@ -14,6 +14,7 @@
#include "json/json_spirit_value.h"
#include "wallet.h"
#include <unordered_map>
#include <tuple>
// TODO: Compute fee based on a heuristic, e.g. (num tx output * dust threshold) + joinsplit bytes * ?
@@ -41,6 +42,12 @@ struct AsyncJoinSplitInfo
CAmount vpub_new = 0;
};
// A struct to help us track the witnesses and anchor for a given JSOutPoint
struct WitnessAnchorData {
std::vector<boost::optional<ZCIncrementalWitness>> witnesses;
uint256 anchor;
};
class AsyncRPCOperation_sendmany : public AsyncRPCOperation {
public:
AsyncRPCOperation_sendmany(std::string fromAddress, std::vector<SendManyRecipient> tOutputs, std::vector<SendManyRecipient> zOutputs, int minDepth);
@@ -70,7 +77,9 @@ private:
uint256 joinSplitPubKey_;
unsigned char joinSplitPrivKey_[crypto_sign_SECRETKEYBYTES];
// The key is the result string from calling JSOutPoint::ToString()
std::unordered_map<std::string, WitnessAnchorData> jsopWitnessAnchorMap;
std::vector<SendManyRecipient> t_outputs_;
std::vector<SendManyRecipient> z_outputs_;
std::vector<SendManyInputUTXO> t_inputs_;