Sadly there is currently no way for me to receive the error message, is there a way to make bitcoind export all the errors to a file?
Hmm, I normally keep my debug.log symlinked to /dev/null so not sure how much shows up there. My normal method for listening in on communications between 2 programs would be nc with some plumbing but not sure there is an easy equivalent on windows... Anyone know if fiddler can be used to debug bitcoin RPC communications?
string _TransTest, _TxID, _Signed;
JObject Output;
decimal CurrentVal;
for (int i = 0; i < _ListTex.Length; i++)
{
for (int ii = 0; ii < _ListTex[i].Count; ii++)
{
CurrentVal = 0;
_TxID = _ListTex[i][ii];
JObject JRaw = JObject.Parse(bc.GetRawTransaction(_TxID));
JArray Sign;
decimal WonVal = 0;
if (WinID == i) //Win
{
WonVal = _ListVal[i][ii]*31;
CurrentVal = _ListVal[i][ii];
Sign = new JArray(
new JObject(
new JProperty("txid", _TxID),
new JProperty("vout", 0),
new JProperty("scriptPubKey", (string)JRaw["vout"][0]["scriptPubKey"]["hex"])
)
);
JArray unspent = bc.ListUnspent();
int _Current = 0;
do
{
CurrentVal += decimal.Parse(unspent[_Current]["amount"].ToString(), NumberStyles.Float);
Sign.Add(new JObject(
new JProperty("txid", unspent[_Current]["txid"]),
new JProperty("vout", 0),
new JProperty("scriptPubKey", unspent[_Current]["scriptPubKey"])
));
_Current++;
}
while (CurrentVal < WonVal);
}
else
{
Sign = new JArray(
new JObject(
new JProperty("txid", _TxID),
new JProperty("vout", 0),
new JProperty("scriptPubKey", (string)JRaw["vout"][0]["scriptPubKey"]["hex"])
),
new JObject(
new JProperty("txid", _TxID),
new JProperty("vout", 1),
new JProperty("scriptPubKey", (string)JRaw["vout"][0]["scriptPubKey"]["hex"])
)
);
}
JObject _JRaw = JObject.Parse(bc.GetRawTransaction(_TxID));
if (WinID == i) //Win
{
Output = new JObject(
new JProperty(_ListAds[i][ii], _ListVal[i][ii] * 31),
new JProperty(GlobalAds, WonVal - CurrentVal)
);
}
else //Loose
{
Output = new JObject(
new JProperty(_ListAds[i][ii], 0.00000001m),
new JProperty(GlobalAds, decimal.Parse(_JRaw["vout"][0]["value"].ToString(), NumberStyles.Float) - 0.00000001m)
);
}
_TransTest = bc.CreateRawTransaction(_TxID, Output); //_ListAds[i][_ListTex[i].IndexOf(_Tex)], SendAmount
_Signed = bc.SignRawTransaction(_TransTest, Sign);
JRaw = JObject.Parse(_Signed);
bc.SendRawTransaction(JRaw["hex"].ToString());
}
}
Returns {"result":null,"error":{"code":-22,"message":"TX rejected"},"id":"1"}.