mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 04:35:49 +00:00
Fix bug in (redundant) check for transaction result immediately before resubmission
This commit is contained in:
@@ -222,6 +222,20 @@ Transaction.prototype.addSubmittedTxnID = function(hash) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Transaction.prototype.findResultInCache = function(cache) {
|
||||||
|
var cached;
|
||||||
|
|
||||||
|
for (var i = this.submittedTxnIDs.length - 1; i >= 0; i--) {
|
||||||
|
var hash = this.submittedTxnIDs[i];
|
||||||
|
cached = cache[hash];
|
||||||
|
if (cached != null) {
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
return cached;
|
||||||
|
};
|
||||||
|
|
||||||
Transaction.prototype.hash = function(prefix, as_uint256) {
|
Transaction.prototype.hash = function(prefix, as_uint256) {
|
||||||
if (typeof prefix === 'string') {
|
if (typeof prefix === 'string') {
|
||||||
if (typeof hashprefixes[prefix] === 'undefined') {
|
if (typeof hashprefixes[prefix] === 'undefined') {
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ TransactionManager.prototype._resubmit = function(ledgers, pending) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var hashCached = self._cache[pending._hash];
|
var hashCached = pending.findResultInCache(self._cache); //[pending._hash];
|
||||||
self._remote._trace('transactionmanager: resubmit: %s', pending.tx_json);
|
self._remote._trace('transactionmanager: resubmit: %s', pending.tx_json);
|
||||||
|
|
||||||
if (hashCached) {
|
if (hashCached) {
|
||||||
|
|||||||
Reference in New Issue
Block a user